Skip to main content
NavTalk’s knowledge base integration allows you to embed your custom knowledge base directly in the 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
1

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
2

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.
3

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
4

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

Organize your knowledge base with clear structure:
Place the most commonly asked information at the top of your knowledge base. This ensures it’s easily accessible within the token limit.
Include concrete examples in your knowledge base to help the AI provide accurate, detailed responses:
Due to token limits, keep each section concise and focused. Remove redundant information and prioritize essential facts.
Token Limits: The system prompt has token limits (default ~4096 tokens). For very large knowledge bases, consider:
  1. Summarizing and prioritizing content
  2. Using a hybrid approach with function calling
  3. Rotating knowledge base content based on conversation context