Skip to content

Persistent memory for agents. Agents learn from failures. Deja remembers.

Notifications You must be signed in to change notification settings

acoyfellow/deja

Repository files navigation

deja

What survives a run.

deja is a self-hosted memory layer for agents. It exposes durable memory via REST + MCP, with scoped recall and optional live working state.

Start here

1) Tutorial (learning-oriented)

2) How-to guides (task-oriented)

3) Reference (information-oriented)

  • REST + MCP reference: https://deja.coey.dev/docs
  • OpenAPI (working state): docs/openapi-working-state.yaml
  • Drizzle schema source of truth: src/schema.ts
  • Migration artifacts: drizzle/

4) Explanation (understanding-oriented)


Minimal deploy

git clone https://github.com/acoyfellow/deja
cd deja
bun install
wrangler login
wrangler vectorize create deja-embeddings --dimensions 384 --metric cosine
wrangler secret put API_KEY
bun run deploy

Minimal MCP config (agent-agnostic)

Any MCP-capable agent can connect to:

  • Endpoint: https://<your-host>/mcp
  • Header: Authorization: Bearer <API_KEY>

Example:

{
  "mcpServers": {
    "deja": {
      "type": "http",
      "url": "https://deja.your-subdomain.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${DEJA_API_KEY}"
      }
    }
  }
}

Core API surface

  • Memory: /learn, /inject, /query, /learnings, /learning/:id, /stats
  • Working state: /state/:runId, /state/:runId/events, /state/:runId/resolve
  • Secrets: /secret, /secret/:name, /secrets

For full payloads and examples, use: https://deja.coey.dev/docs