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?