claude-agent-sdk-python icon indicating copy to clipboard operation
claude-agent-sdk-python copied to clipboard

How to "feed" knowledge to agent?

Open chenlujjj opened this issue 2 months ago • 3 comments

Apart from the system prompt, skills, commands, can we feed knowledge to the agent in other forms, like vector-db, documentation?

chenlujjj avatar Nov 07 '25 09:11 chenlujjj

Yes, you can via giving it access to MCP tools and instructions at the start of the agent prompt along the lines of "use XYZ mcp tool/resource/prompt to search for additional details related to ABC". You can also do this with telling it to look through a folder for certain files, or other similar behavior. It's an agent, so if you give it the tools and the instructions, it can do it however you need to do it. I believe you can also put slashcommand references and file references (@file) directly in the prompts or instructions sent to the agent and it'll load those up too. I've personally found sticking to the system prompt or MCP-based retrieval to be the most effective from my experience, but I've not done a ton with skills or hooks yet.

EdanStarfire avatar Nov 16 '25 03:11 EdanStarfire

For a bit of fun, if you are talking about the main "agent" and not subagents, you can also create a streaming session as in this example https://github.com/anthropics/claude-agent-sdk-python/blob/main/examples/streaming_mode.py and simply send more information directly in the conversation after it's done running, or even interrupt it and give it more information to continue with.

EdanStarfire avatar Nov 16 '25 03:11 EdanStarfire

@EdanStarfire Thanks for the informative reply, I'll have a try on that!

chenlujjj avatar Nov 21 '25 04:11 chenlujjj