pipecat-moss package. This setup allows your voice AI to perform search with sub-10ms latency, ensuring your agents answer questions naturally without awkward “thinking” pauses.
Note: To explore a complete example of deploying pipecat-moss, please visit pipecat-moss examples.
Why Use Moss with Pipecat?
Moss retrieval operates with exceptional speed, seamlessly injecting results into the LLM context before the user completes their turn. This eliminates reliance on slow “tool calling” loops, ensuring interactions remain natural and fluid.Required Tools
To integrate Moss with Pipecat, you will need the following tools: Additional references:Integration Guide
1
Installation
Install the official Pipecat-Moss integration package (requires Python 3.11+).
2
Environment Setup
Create a
.env file in your project root..env
3
Create Knowledge Base
Before running the bot, ensure your Moss index is uploaded. Use the provided script:Run the script using the following command:
4
Build the Pipeline
The To use Moss Inference instead of an OpenAI key, point the LLM service at the Moss gateway:The bot already searches your index in the pipeline (
MossRetrievalService integrates as a processor in the Pipecat pipeline. It sits between the user input and the LLM, injecting relevant context automatically.moss_service.query). The call names no index, so Moss Inference does not search a second time.Run the bot using the following command:Configuration
TheMossRetrievalService allows you to tune how results are retrieved and presented to the LLM.
Initialization
Pipeline Processor
When addingmoss_service.query() to your pipeline, you can adjust the following: