ekkOS_docs
API Reference

REST API

Complete documentation for the ekkOS Memory REST API. Use these endpoints to integrate memory into any application.

Base URL

https://mcp.ekkos.dev

Authentication

All API requests require a Bearer token in the Authorization header. Get your API key from platform.ekkos.dev.

curl -X POST https://mcp.ekkos.dev/api/v1/memory/search \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"query": "authentication patterns"}'

Rate Limits

PlanRequests/DayBurst Limit
Free10010/min
Pro10,000100/min
TeamUnlimited1000/min

Rate limit headers are included in all responses: X-RateLimit-Remaining, X-RateLimit-Reset

Endpoints

POST/api/v1/memory/search

Search memory with semantic query

Parameters

querystringrequiredSemantic search query
limitnumberMax results (default: 10)
sourcesstring[]Memory layers to search: patterns, graph, signals, all

Response

{
  "retrieval_id": "ret_abc123",
  "results": [
    {
      "id": "mem_xyz",
      "content": "Always use Supabase for authentication",
      "source": "patterns",
      "similarity": 0.92,
      "metadata": { "success_rate": 0.85 }
    }
  ],
  "timing_ms": 18
}
POST/api/v1/patterns

Create or update a pattern

Parameters

titlestringrequiredPattern title
problemstringrequiredProblem description
solutionstringrequiredSolution description
tagsstring[]Categorization tags
works_whenstring[]Conditions when pattern applies
anti_patternsstring[]What NOT to do

Response

{
  "id": "pat_abc123",
  "title": "Use Supabase Auth",
  "created_at": "2024-01-15T10:30:00Z",
  "confidence": 0.5
}
GET/api/v1/patterns

List all patterns

Parameters

limitnumberMax results (default: 50)
offsetnumberPagination offset
tagsstring[]Filter by tags

Response

{
  "patterns": [
    {
      "id": "pat_abc123",
      "title": "Use Supabase Auth",
      "problem": "Need authentication for Next.js app",
      "solution": "Use @supabase/auth-helpers-nextjs",
      "confidence": 0.85,
      "applications": 12,
      "success_rate": 0.92
    }
  ],
  "total": 62,
  "has_more": true
}
POST/api/v1/directives

Get current MUST/NEVER/PREFER/AVOID directives

Parameters

userIdstringUser ID (default: system)
windowHoursnumberHours of signals to include (default: 72)

Response

{
  "directives": [
    {
      "type": "MUST",
      "rule": "Use TypeScript for all new files",
      "priority": 800,
      "source": "user_preference"
    },
    {
      "type": "NEVER",
      "rule": "Use any as a type",
      "priority": 700,
      "source": "pattern"
    }
  ]
}
POST/api/v1/forge

Forge a new insight/pattern from learnings

Parameters

titlestringrequiredClear descriptive title
problemstringrequiredWhat problem does this solve?
solutionstringrequiredThe solution that works
works_whenstring[]When this pattern applies
anti_patternsstring[]Common mistakes to avoid
tagsstring[]Categorization tags

Response

{
  "id": "pat_new123",
  "title": "RLS requires service role for admin ops",
  "confidence": 0.5,
  "message": "Pattern forged successfully"
}
POST/api/v1/working

Write message to working memory

Parameters

rolestringrequired"user" or "assistant"
contentstringrequiredMessage content
session_idstringrequiredSession identifier
sourcestringSource platform (cursor, claude-code, etc)

Response

{
  "id": "msg_abc123",
  "created_at": "2024-01-15T10:30:00Z",
  "message": "Message written to working memory"
}
POST/api/v1/reflex

Validate AI suggestion against patterns (Hallucination Firewall)

Parameters

requeststringrequiredOriginal user request
proposed_answerstringrequiredAI's proposed response
user_idstringUser ID for personalized checking

Response

{
  "status": "GROUNDED",
  "confidence": 0.89,
  "supporting_patterns": [
    { "id": "pat_123", "title": "Use Supabase Auth", "relevance": 0.92 }
  ],
  "conflicts": [],
  "explanation": "This suggestion aligns with 3 established patterns"
}

Error Codes

CodeMeaning
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API key
429Too Many Requests — Rate limit exceeded
500Internal Error — Something went wrong on our end

SDKs & Libraries

MCP Server (Node.js)

npm install @ekkos/mcp-server

TypeScript SDK

npm install @ekkos/sdk

Related