HTTP API¶
The HTTP API is the unified backend that powers the CLI, MCP server, and SDKs. It provides RESTful endpoints for all memory operations, search, connectors, governance, and system management.
Base URL¶
The default port is 8787. Override with COGNIBRAIN_PORT or --port on cognibrain start.
Authentication¶
Note
Local solo-dev profile doesn't require authentication. Production deployments should always configure auth.
OpenAPI Specification¶
The full OpenAPI spec is available at runtime:
Use this for generating clients, testing with Swagger UI, or integration validation.
Core Endpoints¶
Memories¶
List Memories¶
Query parameters:
| Param | Type | Description |
|---|---|---|
scope | string | Filter by scope (repo, user, global, task) |
status | string | Filter by status (active, stale, review) |
limit | number | Max results (default: 50) |
offset | number | Pagination offset |
Response:
{
"memories": [
{
"id": "mem_abc123",
"content": "Always run npm test before release",
"scope": "repo",
"status": "active",
"createdAt": "2026-06-01T10:00:00Z",
"lastRecalledAt": "2026-06-10T14:30:00Z"
}
],
"total": 42,
"limit": 50,
"offset": 0
}
Create Memory¶
Request body:
Response:
{
"id": "mem_abc123",
"content": "This repo uses npm test before release",
"scope": "repo",
"status": "active",
"createdAt": "2026-06-11T12:00:00Z"
}
Get Memory¶
Update Memory¶
Archive Memory¶
Context & Retrieval¶
Get Context Pack¶
Request body:
Response:
Get Coding Context¶
Request body:
Action Guards¶
Check Guard¶
Request body:
Response:
Evidence¶
Record Outcome¶
Request body:
Record Patch Evidence¶
Request body:
Response:
{
"evidenceId": "ev_xyz789",
"task": "release patch",
"files": ["package.json"],
"commands": ["npm test"],
"memoriesUsed": ["mem_abc123"]
}
Get Evidence Pack¶
Connectors¶
List Connectors¶
Add Connector¶
Connector Health¶
System¶
Health Check¶
Response:
Dream Cycle¶
Conflicts¶
Error Responses¶
All errors follow a consistent format:
{
"error": {
"code": "MEMORY_NOT_FOUND",
"message": "Memory with ID mem_xyz does not exist",
"status": 404
}
}
Common error codes:
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid credentials |
FORBIDDEN | 403 | Insufficient permissions |
MEMORY_NOT_FOUND | 404 | Memory ID doesn't exist |
VALIDATION_ERROR | 422 | Invalid request body |
RATE_LIMITED | 429 | Too many requests |
INTERNAL_ERROR | 500 | Server error |
Rate Limiting¶
Default rate limits for the local daemon:
| Endpoint | Limit |
|---|---|
| Read operations | 1000/min |
| Write operations | 100/min |
| Context/search | 200/min |
Production deployments can configure custom limits via environment variables.