Meet your country risk helpers!
Bernhard Obenhuber
Apr 18, 2024
This blog post discusses further development in CountryRisk.io’s artificial intelligence (AI) efforts, and is the third post in our AI series. To recap, the first blog discussed how to generate reports based on the CountryRisk.io risk scores (Link), and the second explained how we apply LLMs to reports that result in a more efficient research process (Link).
Before we start and as gentle reminder, keep in mind that everything we do is aligned with our mission to help organisations make better country risk decisions. Two important ways to achieve this goal are to rely on (1) alleviating our users from manual, time-consuming tasks, and (2) super-charging the domain knowledge of our users.
Up until now, we’ve integrated AI support in two separate places on the platform: firstly, in interacting with our risk score data (e.g., let AI write a risk summary) and secondly, in the report page by asking questions against one or multiple PDF reports (e.g., get the key points or the sentiment of a report). But it was always clear to us that there are many more use cases and ways in which AI can support the user by giving it additional capabilities and by allowing the various AI capabilities to interact with each other. In the AI jargon this is also known as agents; we prefer calling them “helpers”.
An AI agent, short for Artificial Intelligence agent, refers to a computer program or system that is designed to simulate human decision-making processes, utilise data or other agents to achieve specific goals or tasks autonomously. A key innovation regarding AI agents is the aspect that an agent works with the other available agents without human coordination.
To get high quality results, it is important to break down complex tasks into distinct sub-tasks that can then be assigned to a specific helper that is trained and instructed accordingly. At CountryRisk.io our big hairy audacious goal (BHAG) is to generate a high-quality country risk report by code.
We’re big on spoiler alerts so here’s one: Even with the latest improvements we are not there yet, but we collectively find that we’ve made ginormous steps toward reaching this goal.
Caution before the reader starts thinking we’re getting way ahead of ourselves: We want to stress that the goal is not to put country risk analysts out of their jobs. Not at all. In fact, we want to empower you. We are convinced that we can advance the quality of country risk analysis by giving the expert more time to be creative and be more thoughtful about their analyses rather than rushing through them.
So, let’s break down the components needed to write a comprehensive country risk report.
- Quantitative country risk model
- Research about qualitative risk factors not covered in the model
Brainstorm related research questions
Select relevant research reports from a curated knowledge base
Extract data from structured and unstructured sources
- Overview and assessment of the latest news flow
- Storyline and structure for the report
- Write and edit the report
In the past – at least in our past as lowly country risk analysts – certain sub-tasks are distributed among the country risk team since often, there’s someone better with models and data, whilst another is more knowledgeable about a topical issue, like small island nations, external debt sustainability, natural endownments and their implications for wealth distribution, and so on. There’s also that someone who has a natural flair for writing who could conjure up snappy titles and captivating storylines. And when it is a bigger report, there might be a project manager who distributes the tasks and orchestrates an efficient functioning of the entire production line. In principle the same approach is taken when one works with AI helpers.
We developed multiple helpers for CountryRisk.io. But before we dive into the various helpers, let’s start with the aspects that remain with the human expert. Firstly, we strongly believe that designing the quantitative model will remain a job for the expert in the foreseeable future. Yes, AI can help with the coding part but not the intrinsic, nuanced and creative part. Secondly, coming up with a good storyline and high conviction messages will also remain with the seasoned expert. As we will see, AI can help with adding content, editing and the repackaging of content for different usages and distribution channels. And with those caveats, let’s turn to CountryRisk.io’s helpers.
Orchestrator is the gatekeeper and takes instructions from the user, assigns it to other helpers and communicates back to the user. It knows the capabilities of the other helpers as well as their limitations. If a user request goes beyond the AI capabilities, the orchestrator will inform the user accordingly.
Librarian knows what is available in the knowledge base of the user or overall organisation. We underscored this point before when we stated that we are convinced that a key part of an analyst’s job will be to source, select and curate relevant information and maintain in a structured knowledge base. The librarian knows what is in the knowledge base and finds the relevant reports and sections for the user or other helpers.
Researcher perhaps has the best job, as a key part is to take the user request (e.g., What are climate risks in Jordan) and to come up with related research questions (e.g., Does the government have a climate change transition strategy?). It’s the “thinking part” of the process. The researcher then asks the librarian for all relevant information and summarizes the information for the user. The researcher can also make risk assessments based on the framework by how it is trained.
Table Wizard has a dull job. It’s pure execution. If there is an interesting table with data in a PDF, the table wizard will convert it into a usable spreadsheet. You simply need to specify the document name and page numbers and it will get back to you in seconds.
Data Wizard fetches data from a database; in our case, the wizard has access to our CountryRisk.io API and get data for a specific country and risk score. Its capabilities could be extended to tap into other data sources like our CountryData.io or a third-party database.
News Agent taps into a third-party news API, looks for relevant news and returns a summary.
Writer comes up with or uses a pre-defined report structure and then interacts with other helpers (e.g., Researcher, Data Wizard, News Agent) to get the components of the report. It then consolidates the information to a coherent report and comes up with titles or subtitles and mentions the used sources. At the end, a word-document is then returned to the user.
One could think of additional helpers, for producing charts or other sub-tasks. But we find that those mentioned above can already boost productivity of our country risk team significantly. Of course, if you have ideas for other helpers, let’s talk. An interesting aspect of the agent-based concept is that it is relatively easy to add new capabilities by adding new ones.
If a helper is lacking some necessary details for completing a task, it will revert to the user. In the simple example below, we are interested in some risk score data. As we did not specify for which country, the helper comes back with a clarification question before it can answer the user question.
In the example above, only two helpers were required: (1) the Orchestrator, who receives the task from the user and assigns it to (2) the helper that is best equipped for the task. In more complex use cases like writing a comprehensive report, multiple execution steps and helpers are involved. The most important steps are shown to the user (see screenshot below). However, in the back – hidden from the user – more activities take place. For example, the News Agent is asked for the latest news as the Report helper needs this input for a comprehensive report. Or the Document Researcher asks the Librarian for all relevant reports before it answers certain research questions given by the Report helper.
There are many instances where the helpers can support, boost productivity, and improve quality. Above, we focused on the use case of writing a multi-page country risk report. Producing standardised government bond prospectus can also be a good application for this concept. As mentioned, the helpers can also make assessments (e.g., asking the helper to assess the quality of fiscal management of country ABC based on some publication(s) and criteria). This means that by continuously updating the underlying knowledge base, the helper can also update its assessment and inform the user about material changes. From this point it is only a small step to let the helpers update a sovereign rating model and write summary reports. We have a future blog post planned on that topic. Stay tuned.
The above use cases are presented from the perspective of a single organisation, and the helpers act within this “closed” environment. Of course, the helpers could also be unleashed to the open world, but our experience shows that some close guardrails and control is needed for quality work by the helper.
We are not there yet that machines could take over all jobs of a country risk analyst. A friend recently said: I want to work in an organisation that gets that AI will change how we work so that I can learn and stay relevant. This is the case at CountryRisk.io, and for me personally, the great fun of working here. I have spent around 20 years as an economist in the country risk domain and have to say that the latest advancements in data and AI are so motivating and makes me curious to explore all the options and test the limitations.