Back to prompt library
Claude Agent with Retrieval Tool Implementation
Linked challenge: Agent for Complex Policy & Contract Analysis
Prompt source
implementation1 lines1 sectionsNo variables0 checklist items
Initialize your **Claude Agent** using the **Claude Agents SDK** with **Claude Opus 4.1**. Define a custom tool (`retrieve_document_chunks(query: str) -> List[str]`) that queries your Weaviate instance and returns the top-k most relevant document chunks. The agent should be able to use this tool when asked to analyze a document or a specific legal concept. Provide the agent initialization code and the tool definition.