Neuroloom

Reference

Feedback API

Rate a memory's usefulness after you retrieve and use it. Positive feedback increases a memory's importance score over time; negative feedback decreases it. This signal feeds into the scheduled importance recalculation job and helps Neuroloom surface the most relevant memories first.

See Session Lifecycle for how feedback integrates with the broader memory health cycle.

Base URL and Authentication

https://api.neuroloom.dev

All requests require an API key:

Authorization: Token $MEMORIES_API_TOKEN

Rate a Memory

POST /api/v1/memories/{memory_id}/feedback

Record whether a memory was useful after you retrieved and acted on it. Call this after using (or deciding not to use) a retrieved memory to provide an explicit quality signal.

memory_rate(
  memory_id="mem-a1b2c3d4e5f6g7h8",
  useful=true,
  context="This pattern resolved the N+1 query issue in the sessions router. The selectinload hint was exactly what was needed."
)

The context field is optional but valuable — it gives the importance recalculation job a human-readable explanation for why the memory was helpful.

import httpx, os

response = httpx.post(
    "https://api.neuroloom.dev/api/v1/memories/mem-a1b2c3d4e5f6g7h8/feedback",
    headers={"Authorization": f"Token {os.environ['MEMORIES_API_TOKEN']}"},
    json={
        "useful": True,
        "context": "This pattern resolved the N+1 query issue in the sessions router.",
        "session_id": "sess-abc123",
    },
)
assert response.status_code == 201
curl -X POST "https://api.neuroloom.dev/api/v1/memories/mem-a1b2c3d4e5f6g7h8/feedback" \
  -H "Authorization: Token $MEMORIES_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "useful": true,
    "context": "This pattern resolved the N+1 query issue in the sessions router.",
    "session_id": "sess-abc123"
  }'

Path parameters

ParameterTypeDescription
memory_idstringThe memory_id of the memory to provide feedback on (e.g. mem-a1b2c3d4e5f6g7h8).

Request body

FieldTypeRequiredDefaultDescription
usefulbooleanYestrue if the memory was helpful in context, false if it was not.
contextstringNonullExplanation of why the memory was or was not useful. Stored alongside the feedback record.
session_idstringNonullSession ID linking the feedback to a specific work session. Must belong to the same workspace — cross-workspace session IDs are silently ignored.

Response201 Created, the memory object the feedback was applied to.

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "memory_id": "mem-a1b2c3d4e5f6g7h8",
  "title": "Use selectinload for SQLAlchemy relationship loading",
  "importance_score": 0.9,
  "feedback_positive_count": 6,
  "feedback_negative_count": 1,
  ...
}

feedback_positive_count and feedback_negative_count reflect the updated totals after this submission.


How Feedback Affects Importance

Feedback is not applied to importance_score immediately. It is incorporated during the scheduled importance recalculation job that runs periodically across the workspace. After the job runs, memories with net positive feedback will have a higher importance_score and appear earlier in search results.

The recalculation formula weights:

  • feedback_positive_count — increases importance
  • feedback_negative_count — decreases importance
  • access_count and retrieval_count — recency and frequency of use
  • Original confidence_score — baseline trust in the memory
Note

You can view the current feedback_positive_count and feedback_negative_count on any memory by calling GET /api/v1/memories/{memory_id}. These totals update immediately after feedback is submitted, even before the recalculation job runs.


When to Submit Feedback

Submit positive feedback when a retrieved memory directly helped you complete a task or make a decision. Submit negative feedback when a retrieved memory was outdated, incorrect, or irrelevant to the context it appeared in.

The MCP memory_rate tool is designed for use at the end of a task, after you have evaluated whether the retrieved context was genuinely useful. If you used memory_search or memory_get_detail to retrieve a memory, call memory_rate once you know whether it helped.


Error Responses

StatusWhen
401 UnauthorizedMissing or invalid Authorization header.
404 Not FoundThe memory_id does not exist in the authenticated workspace.
422 Unprocessable Entityuseful field missing or not a boolean.
{ "detail": "Memory 'mem-notexist' not found." }

Ready to get started?

Start building with Neuroloom for free.

Start Building Free