API Reference
Archon provides a comprehensive REST API built with FastAPI for knowledge management, document processing, and project automation. This reference covers all endpoints with detailed examples, request/response schemas, and integration patterns.
๐ Base URL & Authenticationโ
Base URL: http://localhost:8080
Interactive Documentation:
- Swagger UI:
http://localhost:8080/docs - ReDoc:
http://localhost:8080/redoc
Authentication: Currently API key-based through settings. Future versions will support JWT tokens.
๐๏ธ Modular API Architectureโ
Archon uses a modular FastAPI architecture with separate routers for different functionalities:
knowledge_api.py: Knowledge items, web crawling, and document managementmcp_api.py: MCP server control and Socket.IO communicationssettings_api.py: Application settings and credential managementprojects_api.py: Project and task management (refactored with service layer)agent_chat_api.py: AI agent chat interfacetests_api.py: Testing endpoints with real-time streaming
All routers are mounted with the /api prefix and provide comprehensive OpenAPI documentation.
Endpoint Indexโ
- Knowledge Management
- Document Management
- RAG API
- MCP Server
- Project Management
- Task Management
- Settings
- Credentials
- Agent Chat
- Testing
- System Info
๐ Knowledge Management APIโ
List Knowledge Itemsโ
GET /api/knowledge-items
Retrieve all knowledge items with optional filtering and pagination.
Query Parametersโ
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | โ | Page number (default: 1) |
per_page | integer | โ | Items per page (default: 20, max: 100) |
knowledge_type | string | โ | Filter by knowledge type (technical, business, general) |
tags | string[] | โ | Filter by tags |
status | string | โ | Filter by status (active, archived) |
source_type | string | โ | Filter by source type (url, file) |
Example Requestโ
curl -X GET "http://localhost:8080/api/knowledge-items?page=1&per_page=10&knowledge_type=technical" \
-H "Accept: application/json"
Example Responseโ
{
"items": [
{
"id": 123,
"url": "https://docs.python.org/3/tutorial/",
"title": "Python Tutorial",
"content": "Python is an easy to learn, powerful programming language...",
"knowledge_type": "technical",
"tags": ["python", "tutorial", "programming"],
"metadata": {
"source_id": "docs.python.org",
"char_count": 5234,
"word_count": 1250,
"headers": ["Introduction", "Getting Started"]
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 156,
"total_pages": 8,
"has_next": true,
"has_prev": false
}
}
Update Knowledge Itemโ
PUT /api/knowledge-items/{source_id}
Update metadata for a knowledge item.
Path Parametersโ
| Parameter | Type | Required | Description |
|---|---|---|---|
source_id | string |