Agent Knowledge Base

The Agent Knowledge Base API enables RAG (Retrieval Augmented Generation) support for conversational AI agents. Teams can upload documents, URLs, or plain text as “knowledge items” which are processed (extracted, chunked, embedded, and indexed) and then attached to agents for context-aware responses.

What is Agent Knowledge Base?

Agent Knowledge Base allows agents to:

  • Access Information: Retrieve relevant context from uploaded documents, URLs, or text
  • Answer Questions: Provide accurate responses based on indexed knowledge
  • Stay Up-to-Date: Re-ingest content when sources change
  • Scale Responses: Handle domain-specific queries with confidence

Core Concepts

Knowledge Item

A unit of knowledge (document, URL, or text) that belongs to a team. Knowledge items can be:

  • Documents: PDF files up to 25MB
  • URLs: Web pages with HTTP/HTTPS protocols
  • Text: Plain text up to 10,000 characters

Agent Knowledge Item

A join relationship that attaches a knowledge item to an agent. Knowledge items can be shared across multiple agents.

RAG Configuration

Per-agent settings for how knowledge retrieval works:

  • search_mode: Choose between "speed" (faster, less thorough) or "accuracy" (more thorough)
  • max_chunks_per_query: Number of relevant chunks to retrieve per query (must be > 0, default: 8)

Knowledge Item Lifecycle

Created (pending) → Processing → Ready (can attach to agents)
→ Failed (error_message explains why)

Status Definitions

StatusDescription
pendingCreated, waiting for ingestion to start
processingCurrently being extracted, chunked, embedded, and indexed
readySuccessfully processed, can be attached to agents
failedProcessing failed, check error_message for details

Key Features

Flexible Content Sources

Upload knowledge from multiple sources:

  • PDF documents with automatic text extraction
  • Web pages for dynamic content
  • Direct text input for quick knowledge additions

Automatic Processing

The platform handles all processing automatically:

  1. Extraction: Extract text from PDFs or fetch from URLs
  2. Chunking: Split content into optimal-sized chunks
  3. Embedding: Generate vector embeddings for semantic search
  4. Indexing: Store in search index for fast retrieval

Re-Ingestion

Update knowledge when source content changes:

  • Re-run the entire ingestion pipeline
  • Rate limited to 1 request per minute per item
  • Cannot re-ingest items currently processing

RAG Search Modes

Choose the right balance for your use case:

  • Speed Mode: Faster retrieval with less thoroughness
  • Accuracy Mode: More thorough retrieval for critical applications

API Resources

The Knowledge Base API is organized into two scopes:

Team-Scoped Knowledge Items

Manage knowledge items at the team level:

Agent-Scoped Knowledge Items

Attach and detach knowledge items to specific agents:

Constraints & Limits

ConstraintValue
Maximum knowledge items per team3
Title maximum length50 characters
Description maximum length200 characters
Document maximum file size25 MB
Raw text maximum length10,000 characters
Supported document formatsPDF only
Re-ingest rate limit1 request per minute per item

Common Workflows

Workflow 1: Add Knowledge to an Agent

  1. Create knowledge item: POST /api/v2/knowledge_items
  2. Poll for status: GET /api/v2/knowledge_items/:uuid until status: "ready"
  3. Attach to agent: POST /api/v2/agents/:agent_uuid/knowledge_items

Workflow 2: Update Knowledge Content

  1. Update source (e.g., update the webpage content)
  2. Trigger reingest: POST /api/v2/knowledge_items/:uuid/reingest
  3. Poll for status: GET /api/v2/knowledge_items/:uuid until status: "ready"

Workflow 3: Remove Knowledge from Agent

  1. Detach from agent: DELETE /api/v2/agents/:agent_uuid/knowledge_items/:knowledge_item_uuid
  2. (Optional) Delete knowledge item: DELETE /api/v2/knowledge_items/:uuid

Getting Started

To use the Knowledge Base API, you’ll need:

  1. An API token for authentication
  2. At least one agent (get via Agents API)
  3. Knowledge content (document, URL, or text)

Base URL

https://app.resemble.ai/api/v2

Authentication

All requests require Bearer token authentication using your API key:

$Authorization: Bearer YOUR_API_TOKEN

Get your API key from https://app.resemble.ai/account/api