Replies: 1 comment
|
Add a retrieval tool alongside your MCP toolset. ADK does not require the knowledge base to live in the MCP server: it can be a separate index that your agent searches when it needs background information. The integration looks like this: from google.adk.agents import Agent
def search_knowledge(query: str) -> list[dict]:
"""Find relevant passages in the project knowledge base."""
return retriever.search(query)
root_agent = Agent(
name="assistant",
model="gemini-2.5-flash",
instruction=(
"Use search_knowledge for questions about the project. "
"Base your answer on the returned passages and cite their sources."
),
tools=[mcp_toolset, search_knowledge],
)Here Prepare the documents outside the agent loop: extract text, split it into passages, and index those passages for keyword or vector search. The tool returns only the relevant passages for the current question. ADK's For a small, fixed amount of context, you can instead include it in |
Uh oh!
There was an error while loading. Please reload this page.
I have made an Agent with the help of the MCP Server. But now, I want that my agent should have some additional context and for that, I want to provide it a knowledge base.. Just as how we have in CrewAI and Agno. How am I supposed to do that?
All reactions