# Initialize the PDFKnowledgeBaseknowledge_base = PDFKnowledgeBase( vector_db=vector_db, num_documents=5,)# Load first document with user_1 metadataknowledge_base.load_document( path=path/to/cv1.pdf, metadata={"user_id": "jordan_mitchell", "document_type": "cv", "year": 2025}, recreate=True, # Set to True only for the first run, then set to False)# Load second document with user_2 metadataknowledge_base.load_document( path=path/to/cv2.pdf, metadata={"user_id": "taylor_brooks", "document_type": "cv", "year": 2025},)
When you enable agentic filtering (enable_agentic_knowledge_filters=True), the Agent analyzes your query and applies filters based on the metadata it detects.Example:
Copy
Ask AI
agent = Agent( knowledge=knowledge_base, search_knowledge=True, enable_agentic_knowledge_filters=True,)agent.print_response( "Tell me about Jordan Mitchell's experience and skills with jordan_mitchell as user id and document type cv", markdown=True,)
In this example, the Agent will automatically use:
Experience how agentic filters automatically extract relevant metadata from your query.The Agent intelligently narrows down results based on your query.