Skip to Content
Builder Docs
CRM, APIs & Knowledge Bases

Knowledge Bases & RAG Search

Upload PDFs, DOCX, TXT, or Markdown documents via presigned S3 upload, understand the 5 MB processing limit, choose between `chunked` and `full_document` retrieval, and test semantic search.

Knowledge Bases & RAG Search

When an agent needs to answer detailed questions from company policies, product catalogs, pricing guides, or troubleshooting playbooks, stuffing 10,000 words into a system prompt increases latency and hurts instruction following. Instead, upload those files to the Knowledge Base.


Document Upload, Limits & Deduplication

Documents upload directly in two API steps (POST /api/v1/knowledge-base/upload-url -> HTTP PUT bytes to upload_url -> POST /api/v1/knowledge-base/process-document; inspect or soft-delete via GET /api/v1/knowledge-base/documents, GET .../documents/{document_uuid}, DELETE .../documents/{document_uuid}):

  • Strict 5 MB Processing Limit: Although the presigned upload URL permits objects up to 100 MB at transport time (max_size), the background ingestion worker strictly enforces a 5 MB maximum file size. Oversized files fail with processing_status = "failed".
  • Org-Level Duplicate Detection: Uploading a file with the same file hash as an existing active document in the same organization fails ingestion cleanly rather than storing duplicate chunks.
  • Best Practice: Clean, text-based PDFs, Markdown (.md), or .txt files produce the cleanest chunks. Scanned image-only PDFs without embedded text yield empty extractions—convert scanned docs to structured text or Markdown first.

Retrieval Modes: chunked vs full_document

Talkar supports two retrieval strategies per document (and a single Agent node can mix both modes simultaneously via attached document_uuids):

ModeRequires Embeddings Key?How It WorksWhen to Use
chunked (default)Yes (1536-dim, e.g. OpenAI text-embedding-3-small)Splits documents with max_tokens = 128, embeds in batches of 64, and runs vector similarity search when the LLM invokes retrieve_from_knowledge_base (limit = 3 default at runtime).Large manuals, multi-product catalogs, extensive FAQ repositories.
full_documentNo (works without an embedding API key)Extracts the complete Markdown/text once and stores full_text. When the LLM invokes retrieve_from_knowledge_base, returns the entire document text (similarity = 1.0) alongside any chunked matches.Short, critical reference sheets (1–2 page pricing tables, exact compliance scripts, quick offer terms) where partial chunk misses cannot be tolerated.

Missing embeddings key fails `chunked` uploads

If an organization has no embedding provider key configured, processing a chunked document fails (processing_status = "failed"). Either configure OpenAI text-embedding-3-small in Org Model Configurations or upload short reference docs in full_document mode.

Formatting tips for better voice answers

Write FAQ documents with explicit question headings followed by short 2–3 sentence answers tailored to spoken English/Hindi. Avoid wide multi-column tables in PDFs—turn tabular specs into Key: Value bullet lines so 128-token chunks never lose column headers.


Attaching Knowledge Bases Per Node

Avoid attaching every document globally if only one stage of the call needs it:

  • Good: Attach refund_policy.pdf only to your Returns & Billing Agent node, and product_catalog.md only to your Sales Qualification Agent node.
  • Why: Scoping documents per node prevents irrelevant chunks from confusing the agent during greetings or scheduling.

Prompting Tips for retrieve_from_knowledge_base

When Knowledge Base documents are attached to a Start Call or Agent node, Talkar automatically exposes the retrieve_from_knowledge_base tool to the LLM:

When the caller asks about warranties, spare parts, or service centers, call retrieve_from_knowledge_base with a concise query.
Summarize the answer in 1–2 short conversational sentences. Never read bullet markers or markdown formatting aloud.

Testing Semantic Search via API

You can query your indexed chunks directly via REST (POST /api/v1/knowledge-base/search, defaults to limit = 5, max 50) to verify chunk quality, min_similarity thresholds, and document filtering before testing on a voice call.

POST
/api/v1/knowledge-base/search

Authorization

headerAuthorizationBearer <token>

Authenticated builder/user JWT or API key for dashboard-scoped management endpoints.

Request Body

application/json
  1. body
query*string
limit?integer
Range1 <= value <= 50
Default5
document_uuids?array<string>
min_similarity?number
Range0 <= value <= 1

Response Body

Matched chunks with similarity scores

Example Request
curl -X POST 'https://api.talkar.in/api/v1/knowledge-base/search' \  -H 'Content-Type: application/json' \  -d '{  "query": "string"}'
Example Response200
Empty

On this page