Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The Agentic RAG does not work #2051

Open
CodeTilde opened this issue Feb 8, 2025 · 1 comment
Open

[Bug] The Agentic RAG does not work #2051

CodeTilde opened this issue Feb 8, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@CodeTilde
Copy link

CodeTilde commented Feb 8, 2025

Description

The example at https://docs.agno.com/vectordb/chroma does not work

Steps to Reproduce

import typer
from rich.prompt import Prompt
from typing import Optional

from agno.agent import Agent
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
from agno.vectordb.chroma import ChromaDb

knowledge_base = PDFUrlKnowledgeBase(
urls=["https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"],
vector_db=ChromaDb(collection="recipes"),
)

knowledge_base.load(recreate=False)

def pdf_agent(user: str = "user"):
run_id: Optional[str] = None

agent = Agent(

    user_id=user,
    knowledge=knowledge_base,
    search_knowledge=True,
    #use_tools=True,
    show_tool_calls=True,
    debug_mode=True,
)
if run_id is None:
    run_id = agent.run_id
    print(f"Started Run: {run_id}\n")
else:
    print(f"Continuing Run: {run_id}\n")

while True:
    message = Prompt.ask(f"[bold] :sunglasses: {user} [/bold]")
    if message in ("exit", "bye"):
        break
    agent.print_response(message)

if name == "main":
typer.run(pdf_agent)

Agent Configuration (if applicable)

Expected Behavior

Actual Behavior

Screenshots or Logs (if applicable)

DEBUG **************** METRICS END ******************
DEBUG Getting function search_knowledge_base
DEBUG Running: search_knowledge_base(query=Sour Curry with Mixed Vegetables recipe)
DEBUG Getting 5 relevant documents for query: Sour Curry with Mixed Vegetables recipe
ERROR Error searching for documents: list indices must be integers or slices, not str
DEBUG Time to get references: 1.2389s
DEBUG ---------- OpenAI Response Start ----------
DEBUG ============== user ==============
DEBUG Recipe for Sour Curry with Mixed Vegetables?
DEBUG ============== assistant ==============
DEBUG Tool Calls: [
{
"id": "call_PiwA32TUkVMgh64F8MWrZFeN",
"function": {
"arguments": "{"query":"Sour Curry with Mixed Vegetables recipe"}",
"name": "search_knowledge_base"
},
"type": "function"
}
]
DEBUG ============== tool ==============
DEBUG Tool call Id: call_PiwA32TUkVMgh64F8MWrZFeN
DEBUG No documents found
DEBUG ============== assistant ==============
DEBUG I'm sorry, but I couldn't find a specific recipe for Sour Curry with Mixed Vegetables in the knowledge base. However, I can help
you create a basic version of this dish. Here's a simple recipe you can try:

Environment

-Ubuntu

Possible Solutions (optional)

Suggest any ideas you might have to fix or address the issue.

Additional Context

Add any other context or details about the problem here.
if search_knowledge=True, is removed (traditional RAG) the agent works properly.

@CodeTilde CodeTilde added the bug Something isn't working label Feb 8, 2025
@CodeTilde CodeTilde changed the title [Bug] The Agentic RAG does not work? [Bug] The Agentic RAG does not work Feb 8, 2025
@dirkbrnd
Copy link
Contributor

Error searching for documents: list indices must be integers or slices, not str

Sorry this is a known problem with ChromaDB. We will address!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants