DocsKnowledge BaseKnowledge Base & RAG
Create document repositories, upload PDFs/DOCX, and ground responses in factual data

Knowledge Base & RAG

Ground your voice AI assistants in factual business knowledge using document repositories, semantic vector embeddings, and Retrieval-Augmented Generation (RAG).

Open Knowledge Base →


Overview

A Knowledge Base gives your voice assistants real-time access to company documentation, policy manuals, product catalogs, and FAQs. During a live conversation, the assistant semantically searches indexed documents to ground its answers, preventing hallucinations.

Knowledge Base RepositoriesKnowledge Base Repositories


1. Creating a Repository

  1. In the left sidebar under Ecosystem, click Knowledge Base.
  2. Click Create Repository.
  3. Enter a repository name (e.g. Health Insurance Policy 2026, Automobile Service Manual) and description.
  4. Click Create.

2. Ingesting & Indexing Files

Once a repository is created, click into it to upload source documents:

  1. Click Add New File.
  2. Drag and drop your source documents into the upload drop-zone.
    • Supported File Types: .pdf, .txt, .docx
    • Maximum File Size: 25 MB per file
  3. Tunk automatically parses document text, splits sections into semantic chunks, and generates vector embeddings using high-dimensional embedding models.
  4. When indexing finishes, the status tag updates to Completed.

Upload File to RepositoryUpload File to Repository


3. Linking Knowledge Base to an Assistant

To make your repository accessible to an assistant during phone calls:

  1. Open Assistant Studio and select your assistant.
  2. Navigate to the Resources tab.
  3. In the Knowledge Base section, check the box next to your repository to bind it.
  4. Click Save Config in the header.

4. Best Practices for Voice AI RAG

Voice conversations require concise, snappy responses. Follow these formatting guidelines for your source documents:

  • Clean Structure: Use clear Markdown headings (#, ##) and bold section names so semantic chunkers isolate topics cleanly.
  • Short Answers: Keep FAQ answers under 2–3 sentences.
  • Avoid Massive Tables: Transcribe dense financial tables into descriptive key-value sentences (e.g. "Basic tier costs $19/month, Pro costs $49/month").
  • Keep Outdated Content Clean: Delete retired versions of policy files to prevent ambiguous retrieval results.

5. Automating Knowledge Base via REST API

Synchronize repositories and documents programmatically from your CMS or CI/CD pipelines using the public API:

Create a Repository

Shell
curl -X POST "$TUNK_BASE_URL/knowledge-base/repository" \
  -H "X-Api-Key: $TUNK_API_KEY" \
  -H "X-Workspace-Id: $TUNK_WORKSPACE_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Policies",
    "description": "Warranty terms, refund rules, and SLA guide"
  }'

Upload a Document File (PDF, DOCX, TXT)

Shell
curl -X POST "$TUNK_BASE_URL/knowledge-base/upload" \
  -H "X-Api-Key: $TUNK_API_KEY" \
  -H "X-Workspace-Id: $TUNK_WORKSPACE_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "repository_id=<repository_uuid>" \
  -F "file=@support-guide.pdf"

Ingest a Web Page URL or Raw Text

Shell
curl -X POST "$TUNK_BASE_URL/knowledge-base" \
  -H "X-Api-Key: $TUNK_API_KEY" \
  -H "X-Workspace-Id: $TUNK_WORKSPACE_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "repository_id": "<repository_uuid>",
    "type": "url",
    "url": "https://example.com/faq",
    "title": "Website FAQ"
  }'

Check Ingestion Status

Shell
curl "$TUNK_BASE_URL/knowledge-base/<item_uuid>/status" \
  -H "X-Api-Key: $TUNK_API_KEY" \
  -H "X-Workspace-Id: $TUNK_WORKSPACE_ID"

The response returns ingestion_status (pending, completed, or failed), ingested_chunks, and any ingestion_error. If ingestion fails, trigger a retry with POST /knowledge-base/<item_uuid>/retry.

Need help? Reach out on our support portal.