Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent from agno.knowledge.knowledge import Knowledge from agno.vectordb.lancedb import LanceDb vector_db = LanceDb( table_name="vectors", uri="tmp/lancedb", ) knowledge = Knowledge( name="Basic SDK Knowledge Base", description="Agno 2.0 Knowledge Implementation with LanceDB", vector_db=vector_db, ) knowledge.insert( name="Recipes", url="https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf", metadata={"doc_type": "recipe_book"}, ) agent = Agent(knowledge=knowledge) agent.print_response("List down the ingredients to make Massaman Gai", markdown=True) vector_db.delete_by_name("Recipes") # or vector_db.delete_by_metadata({"doc_type": "recipe_book"})
Set up your virtual environment
uv venv --python 3.12 source .venv/bin/activate
Install dependencies
uv pip install -U lancedb pypdf openai agno
Set environment variables
export OPENAI_API_KEY=xxx
Run Agent
python cookbook/08_knowledge/vector_db/lance_db/lance_db.py
Was this page helpful?