add moss-agent example with LiveKit voice agent integration#262
Merged
Conversation
…sary configurations
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new self-contained LiveKit voice agent example (examples/python-moss-agent/) that showcases the external moss-agent SDK's "prewarm once, attach per room" pattern: a process-wide MossAgent loads three e-commerce indexes during worker startup, and each LiveKit room scopes a MossCall via agent.attach(ctx) for retrieval-grounded tool calls.
Changes:
- New
agent.pyusingAgentServer+setup_fncprewarm and per-roomattach(ctx), withsearch_store(multi-index) andsearch_products(single-index) tools. - New
create_indexes.pyplusdata/{product_catalog,faq,policies}.jsonfixtures to build the three indexes used by the agent. README.md,.env.example,.gitignore, andpyproject.tomlwiring the example as a uv-managed project depending onmoss-agent[livekit]>=1.0.0andlivekit-agents[...]>=1.0.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/python-moss-agent/agent.py | LiveKit voice agent with process-wide MossAgent prewarm and per-room MossCall attach |
| examples/python-moss-agent/create_indexes.py | Builds the three Moss indexes from JSON fixtures |
| examples/python-moss-agent/data/product_catalog.json | Sample product docs (uses numeric price_usd metadata) |
| examples/python-moss-agent/data/faq.json | Sample FAQ documents for the FAQ index |
| examples/python-moss-agent/data/policies.json | Sample policy documents for the policies index |
| examples/python-moss-agent/README.md | Setup, walkthrough, sample conversation, file map |
| examples/python-moss-agent/pyproject.toml | Declares moss-agent and livekit-agents dependencies |
| examples/python-moss-agent/.env.example | Required env vars for Moss, OpenAI, Deepgram, Cartesia, LiveKit |
| examples/python-moss-agent/.gitignore | Excludes .env, .venv/, and Python build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Moss DocumentInfo.metadata is typed Dict[str, str]. product_catalog.json uses integer price_usd values which would be rejected at index creation. Match the airline-pnr pattern: stringify metadata values on load so the JSON can keep natural ints/bools.
The previous link (usemoss/moss/tree/main/python/moss-agent) 404s because the SDK lives in a separate repo. PyPI is the canonical landing page for end users anyway.
ashvathsureshkumar
approved these changes
May 26, 2026
abhigun
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An example of a support voice agent built on the
moss-agentSDK, demonstrating process-wide index prewarming and per-room agent attachment for high concurrency and low-latency knowledge base search.The most important changes are:
New Example Application: Ecommerce Support Voice Agent
agent.py, a fully documented example implementing a LiveKit-based voice support agent using themoss-agentSDK. It demonstrates process-wide index prewarming, per-room agent scoping, and multi-index retrieval for product, FAQ, and policy queries.Index Creation and Data Ingestion
create_indexes.py, a script to build the three required Moss indexes (ecommerce_products,ecommerce_faq,ecommerce_policies) from the included sample data files.data/product_catalog.json(10 products),data/faq.json(8 FAQ entries), anddata/policies.json(7 policy docs) for index creation.Documentation and Configuration
README.mdwith setup instructions, code walkthrough, sample conversations, and resource links to help users understand and run the example..env.examplelisting all required environment variables for Moss, OpenAI, Deepgram, Cartesia, and LiveKit, and updated.gitignoreto exclude secrets and local files.