Examples of Knowledge Sources
Let’s consider some of the content that might be useful to serve some popular use cases:Customer Success & Support
Customer Success & Support
- Product Documentation → user guides, FAQs, troubleshooting steps.
- Onboarding Materials → getting started guides, best practices, transcripts from training videos.
Customer Acquisition
Customer Acquisition
- Product Information → features, pricing tiers, competitive comparisons.
- Sales Scripts → qualification questions, objection handling, industry-specific use cases.
Operations
Operations
- Internal Processes → call routing rules, department directories, business hours & holiday schedules.
- Survey Materials → question banks, follow-up questions, rating scales.
Adding RAG to Ultravox
As we saw in the Using Tools guide, tools provide power-ups for your agents. To use RAG with an Ultravox agent, it’s as simple as creating a tool and instructing the agent on how to use the tool.The Easy Way
Ultravox provides the corpus service for RAG.Create a Corpus
Use the Create Corpus endpoint. Give your new corpus a name and (optional) description. This returns a
corpusId.Create a Source
Add a website to crawl using Create Corpus Source. Each source is given a unique
sourceId. We will crawl the URL(s) and ingest all the content.Query the Corpus
After everything is loaded, try some queries using the Query Corpus endpoint.
Use the queryCorpus Tool
Give the built-in queryCorpus tool. to your agents and provide the
corpusId. For example, if we wanted to create a voice agent to answer questions about Seattle, we could provide the tool like this:The Other Way
Let’s assume we have already stored our product documentation in a vector database and can search that content athttps://foo.bar/lookupProductInfo.
Here’s how we might create a tool for our Ultravox agent to use:
Example: Adding a RAG tool
Add Static Files as Corpus Sources
You can use files as sources for any of your corpora. The process requires using the Create Corpus File Upload API to generate an upload URL. Follow these steps:Step 1: Request Upload URL
- Use the Create Corpus File Upload API
- Include the MIME type string in the request body
- This returns the URL to use for upload and the unique ID for the document
- URLs expire after 5 minutes. Request a new one if it expires before using it
The URL that is returned is tied to the provided MIME type. The same MIME type must be used during upload.
Step 2: Upload File
- Use the
presignedUrlfrom Step 1 to upload the document - Ensure the MIME type in the upload matches what was specified in Step 1
text/plain):Step 3: Create New Source with Uploaded Document
- Use the Create Corpus Source API
- Use
uploadto provide thedocumentIdfrom Step 1
You can provide an array of Document IDs to bulk create a source.
Supported File Types
Here’s the information in a markdown table format:| File Extension | Type of File | MIME Type |
|---|---|---|
| doc | Microsoft Word Document | application/msword |
| docx | Microsoft Word Open XML Document | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| txt | Plain Text Document | text/plain |
| md | Markdown Document | text/markdown |
| ppt | Microsoft PowerPoint Presentation | application/vnd.ms-powerpoint |
| pptx | Microsoft PowerPoint Open XML Presentation | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| Portable Document Format | application/pdf |