API Reference

The memory REST API reads and writes project notes. Use MCP for keys limited to selected workspaces or projects.

Markdown

Authentication and scope

Send an API key in Authorization: Bearer <api-key>. Node retrieval, search and write endpoints require an account-wide API key; writes also require read-write access. A browser session JWT does not replace the key on these endpoints. Project authorization still applies.

A scoped-key 403 is a boundary, not an instruction to widen permissions. Use MCP for that scoped key. Ask the administrator if the REST workflow is appropriate.

Memory endpoints

GET /api/v1/memory/search: q and projectId are required; limit is 1–50. Returns relevant nodes with nodeId, label, content, score and metadata. A score measures similarity, not truth.

POST /api/v1/memory/add: projectId and content are required; tags and type are optional. Content is limited to 10 KiB in UTF-8. A successful response is HTTP 201 with nodeId, content, tags, type, createdAt and updatedAt.

GET /api/v1/memory/list: projectId is required; limit is 1–200 and offset is optional. The response contains nodes and total.

GET /api/v1/memory/:id reads one node.

GET /api/v1/memory/related/:id accepts an optional limit of 1–50 (default 10). A 200 response is an array of objects with nodeId, content, score, tags and type.

DELETE /api/v1/memory/:id requires write access and returns 204 with no body on success. Use a read request to test the connection.

GET /api/v1/memory/usage accepts an account-wide API key (read-only or read-write) or a valid session JWT. A workspace or project key returns 403. The response has used, limit and tier. A null limit means unlimited nodes.

Errors and retries

400 means invalid input; correct the named field. 401 means missing or invalid credentials. 403 means the requested access or key scope is refused. A 404 can mean an unavailable node; it does not grant permission to search other projects.

GET /search and GET /related/:id return HTTP 503 when embeddings are not configured. Use GET /list or GET /:id to read notes without embeddings. Ask the deployment administrator about enabling embeddings before retrying a semantic request.

If an add request has an uncertain outcome, check the project before resending it. Repeating the request can create another node.

GraphQL application contract

The application uses /graphql over HTTP and graphql-ws for subscriptions. The schema is versioned with the deployment. A response can contain errors even with HTTP 200. Operations and subscriptions check authentication and resource access. Production introspection is disabled.

curl --get "$NEKOMIND_ORIGIN/api/v1/memory/list" \
  -H "Authorization: Bearer $NEKOMIND_API_KEY" \
  --data-urlencode 'projectId=00000000-0000-4000-8000-000000000001' \
  --data-urlencode 'limit=5'