Skip to main content

List Memories

Retrieve all memories for a repository, optionally filtered by type.
curl -X GET 'http://localhost:8000/api/v1/memory?repo=octocat/nectr&memory_type=project_rule' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/memory Authentication: Required
repo
string
required
Repository in owner/repo format
memory_type
string
Filter by memory type (e.g., project_rule, contributor_profile, developer_pattern)

Response

memories
array
required
Array of memory objects
count
integer
required
Total number of memories returned

Example Response

{
  "memories": [
    {
      "id": "mem_abc123",
      "memory": "Always use async/await for database operations",
      "metadata": {
        "memory_type": "project_rule",
        "repo": "octocat/nectr",
        "created_at": "2025-03-01T10:00:00Z"
      }
    }
  ],
  "count": 1
}

Error Responses

  • 403: Repo not connected or access denied

Get Memory Stats

Retrieve memory counts by type for a repository.
curl -X GET 'http://localhost:8000/api/v1/memory/stats?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/memory/stats Authentication: Required
repo
string
required
Repository in owner/repo format

Response

repo
string
required
Repository name
total
integer
required
Total memories
by_type
object
required
Counts grouped by memory type

Example Response

{
  "repo": "octocat/nectr",
  "total": 47,
  "by_type": {
    "project_rule": 8,
    "contributor_profile": 5,
    "developer_pattern": 12,
    "developer_strength": 10,
    "architecture_pattern": 7,
    "coding_convention": 5
  }
}

Get Project Map

Retrieve the full project map for onboarding and context.
curl -X GET 'http://localhost:8000/api/v1/memory/project-map?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/memory/project-map Authentication: Required
repo
string
required
Repository in owner/repo format

Response

memories
array
required
Array of project-level memories (architecture, conventions, patterns)
count
integer
required
Total memories returned

Example Response

{
  "memories": [
    {
      "memory": "FastAPI backend with SQLAlchemy ORM and PostgreSQL",
      "metadata": {
        "memory_type": "architecture_pattern"
      }
    },
    {
      "memory": "Use snake_case for Python variables and functions",
      "metadata": {
        "memory_type": "coding_convention"
      }
    }
  ],
  "count": 2
}

Rescan Repository

Re-run the project scanner to update memories from the latest code.
curl -X POST 'http://localhost:8000/api/v1/memory/rescan?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: POST /api/v1/memory/rescan Authentication: Required
repo
string
required
Repository in owner/repo format

Response

status
string
required
Always "rescan_started"
repo
string
required
Repository name

Example Response

{
  "status": "rescan_started",
  "repo": "octocat/nectr"
}

Notes

  • Runs asynchronously in background
  • Scans repository structure and extracts conventions using AI
  • Updates existing memories (does not duplicate)

Error Responses

  • 400: Invalid repo format
  • 403: Repo not connected
  • 503: Memory layer not configured

Add Memory

Manually add a memory (e.g., custom project rule).
curl -X POST 'http://localhost:8000/api/v1/memory' \
  --cookie 'access_token=<your_jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "repo": "octocat/nectr",
    "content": "Always validate input with Pydantic models",
    "memory_type": "project_rule"
  }'
Method: POST /api/v1/memory Authentication: Required

Request Body

repo
string
required
Repository in owner/repo format
content
string
required
Memory content (free text)
memory_type
string
default:"project_rule"
Memory type classification

Response

id
string
required
Memory ID (from Mem0)
status
string
required
Always "added"

Example Response

{
  "id": "mem_xyz789",
  "status": "added"
}

Error Responses

  • 403: Repo not connected
  • 503: Memory layer not configured

Delete Memory

Delete a memory by ID.
curl -X DELETE 'http://localhost:8000/api/v1/memory/mem_xyz789?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: DELETE /api/v1/memory/{memory_id} Authentication: Required
memory_id
string
required
Memory ID to delete
repo
string
required
Repository in owner/repo format (for access control)

Response

status
string
required
Always "deleted"

Example Response

{
  "status": "deleted"
}

Error Responses

  • 403: Repo not connected
  • 404: Memory not found or already deleted

Build docs developers (and LLMs) love