API Endpoints¶
Base URL: http://localhost:12319/api/
All endpoints return JSON. POST endpoints accept application/json bodies. All endpoints handle CORS preflight (OPTIONS) automatically.
Core¶
Index¶
Returns {"message": "Hello, AgentX AI!"}.
Health Check¶
Returns API, translation, and (optionally) memory system health.
Response:
{
"status": "healthy",
"api": {"status": "healthy"},
"translation": {
"status": "healthy",
"models": {
"language_detection": "eleldar/language-detection",
"translation": "facebook/nllb-200-distilled-600M"
}
},
"memory": {
"neo4j": {"status": "healthy"},
"postgres": {"status": "healthy"},
"redis": {"status": "healthy"}
}
}
Translation status is "not_loaded" if models haven't been initialized yet. Memory section only appears when include_memory=true.
Translation¶
Language Detection¶
Request (POST):
Response:
GET accepts ?text=... query parameter.
Translation¶
Request:
Uses NLLB-200 language codes (e.g., eng_Latn, fra_Latn, deu_Latn, spa_Latn).
Response:
MCP (Model Context Protocol)¶
List Servers¶
Returns configured MCP servers and connection status.
Response:
{
"servers": [
{
"name": "filesystem",
"transport": "stdio",
"status": "connected",
"tools": ["read_file", "write_file", "list_directory"],
"tools_count": 3,
"resources_count": 0
}
]
}
List Tools¶
Returns available tools from connected servers. Filter by server name with ?server=.
List Resources¶
Returns available resources from connected servers. Filter by server name with ?server=.
Connect¶
Connect to one or all configured MCP servers.
Request (single):
Response:
Request (all):
Response:
{
"results": {
"filesystem": {"status": "connected", "tools_count": 3},
"github": {"status": "error", "error": "..."}
}
}
Disconnect¶
Request (single): {"server": "filesystem"}
Request (all): {"all": true}
Providers¶
List Providers¶
Returns configured model providers and their status.
Response:
{
"providers": [
{
"name": "lmstudio",
"status": "configured",
"models": ["llama3.2", "deepseek-r1"]
},
{
"name": "anthropic",
"status": "not_configured",
"error": "API key not set"
}
]
}
List Models¶
Returns all available models with capabilities. Filter by provider with ?provider=.
Response:
{
"models": [
{
"name": "claude-3-5-sonnet-latest",
"provider": "anthropic",
"context_window": 200000,
"supports_tools": true,
"supports_vision": true,
"supports_streaming": true,
"cost_per_1k_input": 0.003,
"cost_per_1k_output": 0.015
}
],
"count": 5
}
Provider Health¶
Async health check of all configured providers.
Response:
{
"status": "healthy",
"providers": {
"lmstudio": {"status": "healthy"},
"anthropic": {"status": "healthy"},
"openai": {"status": "unhealthy", "error": "..."}
}
}
status is "healthy" if all pass, "degraded" if any fail.
Agent¶
Run Task¶
Execute a task using the full agent pipeline (planning + reasoning).
Request:
{
"task": "Analyze the sentiment of this text: I love this product!",
"reasoning_strategy": "chain_of_thought"
}
| Field | Type | Required | Description |
|---|---|---|---|
task |
string | yes | Task description |
reasoning_strategy |
string | no | "auto", "cot", "tot", "react", "reflection" |
Response:
{
"task_id": "a1b2c3d4",
"status": "complete",
"answer": "The sentiment is positive...",
"plan_steps": 2,
"reasoning_steps": 3,
"tools_used": [],
"models_used": ["llama3.2"],
"total_tokens": 450,
"total_time_ms": 1234.5
}
Chat¶
Conversational interaction with session management.
Request:
{
"message": "What can you help me with?",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "claude-3-5-sonnet-latest",
"profile_id": "default",
"temperature": 0.7,
"use_memory": true
}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
message |
string | yes | — | User message |
session_id |
string | no | auto-generated | Session ID for continuity |
model |
string | no | from config | Model to use |
profile_id |
string | no | "default" |
Prompt profile ID |
temperature |
float | no | 0.7 |
Sampling temperature |
use_memory |
bool | no | true |
Enable memory recall/storage |
Response:
{
"task_id": "a1b2c3d4",
"status": "complete",
"response": "I can help you with...",
"answer": "I can help you with...",
"thinking": "Let me consider what this user needs...",
"has_thinking": true,
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"reasoning_trace": 0,
"reasoning_steps": 0,
"tokens_used": 150,
"total_tokens": 150,
"total_time_ms": 892.3
}
Chat (Streaming)¶
Same request body as /agent/chat. Returns Server-Sent Events (SSE).
Response: Content-Type: text/event-stream
SSE events in order:
| Event | Data | When |
|---|---|---|
start |
{"task_id": "...", "model": "..."} |
Stream begins |
chunk |
{"content": "token text"} |
Each token |
tool_call |
{"tool": "name", "arguments": {...}} |
Tool invocation starts |
tool_result |
{"tool": "name", "content": "..."} |
Tool result (truncated to 500 chars) |
done |
{"task_id": "...", "thinking": "...", "has_thinking": bool, "total_time_ms": float, "session_id": "..."} |
Stream complete |
error |
{"error": "message"} |
On failure |
The streaming endpoint supports the same tool-use loop as the non-streaming endpoint (up to 10 rounds). Memory storage happens in a background thread after the stream closes.
Example with curl:
curl -N -X POST http://localhost:12319/api/agent/chat/stream \
-H "Content-Type: application/json" \
-d '{"message": "Hello!", "model": "llama3.2"}'
Agent Status¶
Returns current agent status (idle, planning, reasoning, executing, complete, failed, cancelled).
Prompts¶
List Profiles¶
Response:
{
"profiles": [
{
"id": "default",
"name": "Default Assistant",
"description": "General-purpose AI assistant",
"is_default": true,
"sections_count": 3,
"enabled_sections": 2
}
]
}
Profile Detail¶
Returns the full profile with all sections and the composed prompt preview.
Response:
{
"profile": {
"id": "default",
"name": "Default Assistant",
"description": "General-purpose AI assistant",
"is_default": true,
"sections": [
{
"id": "identity",
"name": "Identity",
"type": "system",
"content": "You are a helpful AI assistant.",
"enabled": true,
"order": 0
}
]
},
"composed_prompt": "You are a helpful AI assistant.\n\n..."
}
Get Global Prompt¶
Response:
Update Global Prompt¶
Request:
List Sections¶
Returns all available prompt sections with their content and ordering.
Compose Preview¶
Returns the fully composed system prompt that would be sent to the model.
Response:
{
"system_prompt": "You are a helpful AI assistant.\n\nAlways be helpful and concise.\n\n...",
"profile_id": "default"
}
MCP Tools Prompt¶
Returns the auto-generated prompt describing available MCP tools for injection into the system prompt.
Response:
{
"mcp_tools_prompt": "You have access to the following tools:\n\n- read_file: Read a file...",
"tools_count": 5
}
Memory¶
Channels¶
GET — List all channels with item counts per type.
Response:
{
"channels": [
{
"name": "_global",
"is_default": true,
"item_counts": {
"turns": 42,
"entities": 15,
"facts": 28,
"strategies": 3,
"goals": 2
}
}
]
}
POST — Create a new channel. Name must be alphanumeric with hyphens/underscores.
Request: {"name": "my-project"}
Delete Channel¶
Deletes a channel and all associated data across Neo4j, PostgreSQL, and Redis. Cannot delete _global.
Response:
{
"message": "Channel 'my-project' deleted successfully",
"deleted": {
"turns": 10, "entities": 5, "facts": 8,
"strategies": 1, "goals": 0, "conversations": 2,
"postgres_rows": 15, "redis_keys": 3
}
}
Delete Conversation¶
Deletes a single conversation and its turns from all databases.
List Entities¶
| Param | Type | Default | Description |
|---|---|---|---|
channel |
string | _all |
Filter by channel |
page |
int | 1 | Page number |
limit |
int | 20 | Items per page (max 100) |
search |
string | — | Text search on entity name |
type |
string | — | Filter by entity type |
Response:
Entity Graph¶
Returns the entity with connected facts and relationships.
| Param | Type | Default | Description |
|---|---|---|---|
depth |
int | 2 | Traversal depth (max 3) |
Returns 404 if entity not found.
List Facts¶
| Param | Type | Default | Description |
|---|---|---|---|
channel |
string | _all |
Filter by channel |
page |
int | 1 | Page number |
limit |
int | 20 | Items per page (max 100) |
min_confidence |
float | 0.0 | Minimum confidence (0.0–1.0) |
search |
string | — | Text search on fact claim |
List Strategies¶
| Param | Type | Default | Description |
|---|---|---|---|
channel |
string | _all |
Filter by channel |
page |
int | 1 | Page number |
limit |
int | 20 | Items per page (max 100) |
Memory Stats¶
Returns total counts and per-channel breakdowns.
Response:
{
"totals": {"entities": 45, "facts": 120, "strategies": 8, "turns": 300},
"by_channel": {
"_global": {"entities": 30, "facts": 80, "strategies": 5, "turns": 200},
"my-project": {"entities": 15, "facts": 40, "strategies": 3, "turns": 100}
}
}
Consolidation Settings¶
GET — Returns consolidation settings (extraction, relevance filter, entity linking, quality thresholds) plus default prompts.
POST — Update consolidation settings. Accepts partial updates.
Recall Settings¶
GET — Returns recall layer settings (hybrid search, entity-centric, query expansion, HyDE, self-query technique toggles and parameters).
POST — Update recall settings. Accepts partial updates.
Run Consolidation¶
Manually triggers the consolidation pipeline.
Request (optional):
If no jobs specified, runs the default set: consolidate, patterns, promote.
Reset Consolidation¶
Clears consolidated timestamps from all conversations, allowing reprocessing.
Request (optional):
When delete_memories is true, also deletes all entities, facts, and strategies. Useful when extraction logic has changed.
Jobs¶
List Jobs¶
Returns all registered consolidation jobs with their status and worker info.
Response:
{
"jobs": [
{
"name": "consolidate",
"status": "idle",
"enabled": true,
"last_run": "2026-03-10T14:30:00Z",
"last_duration_ms": 1500,
"run_count": 42
}
],
"worker": {
"status": "running",
"uptime_seconds": 3600
}
}
Job Detail¶
Returns job details with recent execution history (last 10 runs).
Response:
{
"job": {...},
"history": [
{"timestamp": "...", "duration_ms": 1200, "success": true, "metrics": {...}}
]
}
Run Job¶
Manually triggers a specific job. Returns execution result with metrics.
Toggle Job¶
Enable or disable a scheduled job.
Request: {"enabled": false}
Clear Stuck Jobs¶
Clears jobs stuck in running state (e.g., after a crash).
Response:
Config¶
Update Config¶
Updates runtime configuration. Persists to data/config.json and hot-reloads providers.
Request:
{
"providers": {
"anthropic": {"api_key": "sk-ant-..."},
"lmstudio": {"base_url": "http://localhost:1234/v1", "timeout": 300}
},
"preferences": {
"default_model": "claude-3-5-sonnet-latest",
"enable_memory_by_default": true
},
"llm_settings": {
"default_temperature": 0.7,
"default_max_tokens": 4096
}
}
All fields are optional — only provided fields are updated.
Response:
{
"status": "ok",
"message": "Config updated and applied",
"updated": ["providers.anthropic.api_key", "preferences.default_model"]
}
No GET endpoint exists for security — config contains API keys.
Authentication¶
Currently no authentication required (single-user development mode).