Skip to main content
Integrate Moss semantic search into an Agora Conversational AI voice agent using the agora-moss package. Moss is exposed as a single MCP tool (search_knowledge_base) over streamable HTTP - wire it into ConvoAI’s llm.mcp_servers join-body field and your voice agent can look up knowledge base answers in under 10ms during a live call.
Note: For a complete working example, see the agora-moss app.

Why use Moss with Agora?

Agora ConvoAI agents accept MCP servers as tools the LLM can call mid-conversation. Moss drops in as one of those servers: your agent keeps whichever LLM, ASR, and TTS vendors you already use, and gains fast, hallucination-free knowledge base lookups with no LLM-side plumbing.

Required tools

  • Moss account with project credentials
  • Agora account with Conversational AI enabled (App ID, App Certificate, Customer ID, Customer Secret)
  • An OpenAI-compatible LLM endpoint (OpenAI, Groq, Together, vLLM, etc.) plus ASR/TTS vendor keys (Deepgram, Cartesia, or any other Agora-supported provider)
  • A public URL for your MCP server (production host, or ngrok / cloudflared for local dev)
  • Python 3.10+

Integration guide

1

Installation

2

Environment setup

Create a .env file in your project root with your credentials.
.env
3

Run the MCP server

Build a FastMCP app from MossAgoraSearch and serve it at a public HTTPS URL. The index is preloaded into memory during the server’s lifespan so every tool call runs in-process.
server.py
Run it and expose /mcp publicly:
4

Wire into the Agora ConvoAI join body

Point Agora’s ConvoAI REST /join endpoint at your MCP server by adding one mcp_servers entry under llm and flipping advanced_features.enable_tools on. Everything else - vendor, LLM URL, ASR, TTS - stays exactly as you already have it.
Agora rules to watch:
  • Server-entry name must be ≤48 characters and alphanumeric only (no hyphens, underscores, or dots).
  • Transport must be streamable_http.
  • advanced_features.enable_tools must be true.

Configuration

MossAgoraSearch

MossAgoraSearch.search() returns an AgoraSearchResult with documents: list[dict] ({"content": str, "similarity": float}) and time_taken_ms: int | None.

create_mcp_app

Returns a FastMCP instance exposing a single tool: search_knowledge_base(query: str). Exceptions from the adapter are surfaced to the LLM as MCP tool-errors.