> ## Documentation Index
> Fetch the complete documentation index at: https://agent-memory.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> The HTTP surface on port 3111

All routes live under `/agentmemory/*` on port 3111. When `AGENTMEMORY_SECRET` is set every call requires `Authorization: Bearer <secret>`. The full surface is 130 endpoints; the source of truth is `src/triggers/api.ts`. The families:

| Family              | Routes                                                                                                                                                                   | Purpose                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| Health              | `livez`, `health`, `config/flags`                                                                                                                                        | Liveness plus instance ports, subsystem health, active feature flags       |
| Sessions            | `session/start`, `session/end`, `sessions`, `summarize`, `session/commit`, `session/by-commit`, `commits`                                                                | Session lifecycle, summaries, and git commit linking                       |
| Observe             | `observe`, `observations`, `context`, `compress-file`, `file-context`, `enrich`                                                                                          | Ingest hook events, list observations, inject context, compress files      |
| Memories            | `remember`, `memories`, `memories/:id`, `semantic`, `procedural`, `evolve`, `migrate`, `evict`                                                                           | Save and read memories across tiers, version evolution, migration          |
| Search              | `search`, `smart-search`, `timeline`, `profile`, `patterns`, `vision-search`, `relations`                                                                                | Keyword, hybrid, temporal, visual, and relational recall                   |
| Lessons             | `lessons`, `lessons/search`, `lessons/strengthen`, `lessons/delete`, `generate-rules`                                                                                    | Save, recall, reinforce, and retire lessons                                |
| Slots               | `slots`, `slot`, `slot/append`, `slot/replace`, `slot/reflect`                                                                                                           | Editable size-limited memory units                                         |
| Actions             | `actions`, `actions/update`, `actions/edges`, `frontier`, `next`, `leases/*`, `routines/*`, `signals/*`, `checkpoints/*`, `sentinels/*`, `sketches/*`, `facets/*`        | The coordination layer: work items, dependencies, leases, messaging, gates |
| Crystals and replay | `crystals/create`, `crystals`, `crystals/auto`, `replay/load`, `replay/sessions`, `replay/import-jsonl`, `flow/compress`                                                 | Compress finished work into digests, import and replay transcripts         |
| Graph               | `graph/query`, `graph/stats`, `graph/extract`, `graph/build`, `graph/reset`, `graph/snapshot-rebuild`, `graph/import-graphify`, `reflect`, `insights`, `insights/search` | Knowledge graph and synthesized insights                                   |
| Team and mesh       | `team/share`, `team/feed`, `team/profile`, `mesh/peers`, `mesh/sync`, `mesh/receive`, `mesh/export`                                                                      | Team feed within one instance, peer sync across instances                  |
| Governance          | `forget`, `auto-forget`, `governance/memories`, `governance/bulk-delete`, `audit`, `verify`, `cascade-update`, `consolidate`, `consolidate-pipeline`                     | Deletion with audit trail, TTL sweeps, provenance verification             |
| Export and import   | `export`, `import`, `obsidian/export`, `claude-bridge/read`, `claude-bridge/sync`, `snapshots`, `snapshot/create`, `snapshot/restore`                                    | Full-state JSON, Obsidian vault, Claude Code bridge, git snapshots         |
| Misc                | `branch/detect`, `branch/worktrees`, `branch/sessions`, `diagnostics`, `diagnostics/heal`, `diagnostics/followup`, `viewer`                                              | Branch awareness, self-diagnosis and healing, viewer redirect              |

A first call:

```bash theme={"dark"}
curl -X POST http://localhost:3111/agentmemory/smart-search \
  -H 'Content-Type: application/json' \
  -d '{"query": "auth middleware"}'
```

`POST /agentmemory/remember` and the search routes accept `project` and `agentId` for scoping; see [Provenance](/docs/provenance).
