Knowledge Bases

Knowledge Bases

Knowledge bases are collections of content sources that power AI agents with contextual information. They index content, generate vector embeddings, and provide intelligent retrieval capabilities.

What are Knowledge Bases?

A knowledge base is an organized collection of content sources that provides:

  • Vector Embeddings — AI-powered content representations for similarity matching
  • Agent Context — Provide agents with relevant information automatically
  • Content Triggers — Automatically run agents when content changes
  • Multi-Source Indexing — Combine multiple sources into one searchable collection

Knowledge bases act as the "memory" for your AI agents, allowing them to access and reason about your content intelligently.

Creating a Knowledge Base

  1. Navigate to the Knowledge Bases page
  2. Click Create Knowledge Base
  3. Give it a name and optional description
  4. Select one or more content sources to include
  5. Configure retrieval settings (or keep the defaults)

You can add or remove sources at any time after creation.

Retrieval Settings

Each knowledge base has configurable retrieval settings that control how content is returned to agents:

SettingDescriptionDefault
Reranker ModelModel used to rerank search results for relevance
Top NMaximum number of results returned from the initial vector search20
Top KNumber of results kept after reranking5
Score ThresholdMinimum relevance score (0–1) a result must meet to be included0.0

API Access

Knowledge bases can be managed programmatically via the Public API using your API key:

# List knowledge bases
curl "https://api.seclai.com/knowledge_bases?page=1&limit=20" \
  -H "X-API-Key: $SECLAI_API_KEY"

# Create a knowledge base
curl -X POST https://api.seclai.com/knowledge_bases \
  -H "X-API-Key: $SECLAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech News KB",
    "description": "Aggregated tech news sources",
    "source_ids": ["source-id-1", "source-id-2"]
  }'

# Get a knowledge base
curl "https://api.seclai.com/knowledge_bases/$KNOWLEDGE_BASE_ID" \
  -H "X-API-Key: $SECLAI_API_KEY"

# Update a knowledge base
curl -X PUT "https://api.seclai.com/knowledge_bases/$KNOWLEDGE_BASE_ID" \
  -H "X-API-Key: $SECLAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Renamed KB", "top_k": 10}'

# Delete a knowledge base
curl -X DELETE "https://api.seclai.com/knowledge_bases/$KNOWLEDGE_BASE_ID" \
  -H "X-API-Key: $SECLAI_API_KEY"

See API Examples for more examples in multiple languages.

MCP Tools

Knowledge base operations are available as MCP tools for AI coding assistants:

ToolDescription
list_knowledge_basesList knowledge bases with pagination and sorting
get_knowledge_baseGet full details of a knowledge base
create_knowledge_baseCreate a new knowledge base
update_knowledge_baseUpdate a knowledge base's configuration
delete_knowledge_baseDelete a knowledge base

See MCP Server → Knowledge Base Tools for setup instructions.

Exporting

Export a knowledge base's full content — sources, metadata, and indexed items — as a downloadable JSON file.

  • UI: Open the knowledge base detail page and click the Export button. You'll see an estimate of the export size before confirming.
  • API: POST /authenticated/resource-exports with resource_type: "knowledge_base" and the knowledge base ID.
  • MCP: Use the create_resource_export tool with resource_type: "knowledge_base".

See Export Formats → Knowledge Base for the full file schema and available filter options.

Next Steps