File Search allows agents to search through their knowledge base to improve their responses. This tool uses a production-ready vector database provided by OpenAI.
Copy
Ask AI
from agency_swarm.tools import FileSearch agent = Agent( name="Researcher", tools=[FileSearch], # Optionally, you can specify your own vector store ID to use: tool_resources={ "file_search": { "vector_store_ids": ["vs_abc123"], }, }, # More details can be found here: https://platform.openai.com/docs/api-reference/vector-stores/object # Other agent parameters )
When to use:
To enrich your agent’s knowledge about specific topics
To reduce hallucinations by grounding agent responses in your documents