All Docs

Memory API

Store and search workspace memories via the REST API. Memories are semantic snippets — decisions, facts, patterns, preferences — that agents can retrieve during conversations.

Search Memories

GET /api/v1/memory/search

Search memories with relevance ranking.

Query Parameters

ParameterTypeDescription
qstringSearch query (required)
typestringFilter by type: decision, fact, solution, pattern, preference, summary
limitnumberMax results (default 10)

Response

{
  "data": [
    {
      "id": "uuid",
      "content": "We chose JWT over sessions for the API layer",
      "type": "decision",
      "score": 0.87,
      "createdAt": "2026-03-10T14:30:00.000Z"
    }
  ]
}

Example

curl -H "Authorization: Bearer cg_YOUR_KEY" \
  "https://cognova.dev/api/v1/memory/search?q=authentication&type=decision"

Store a Memory

POST /api/v1/memory

Request Body

FieldTypeRequiredDescription
contentstringYesThe memory content
typestringNoMemory type (default fact). One of: decision, fact, solution, pattern, preference, summary

Response

{
  "data": {
    "id": "uuid",
    "content": "We chose JWT over sessions for the API layer",
    "type": "decision",
    "createdAt": "2026-03-12T10:00:00.000Z"
  }
}

Example

curl -X POST https://cognova.dev/api/v1/memory \
  -H "Authorization: Bearer cg_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "We chose JWT over sessions for the API layer", "type": "decision"}'

Memory Types

TypeUse For
decisionArchitectural or design decisions
factFactual information about the project
solutionHow a problem was solved
patternRecurring patterns or conventions
preferenceTeam or user preferences
summarySummaries of longer discussions