File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
examples/research/src/agent Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 1-
21# Imports
32from contextlib import asynccontextmanager
43
3130async def make_graph ():
3231 async with MultiServerMCPClient (
3332 {
34- "research-server" : {
35- "command" : "npx" ,
36- "args" : ["@playwright/mcp" ],
37- "transport" : "stdio" ,
38- },
3933 "planning-server" : {
4034 "command" : "uvx" ,
4135 "args" : [
@@ -66,13 +60,9 @@ async def make_graph():
6660 # Researcher agent
6761 researcher_agent = create_react_agent (model ,
6862 prompt = researcher_prompt ,
69- tools = client .server_name_to_tools ["research -server" ].append (transfer_to_planner_agent ),
63+ tools = client .server_name_to_tools ["planning -server" ].append (transfer_to_planner_agent ),
7064 name = "researcher_agent" )
7165
7266 # Swarm
73- agent_swarm = create_swarm ([planner_agent , researcher_agent ], default_active_agent = "planner_agent" )
74-
75- # app = agent_swarm.compile(config_schema=Configuration)
76- agent = agent_swarm .compile ()
77-
78- yield agent
67+ agent_swarm = create_swarm ([planner_agent , researcher_agent ], default_active_agent = "planner_agent" )
68+ yield agent_swarm
Original file line number Diff line number Diff line change 66
77<Instructions>
881. Reflect on the user's request.
9- 2. Use the list_doc_sources tool to fetch and read the llms.txt file.
9+ 2. Use the list_doc_sources tool to fetch and the fetch_docs tool to read the llms.txt file.
10103. Identify documents that are relevant to the user's request.
11114. Ask follow-up questions to help refine the project scope and narrow the set of documents to be used for the project.
12125. When the project scope is clear produce a short description of the project with relevant URLs.
2121
2222<Instructions>
23231. Reflect on the project scope and provided URLs from the planner.
24- 2. Use the browser_navigate tool to fetch and read each URL.
24+ 2. Use the fetch_docs tool to fetch and read each URL.
25253. Use the information in these URLs to implement the solution to the user's request.
26264. If you need further clarification or additional sources to implement the solution, transfer to transfer_to_planner_agent.
2727</Instructions>
You can’t perform that action at this time.
0 commit comments