Skip to content

add moss-agent example with LiveKit voice agent integration#262

Merged
HarshaNalluru merged 3 commits into
mainfrom
harshan/moss-agent
May 26, 2026
Merged

add moss-agent example with LiveKit voice agent integration#262
HarshaNalluru merged 3 commits into
mainfrom
harshan/moss-agent

Conversation

@HarshaNalluru
Copy link
Copy Markdown
Contributor

@HarshaNalluru HarshaNalluru commented May 25, 2026

An example of a support voice agent built on the moss-agent SDK, 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

  • Added agent.py, a fully documented example implementing a LiveKit-based voice support agent using the moss-agent SDK. 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

  • Added create_indexes.py, a script to build the three required Moss indexes (ecommerce_products, ecommerce_faq, ecommerce_policies) from the included sample data files.
  • Included sample data files: data/product_catalog.json (10 products), data/faq.json (8 FAQ entries), and data/policies.json (7 policy docs) for index creation.

Documentation and Configuration

  • Added a comprehensive README.md with setup instructions, code walkthrough, sample conversations, and resource links to help users understand and run the example.
  • Added .env.example listing all required environment variables for Moss, OpenAI, Deepgram, Cartesia, and LiveKit, and updated .gitignore to exclude secrets and local files.

Open in Devin Review

Copilot AI review requested due to automatic review settings May 25, 2026 06:18
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread examples/python-moss-agent/agent.py
Comment thread examples/python-moss-agent/create_indexes.py Outdated
Comment thread examples/python-moss-agent/README.md Outdated
Comment thread examples/python-moss-agent/agent.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py using AgentServer + setup_fnc prewarm and per-room attach(ctx), with search_store (multi-index) and search_products (single-index) tools.
  • New create_indexes.py plus data/{product_catalog,faq,policies}.json fixtures to build the three indexes used by the agent.
  • README.md, .env.example, .gitignore, and pyproject.toml wiring the example as a uv-managed project depending on moss-agent[livekit]>=1.0.0 and livekit-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.

Comment thread examples/python-moss-agent/data/product_catalog.json
Comment thread examples/python-moss-agent/create_indexes.py Outdated
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.
@abhigun abhigun self-requested a review May 26, 2026 04:34
@HarshaNalluru HarshaNalluru merged commit 94b216f into main May 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants