Azure AI Search Integration with Agentic RAG for Embeddings

I’m trying to set up Azure AI Search for embedding search in an agentic RAG knowledge base using the AgentKnowledge class. I have this code snippet:

python

knowledge_base = AgentKnowledge(
    vector_db=PgVector(
        db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
        table_name="azure_openai_embeddings",
        embedder=AzureOpenAIEmbedder(),
    ),
    num_documents=2,
)

But I need to use Azure AI Search instead of PgVector. How do I properly configure the knowledge base to use Azure search service for embedding search? I’m specifically looking at implementing the pattern described in Agentic RAG with Reranking - Agno but with Azure services.

I have these environment variables ready:

AZURE_SEARCH_ENDPOINT=httyendpointps:m.search.windows.net
AZURE_SEARCH_KEY=mysearchkey
AZURE_SEARCH_INDEX_NAME=myindex
AZURE_OPENAI_API_VERSION=2024-05-13
AZURE_OPENAI_EMBEDDING_DEPLOYMENT=embedding

What’s the correct way to set up the vector_db parameter to use Azure AI Search? What Azure credentials do I need and how should they be formatted?

@yash @priti
could you please help

Hey @atharvx
Thank you so much for using Agno and for reaching out to us.

We’ve added your suggestion to our community roadmap Agno Roadmap · GitHub. Since Agno is open-source, you’re more than welcome to explore or even take a shot at building it yourself.If you decide to dive in and need any guidance along the way, we’d be more than happy to help.

1 Like