Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.2.12 on 2026-08-07 14:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('redbox_core', '0122_chatmessagefeedback'),
]

operations = [
migrations.AlterField(
model_name='agent',
name='name',
field=models.CharField(choices=[('Planner_Agent', 'Planner_Agent'), ('Replanner_Agent', 'Replanner_Agent'), ('Internal_Retrieval_Agent', 'Internal_Retrieval_Agent'), ('External_Retrieval_Agent', 'External_Retrieval_Agent'), ('Web_Search_Agent', 'Web_Search_Agent'), ('Legislation_Search_Agent', 'Legislation_Search_Agent'), ('News_Search_Agent', 'News_Search_Agent'), ('Imf_Search_Agent', 'Imf_Search_Agent'), ('Oecd_Search_Agent', 'Oecd_Search_Agent'), ('Wto_Search_Agent', 'Wto_Search_Agent'), ('Mercosur_Search_Agent', 'Mercosur_Search_Agent'), ('Summarisation_Agent', 'Summarisation_Agent'), ('Submission_Checker_Agent', 'Submission_Checker_Agent'), ('Submission_Question_Answer_Agent', 'Submission_Question_Answer_Agent'), ('Tabular_Agent', 'Tabular_Agent'), ('Datahub_Agent', 'Datahub_Agent'), ('Knowledge_Base_Retrieval_Agent', 'Knowledge_Base_Retrieval_Agent'), ('Artifact_Builder_Agent', 'Artifact_Builder_Agent'), ('Evaluator_Agent', 'Evaluator_Agent')], max_length=100, unique=True),
),
]
1 change: 1 addition & 0 deletions redbox/redbox/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def __init__(
self.agent_configs["Imf_Search_Agent"].tools = [web_search]
self.agent_configs["Oecd_Search_Agent"].tools = [web_search]
self.agent_configs["Wto_Search_Agent"].tools = [web_search]
self.agent_configs["Mercosur_Search_Agent"].tools = [web_search]
self.agent_configs["Submission_Question_Answer_Agent"].tools = [
retrieve_full_text,
retrieve_knowledge_base,
Expand Down
12 changes: 12 additions & 0 deletions redbox/redbox/graph/agents/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def get_prompt(self):
system=prompts.WTO_SEARCH_AGENT_PROMPT + prompts.PREVIOUS_AGENT_RESULTS,
prompt_vars=PromptVariable(task=True, expected_output=True, previous_agents_results=True),
),
"Mercosur_Search_Agent": PromptConfig(
system=prompts.MEROCSUR_SEARCH_AGENT_PROMPT + prompts.PREVIOUS_AGENT_RESULTS,
prompt_vars=PromptVariable(task=True, expected_output=True, previous_agents_results=True),
),
"Summarisation_Agent": PromptConfig(
system=prompts.CHAT_WITH_DOCS_SYSTEM_PROMPT,
question=prompts.CHAT_WITH_DOCS_QUESTION_PROMPT,
Expand Down Expand Up @@ -315,6 +319,14 @@ def model_dump(self, *args, **kwargs):
default_agent=False,
agents_max_tokens=10000,
),
"Mercosur_Search_Agent": AgentConfig(
name="Mercosur_Search_Agent",
description=prompts.MERCOSUR_SEARCH_AGENT_DESC,
prompt=prompt_configs["Mercosur_Search_Agent"],
parser=None,
default_agent=False,
agents_max_tokens=10000,
),
"Summarisation_Agent": AgentConfig(
name="Summarisation_Agent",
description=prompts.SUMMARISATION_AGENT_DESC,
Expand Down
1 change: 1 addition & 0 deletions redbox/redbox/graph/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ def add_agent(
add_agent(builder, agent_configs, "Imf_Search_Agent")
add_agent(builder, agent_configs, "Oecd_Search_Agent")
add_agent(builder, agent_configs, "Wto_Search_Agent")
add_agent(builder, agent_configs, "Mercosur_Search_Agent")
add_agent(
builder,
agent_configs,
Expand Down
33 changes: 33 additions & 0 deletions redbox/redbox/models/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,30 @@
Timeframe: If the user requests information for a specific time period, ALWAYS include this time period in the search query.
"""

MEROCSUR_SEARCH_AGENT_PROMPT = """
You are MercosurSearchAgent, an AI assistant designed to search specific Mercosur region websites based on user questions.
Your goal is to complete the task <Task>{task}</Task> with the expected output: <Expected_Output>{expected_output}</Expected_Output> using the most efficient approach possible.

Guidelines for Tool Usage:
1. Please use the available tools to perform multiple parallel tool calls to gather all necessary information.

Decision-Making Process:
- Determine the minimal set of tool calls required
- Prioritize comprehensive yet concise information retrieval
- Avoid redundant or unnecessary tool interactions

Core Capabilities:
Query Analysis: Analyse user questions to identify key search terms and information needs.
Website Navigation: Search within websites or domains to locate relevant information.
Result Extraction: Extract and present the most pertinent information from search results.
Source Citation: Always cite your sources with direct URLs when providing information. Include the URL inline in the response text.
Handling Ambiguity: Request clarification when queries are ambiguous or lack specificity.

Operational Parameters:
Domains: ALWAYS search EACH of the following sites and NO OTHERS: valor.globo.com. NEVER search in other sites. NEVER search without specifying a site.
Dates: ALWAYS provide dates in Long Date Format. ALWAYS state the date on which the source was published if possible, and ONLY do this IF you have certainty of that date. Also provide dates of events when possible, ONLY IF you have certainty of that date.
"""

INTERNAL_RETRIEVAL_AGENT_DESC = """
**Internal_Retrieval_Agent**:
Purpose: Information retrieval and question answering
Expand Down Expand Up @@ -493,6 +517,15 @@
Use when the user wants to search for information or reports on the following topics: International trade, trade policy, trade agreements, trade rules, trade disputes, legal information related to trade, barriers to trade, enablement of trade, trade tariffs, non-tariff measures, trade subsidies, trade statistics, trade of goods, trade of services, digital trade, geopolitics.
"""

MERCOSUR_SEARCH_AGENT_DESC = """
**Mercosur_Search_Agent**:
Purpose: Retrieve information published by Valor Econômico by performing searches across the valor.globo.com website domain only
Use when the user wants to:
- Search for news information relating SPECIFICALLY to Merocsur region countries
- These countries include: Argentina, Bolivia, Brazil, Paraguay, Uruguay and Venezuela as full member states, and Chile, Colombia, Ecuador, Guyana, Panama, Peru and Suriname as associated states
- Search for current affairs information relating to these countries
- Search for information about current or past events relating to these countries"""

SUBMISSION_AGENT_DESC = """
**Submission_Checker_Agent**:
Purpose: Evaluate and check user's submission.
Expand Down
1 change: 1 addition & 0 deletions redbox/tests/graph/test_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TestNewRouteGraphs:
("Imf_Search_Agent", ["combine_question_evaluator"]),
("Oecd_Search_Agent", ["combine_question_evaluator"]),
("Wto_Search_Agent", ["combine_question_evaluator"]),
("Mercosur_Search_Agent", ["combine_question_evaluator"]),
("Web_Search_Agent", ["combine_question_evaluator"]),
("Tabular_Agent", ["combine_question_evaluator"]),
("Summarisation_Agent", None),
Expand Down
Loading