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
- Navigate to the Knowledge Bases page
- Click Create Knowledge Base
- Give it a name and optional description
- Select one or more content sources to include
- 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:
| Setting | Description | Default |
|---|---|---|
| Reranker Model | Model used to rerank search results for relevance | — |
| Top N | Maximum number of results returned from the initial vector search | 20 |
| Top K | Number of results kept after reranking | 5 |
| Score Threshold | Minimum relevance score (0–1) a result must meet to be included | 0.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:
| Tool | Description |
|---|---|
list_knowledge_bases | List knowledge bases with pagination and sorting |
get_knowledge_base | Get full details of a knowledge base |
create_knowledge_base | Create a new knowledge base |
update_knowledge_base | Update a knowledge base's configuration |
delete_knowledge_base | Delete 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-exportswithresource_type: "knowledge_base"and the knowledge base ID. - MCP: Use the
create_resource_exporttool withresource_type: "knowledge_base".
See Export Formats → Knowledge Base for the full file schema and available filter options.
Next Steps
- Content Sources — Learn about content sources
- Agents — Build agents that use knowledge bases
- API Examples — Code samples for the API
- API Reference — Complete API documentation
- MCP Server — Use knowledge base tools from AI coding assistants