wiki search people tested pipeline
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from deepagents import create_deep_agent, SubAgent
|
||||
from deepagents import create_deep_agent
|
||||
|
||||
|
||||
def build_medium_agent(model, agent_tools: list, system_prompt: str):
|
||||
@@ -11,44 +11,9 @@ def build_medium_agent(model, agent_tools: list, system_prompt: str):
|
||||
|
||||
|
||||
def build_complex_agent(model, agent_tools: list, system_prompt: str):
|
||||
"""Complex agent: create_deep_agent with TodoList planning + research/memory subagents."""
|
||||
web_tools = [t for t in agent_tools if getattr(t, "name", "") == "web_search"]
|
||||
memory_tools = [
|
||||
t for t in agent_tools
|
||||
if getattr(t, "name", "") in ("search_memory", "get_all_memories")
|
||||
]
|
||||
|
||||
research_sub: SubAgent = {
|
||||
"name": "research",
|
||||
"description": (
|
||||
"Runs multiple web searches in parallel and synthesizes findings. "
|
||||
"Use for thorough research tasks requiring several queries."
|
||||
),
|
||||
"system_prompt": (
|
||||
"You are a research specialist. Search the web thoroughly using multiple queries. "
|
||||
"Cite sources and synthesize information into a clear summary."
|
||||
),
|
||||
"tools": web_tools,
|
||||
"model": model,
|
||||
}
|
||||
|
||||
memory_sub: SubAgent = {
|
||||
"name": "memory",
|
||||
"description": (
|
||||
"Searches and retrieves all relevant memories about the user comprehensively. "
|
||||
"Use to gather full context from past conversations."
|
||||
),
|
||||
"system_prompt": (
|
||||
"You are a memory specialist. Search broadly using multiple queries. "
|
||||
"Return all relevant facts and context you find."
|
||||
),
|
||||
"tools": memory_tools,
|
||||
"model": model,
|
||||
}
|
||||
|
||||
"""Complex agent: direct agentic loop — calls web_search/fetch_url itself, no subagent indirection."""
|
||||
return create_deep_agent(
|
||||
model=model,
|
||||
tools=agent_tools,
|
||||
system_prompt=system_prompt,
|
||||
subagents=[research_sub, memory_sub],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user