instructions (system prompt). This approach ensures that the AI has immediate access to your domain-specific information without requiring external API calls or vector databases.
How It Works
Instead of using RAG (Retrieval-Augmented Generation) with external vector databases, NavTalk integrates knowledge bases by embedding the content directly in the system prompt. This provides:- Immediate access to all knowledge base content
- No latency from external API calls
- Context-aware responses based on your custom data
- Simplified architecture without vector databases
Prepare Your Knowledge Base Content
Organize your knowledge base content into a structured format that can be embedded in the system prompt:
Best Practices for Knowledge Base Content:
- Use clear headings and structure (Markdown format works well)
- Keep sections concise and scannable
- Include FAQs for common questions
- Add examples for technical concepts
- Update regularly to reflect current information
Embed Knowledge Base in System Prompt
Set the
instructions field in your session configuration to include your knowledge base:You can load knowledge base content from files, databases, or APIs when initializing your session, then embed it in the system prompt.
Configure Session with Knowledge Base
Include the knowledge base-enhanced system prompt in your session configuration. Send configuration in the WebSocket
onopen event handler:The
prompt field supports up to 4096 tokens (approximately 16,000 characters) by default. For larger knowledge bases, you may need to:- Summarize or prioritize the most important content
- Use function calling to query external knowledge bases for specific information
- Structure your knowledge base to fit within the token limit
Optional: Combine with Function Calling for Large Knowledge Bases
For knowledge bases that exceed the system prompt token limit, you can combine prompt-based knowledge with function calling to query additional information. Note: Function calling is only supported for OpenAI models (gpt-realtime, gpt-realtime-mini).
Hybrid Approach: Put your most frequently accessed knowledge in the system prompt for instant access, and use function calling to query detailed documentation or databases when needed.
Knowledge Base Content Organization
Structured Format
Structured Format
Organize your knowledge base with clear structure:
Prioritize Frequently Asked Content
Prioritize Frequently Asked Content
Place the most commonly asked information at the top of your knowledge base. This ensures it’s easily accessible within the token limit.
Use Clear Examples
Use Clear Examples
Include concrete examples in your knowledge base to help the AI provide accurate, detailed responses:
Keep Content Concise
Keep Content Concise
Due to token limits, keep each section concise and focused. Remove redundant information and prioritize essential facts.