adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Why there is no support for building custom RAG without using Vertex AI RAG service ?

Open amitv9493 opened this issue 1 year ago • 7 comments

** Please make sure you read the contribution guide and file the issues in the rigth place. ** Contribution guide.

Is your feature request related to a problem? Please describe. We are in the process of choosing one framework for building the Multi Agent application. The only thing which lacks in the google adk is support for building RAGs. As far as I have read the documentation, there is not section for building it.

Describe the solution you'd like There should be a support for using other vector database in order to build RAGs.

Describe alternatives you've considered Currently we are considering Autogen or crew ai for building RAGs.

Additional context NA

amitv9493 avatar May 01 '25 15:05 amitv9493

You can setup your own rag store and define a retrieval function over it. and then pass the retrieval function to the agent.

You can modify this example to work with any custom rag: https://github.com/google/adk-samples/blob/main/agents/RAG/rag/agent.py.

Which rag store do you want to use?

hangfei avatar May 02 '25 03:05 hangfei

@hangfei We are almost set to use chromaDB as a Knowledge base for our RAG.

amitv9493 avatar May 02 '25 06:05 amitv9493

Would love to see an example. Curious to see how Qdrant could be employed,and how the memory service could be ingested into that vector db.

satyaloka93 avatar May 11 '25 13:05 satyaloka93

Looks like the file @hangfei mentioned is now here

garrettlove8 avatar May 21 '25 15:05 garrettlove8

@garrettlove8 Is this not still just using vertex AI rag? How can this work using qdrant/qdrant client, or any other vector db and non-vertext retriever?

satyaloka93 avatar May 21 '25 15:05 satyaloka93

This works with a retriever tool for now

async def knowledgebase_search(query: str):
    """
    Retrieves relevant documents from the knowledgebase using Qdrant vector search.
    Args:
        query: query to search for in the vector db
    Returns:
        dict with 'documents': list of {id, text}
    """
    db = QdrantDB()
    query_vec = embed(query)
    top_docs = db.search(query_vec, top_k=2)
    results = [{"id": doc_id, "text": text} for doc_id, text in top_docs]
    return {"documents": results}

lsinghkochava avatar Jul 15 '25 15:07 lsinghkochava

Hi all, thanks for flagging! Given that there is an option to use the retriever tool as @lsinghkochava pointed out, we will close this for the time being. Please feel free to re-open if necessary.

jwiejulie avatar Aug 25 '25 18:08 jwiejulie