The HTTP API is served on port 9091. It provides a REST interface for inspection and debugging.
Returns server health status.
{
"healthy": true,
"version": "0.3.0",
"uptime_seconds": 3600,
"stats": {
"node_count": 1234,
"edge_count": 5678
}
}Returns node and edge counts.
List nodes with optional filtering.
Query params: kind, agent, limit (default 50), offset.
Get a node by ID.
Get neighboring nodes.
Query params: depth (default 1), direction (both|outgoing|incoming).
Search nodes semantically.
Query params: q (query string, required), limit, kind.
Get a briefing for an agent.
Query params: scope (agent|shared, default: agent), max_tokens.
Get a unified (multi-agent) briefing.
Query params: agents (comma-separated agent IDs, required), max_tokens.
Export the full graph as JSON.
{
"success": true,
"data": {
"nodes": [...],
"edges": [...]
}
}Open the interactive graph visualiser in your browser.
Trigger an immediate auto-linker cycle.
Get the trust score breakdown for a single node.
{
"success": true,
"data": {
"node_id": "019...",
"trust_score": 0.82,
"signals": {
"corroboration": 0.90,
"contradiction": 0.95,
"source_reliability": 0.75,
"access_reinforcement": 0.60,
"freshness": 0.88
},
"weights": {
"corroboration": 0.30,
"contradiction": 0.25,
"source": 0.20,
"access": 0.15,
"freshness": 0.10
}
}
}Batch trust scores for multiple nodes.
curl -X POST http://localhost:9091/trust/batch \
-H "Content-Type: application/json" \
-d '{"node_ids": ["019...", "019..."]}'Agent reliability scores (source track record).
{
"success": true,
"data": {
"agents": [
{ "agent_id": "kai", "reliability": 0.85, "corroborated": 42, "contradicted": 3 },
{ "agent_id": "scout", "reliability": 0.72, "corroborated": 28, "contradicted": 7 }
]
}
}Get auto-linker metrics.
Server-Sent Events (SSE) endpoint for real-time graph change notifications.
| Param | Type | Default | Description |
|---|---|---|---|
events |
string | all | Comma-separated event types to subscribe to |
node.created— A new node was storednode.updated— An existing node was modifiednode.deleted— A node was deletededge.created— A new edge was creatededge.updated— An existing edge was modifiededge.deleted— An edge was deleted
Each SSE event has the event type as the SSE event: field and a JSON payload as data::
{
"event_type": "node.created",
"timestamp": "2026-03-14T12:00:00+00:00",
"data": {
"id": "019...",
"kind": "decision",
"title": "Use redb for storage",
"agent": "kai",
"importance": 0.8
}
}Subscribe to all events:
curl -N http://localhost:9091/events/streamSubscribe only to node creation events:
curl -N "http://localhost:9091/events/stream?events=node.created"Subscribe to multiple event types:
curl -N "http://localhost:9091/events/stream?events=node.created,node.updated,edge.created"The server sends keep-alive messages every 30 seconds. If a subscriber falls behind, it receives a warning event with the number of dropped events.
List the HEAD version of every prompt (grouped by slug and branch).
curl http://localhost:9091/promptsCreate the first version of a new prompt.
curl -X POST http://localhost:9091/prompts \
-H "Content-Type: application/json" \
-d '{
"slug": "helpful-assistant",
"type": "system",
"branch": "main",
"sections": {
"identity": "You are a helpful assistant.",
"constraints": "Be concise and accurate."
},
"metadata": {},
"author": "admin"
}'Response:
{
"success": true,
"data": {
"node_id": "019...",
"slug": "helpful-assistant",
"version": 1,
"branch": "main"
}
}Resolve the HEAD version of a prompt with inheritance applied.
Query params: branch (default main).
curl "http://localhost:9091/prompts/helpful-assistant/latest?branch=main"Returns the fully resolved prompt with parent sections merged.
List all versions of a prompt on a branch.
Query params: branch (default main).
curl "http://localhost:9091/prompts/helpful-assistant/versions?branch=main"Get a specific version (raw, without inheritance resolution).
Query params: branch (default main).
curl "http://localhost:9091/prompts/helpful-assistant/versions/2?branch=main"Create a new version of an existing prompt.
curl -X POST http://localhost:9091/prompts/helpful-assistant/versions \
-H "Content-Type: application/json" \
-d '{
"branch": "main",
"sections": {
"identity": "You are a helpful and concise assistant.",
"constraints": "Be accurate. Cite sources when possible."
},
"author": "admin"
}'Response:
{
"success": true,
"data": {
"node_id": "019...",
"slug": "helpful-assistant",
"version": 2,
"branch": "main"
}
}Fork a prompt onto a new branch.
curl -X POST http://localhost:9091/prompts/helpful-assistant/branch \
-H "Content-Type: application/json" \
-d '{
"new_branch": "experiment-v2",
"from_branch": "main",
"author": "admin"
}'Aggregate performance metrics for a prompt variant.
Query params: limit (default 50).
curl "http://localhost:9091/prompts/helpful-assistant/performance?limit=20"Response:
{
"success": true,
"data": {
"slug": "helpful-assistant",
"prompt_id": "019...",
"observation_count": 42,
"avg_score": 0.78,
"avg_sentiment": 0.82,
"avg_correction_count": 0.5,
"task_outcomes": {
"success": 30,
"partial": 8,
"failure": 4
},
"observations_shown": 20,
"observations": [...]
}
}Score all prompt variants bound to an agent and select the best one using epsilon-greedy selection.
Query params:
| Param | Default | Description |
|---|---|---|
sentiment |
0.5 |
User sentiment (0.0–1.0) |
task_type |
casual |
Task type: coding, planning, casual, crisis, reflection |
correction_rate |
0.0 |
Correction rate (0.0–1.0) |
topic_shift |
0.0 |
Topic drift (0.0–1.0) |
energy |
0.5 |
User energy (0.0–1.0) |
epsilon |
0.2 |
Exploration rate (0.0–1.0) |
curl "http://localhost:9091/agents/my-agent/active-variant?sentiment=0.3&task_type=coding&epsilon=0.1"Response:
{
"success": true,
"data": {
"agent": "my-agent",
"selected": {
"id": "019...",
"slug": "coding-assistant",
"edge_weight": 0.85,
"context_score": 0.92,
"total_score": 0.885
},
"swap_recommended": true,
"epsilon": 0.1,
"signals": {
"sentiment": 0.3,
"task_type": "coding",
"correction_rate": 0.0,
"topic_shift": 0.0,
"energy": 0.5
},
"all_variants": [...]
}
}Timeline of variant swaps and performance observations.
Query params: limit (default 20).
curl "http://localhost:9091/agents/my-agent/variant-history?limit=10"Record a performance observation. Updates the agent→prompt edge weight using EMA (α=0.1).
curl -X POST http://localhost:9091/agents/my-agent/observe \
-H "Content-Type: application/json" \
-d '{
"variant_id": "019...",
"variant_slug": "helpful-assistant",
"sentiment_score": 0.8,
"correction_count": 1,
"task_outcome": "success",
"token_cost": 1500
}'Response:
{
"success": true,
"data": {
"observation_id": "019...",
"variant_id": "019...",
"variant_slug": "helpful-assistant",
"observation_score": 0.87,
"old_edge_weight": 0.80,
"new_edge_weight": 0.807
}
}List all prompts bound to an agent, ordered by weight.
Bind (or update) a prompt to an agent.
curl -X PUT http://localhost:9091/agents/my-agent/prompts/helpful-assistant \
-H "Content-Type: application/json" \
-d '{ "weight": 0.9 }'Unbind a prompt from an agent.
curl -X DELETE http://localhost:9091/agents/my-agent/prompts/helpful-assistantGet the merged effective prompt for an agent (all bound prompts combined by weight order).