CogmemAi REST API Reference

CogmemAi / REST API

The same memory engine that powers the MCP server is available over plain HTTPS, in any language, from any runtime. Use it when MCP isn’t an option: serverless functions, web frontends, mobile apps, edge runtimes, agents written in Go, Rust, Python, Ruby, or any non-Node stack.

Base URL and authentication

https://hifriendbot.com/wp-json/hifriendbot/v1

Every request needs an API key in the Authorization header. Get one free at /developer/#get-key.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Response format

All responses are JSON. Success responses return the requested data. Errors return:

{
  "error": "human-readable message",
  "code": "machine-readable code"
}

HTTP status codes follow standard conventions: 200 for success, 400 for bad input, 401 for missing or invalid auth, 402 when usage exceeds the plan limit, 404 when the resource doesn’t exist, 429 for rate limiting, 5xx for backend issues.

End-to-end example: save and recall

The shortest possible save → recall flow, in three languages.

curl:

# save a memory
curl -X POST https://hifriendbot.com/wp-json/hifriendbot/v1/cogmemai/store 
  -H "Authorization: Bearer YOUR_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "content": "Orders service uses GraphQL only. Mobile latency budget 200ms.",
    "memory_type": "decision",
    "importance": 9,
    "scope": "project",
    "project_id": "orders-service"
  }'

# recall later (different session, same project)
curl -X POST https://hifriendbot.com/wp-json/hifriendbot/v1/cogmemai/recall 
  -H "Authorization: Bearer YOUR_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "query": "what did we decide about the orders service API?",
    "project_id": "orders-service",
    "limit": 5
  }'

Python:

import requests

BASE = "https://hifriendbot.com/wp-json/hifriendbot/v1"
HEADERS = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json",
}

# save
requests.post(f"{BASE}/cogmemai/store", headers=HEADERS, json={
    "content": "Orders service uses GraphQL only. Mobile latency budget 200ms.",
    "memory_type": "decision",
    "importance": 9,
    "scope": "project",
    "project_id": "orders-service",
})

# recall
result = requests.post(f"{BASE}/cogmemai/recall", headers=HEADERS, json={
    "query": "what did we decide about the orders service API?",
    "project_id": "orders-service",
    "limit": 5,
}).json()

JavaScript / TypeScript (Node 20+):

const BASE = "https://hifriendbot.com/wp-json/hifriendbot/v1";
const headers = {
  "Authorization": `Bearer ${apiKey}`,
  "Content-Type": "application/json",
};

// save
await fetch(`${BASE}/cogmemai/store`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    content: "Orders service uses GraphQL only. Mobile latency budget 200ms.",
    memory_type: "decision",
    importance: 9,
    scope: "project",
    project_id: "orders-service",
  }),
});

// recall
const result = await fetch(`${BASE}/cogmemai/recall`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    query: "what did we decide about the orders service API?",
    project_id: "orders-service",
    limit: 5,
  }),
}).then(r => r.json());

Endpoint reference

All endpoints sit under /cogmemai/ (full path: /wp-json/hifriendbot/v1/cogmemai/...). All POST and PATCH endpoints accept JSON bodies. All GET endpoints take query-string parameters.

Memory lifecycle

MethodPathPurpose
POST/cogmemai/storeSave a memory. Also used for corrections and reminders (pass memory_type: "correction" or "reminder").
POST/cogmemai/recallSemantic recall, ranked by relevance + recency + importance.
POST/cogmemai/smart-recallHigher-quality recall with reasoning, for complex queries.
GET/cogmemai/contextLoad top memories for a project (call this on session start).
GET/cogmemai/memoriesList all memories matching filters (type, category, scope, tag).
PATCH/cogmemai/memory/{id}Update a memory’s content, importance, type, or tags.
DELETE/cogmemai/memory/{id}Delete a memory.
POST/cogmemai/memory/{id}/promoteLift a project-scope memory to global so it applies everywhere.

Bulk operations

MethodPathPurpose
POST/cogmemai/bulk-deleteDelete many memories by ID list. Body: { "ids": [1,2,3] }.
POST/cogmemai/bulk-updateUpdate many memories in one call. Body: { "updates": [{ "id": 1, ... }] }.
GET/cogmemai/exportExport all memories matching a filter (JSON download).
POST/cogmemai/importBulk-load memories from a previous export or external source.

Intelligence

MethodPathPurpose
POST/cogmemai/extractExtract a batch of memories from a conversation transcript. Identifies type, importance, and tags automatically.
POST/cogmemai/ingestIngest a long document (PDF, markdown, transcript) as memories. Body: { "content": "...", "project_id": "..." }.
POST/cogmemai/consolidateMerge related memories into a single comprehensive summary. Takes up to 30 seconds.
POST/cogmemai/generate-skillsGenerate Anthropic-style SKILL.md content from accumulated memories.
POST/cogmemai/extract-principlesDistill long-standing patterns into reusable principles. Up to 30 seconds.

Knowledge graph

MethodPathPurpose
POST/cogmemai/memory/{id}/linkConnect this memory to another (related fact, supersedes, contradicts).
GET/cogmemai/memory/{id}/linksGet all memories linked to this one, with relationship types.
GET/cogmemai/memory/{id}/versionsVersion history for a memory (auto-tracked on every PATCH).

Analytics and feedback

MethodPathPurpose
GET/cogmemai/analyticsUsage patterns, recall frequency, health metrics.
GET/cogmemai/usageCurrent monthly usage vs plan limits.
GET/cogmemai/staleMemories that haven’t been recalled in N days, candidates for cleanup.
GET/cogmemai/tagsList all tags currently in use, with memory counts.
POST/cogmemai/feedbackSignal that a recalled memory was useful or not. Improves ranking over time.

Sessions

MethodPathPurpose
POST/cogmemai/session-summarySave a wrap-up summary of what was accomplished in a session. Surfaces at next session start.

Request body essentials

Common fields across /cogmemai/store and recall endpoints:

FieldTypeNotes
contentstringThe memory itself. One or two sentences, self-contained.
memory_typestringidentity, preference, architecture, decision, bug, dependency, pattern, context, session_summary, task, correction, reminder. Custom types accepted.
importanceint 1-1010 = core architecture, 1 = trivial.
scopestringproject (default) or global. team requires Pro plan.
project_idstringScopes the memory to one codebase. Auto-detected from cwd or git remote when called via MCP; pass explicitly via REST.
tagsstring[]Up to 5 tags, each up to 30 chars. For grouping related memories.
categorystringfrontend, backend, devops, etc. Custom values accepted.
subjectstringShort label (e.g. auth_system) for organization.
ttlstringAuto-expire after this duration (24h, 7d, 30d).

Rate limits

PlanMemories / monthExtractions / monthProjectsRequests / minute
Free500500560
ProHigher limitsHigher limitsUnlimited600
Team / On-premCustomCustomUnlimitedCustom

When you exceed a limit, requests return HTTP 402 Payment Required with an upgrade link. See pricing.

SDKs and clients

  • MCP server (TypeScript, the recommended path for Claude Code, Claude Agent SDK, Cursor, Windsurf, Cline, Continue): npm install -g cogmemai-mcp
  • Direct API / SDK for low-latency deep integration: contact us
  • Working examples in JS and Python: quickstart repo

Help

Stuck? Tell us what you’re building. We answer real engineering questions, not just sales.