SmartMemory
POST
/memory/code/index

Bulk-index code entities and relations into the knowledge graph.

Replaces existing Code nodes for the given repo (within the caller's workspace) only after the complete new generation has been written.

Enforces the tier max_repos cap before any write so the user gets a 402 with upgrade copy instead of a partial index when they exceed it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Bulk index request for code entities and relations.

Response Body

application/json

application/json

curl -X POST "https://example.com/memory/code/index" \  -H "Content-Type: application/json" \  -d '{    "repo": "string",    "entities": [      {        "name": "string",        "entity_type": "string",        "file_path": "string",        "line_number": 0      }    ]  }'
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}