import asyncio
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.milvus import Milvus
vector_db = Milvus(
collection="recipes",
uri="tmp/milvus.db",
)
knowledge = Knowledge(
url="https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"
vector_db=vector_db,
)
agent = Agent(knowledge=knowledge)
if __name__ == "__main__":
asyncio.run(
knowledge.add_content_async(
url="https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"
)
)
asyncio.run(agent.aprint_response("How to make Tom Kha Gai", markdown=True))
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Install libraries
pip install -U pymilvus pypdf openai agno
Run Agent
python cookbook/knowledge/vector_db/milvus_db/async_milvus_db.py