Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
Markdown
Agent Memory (Local-First) #
This system provides fast local working memory with optional remote sync.
Goals #
- Keep working-memory reads local and fast.
- Avoid plaintext remote transcript storage.
- Support continuity across laptops with
rememberlineage. - Keep Docker/devcontainer rebuilds smooth (no new npm deps).
Local Store #
Default location:
~/.ac-agent-memory
Override:
AGENT_MEMORY_HOME=/some/path
Layout:
sessions/*.json- session metadataevents/*.ndjson- encrypted append-only eventscheckpoints/*.ndjson- redacted checkpointsqueue/outbound.ndjson- remote sync queue (optional)device-id- stable local device idkey.bin- local AES key (ifAGENT_MEMORY_KEYis not provided)
Security #
- Event payloads are encrypted locally with AES-256-GCM.
- Redaction runs for previews/summaries before indexing/sync.
- Raw plaintext is not written to remote by default.
Optional key management:
AGENT_MEMORY_KEY=base64:<32-byte-key>- or
AGENT_MEMORY_KEY=<hex64>
If unset, a local key file is generated automatically.
CLI #
# List sessions
node memory/cli.mjs list
# Log event (from JSON stdin)
echo '{"provider":"codex","role":"user","text":"hello"}' | node memory/cli.mjs event --session my-session
# Manual checkpoint
node memory/cli.mjs checkpoint --session my-session --reason manual
# Continue by lineage (new session seeded from checkpoint)
node memory/cli.mjs remember --from my-session
# Health/status
node memory/cli.mjs doctor
# Print reproducible env profile (for other machines)
node memory/cli.mjs profile --include-key --exports
NPM shortcuts:
npm run agent-memory:doctornpm run agent-memory:profilenpm run agent-memory:set-device -- --id thinkpad-x1-mainnpm run agent-memory:sync-codexnpm run agent-memory:install-hooks
Fish ac-* shortcuts (devcontainer):
ac-memory-list -- --limit 25ac-memory-remember -- --from <session-id>ac-memory-hooksac-memory-syncac-memory-flush
Hook Integration #
.claude/settings.jsonalready callsmemory/hook.mjsonUserPromptSubmit.memory/hook.mjswrites each hook event to local encrypted memory..githooks/post-commitlogs a commit event, imports recent Codex prompts, and flushes remote queue.- Install repo hooks once with:
npm run agent-memory:install-hooks
Multi-Vendor + Multi-Machine #
For Codex + Claude side-by-side across 2-3 machines, use shared key + per-machine device id:
# Shared across all your machines (same value everywhere)
export AGENT_MEMORY_KEY="base64:<32-byte-key>"
# Unique per machine/container
export AGENT_DEVICE_ID="thinkpad-x1-main"
# Optional defaults per terminal/session
export AGENT_MEMORY_PROJECT="aesthetic-computer"
export AGENT_MEMORY_PROVIDER="claude" # or codex
export AGENT_MEMORY_TICKET="ticket-4821"
Recommended session id convention when multiple tickets are active:
<ticket>-<provider>-<device>-<short-ts>
Examples:
ticket-4821-claude-thinkpadx1-20260312t1940ticket-4821-codex-thinkpadp1-20260312t1942
Side-by-side quick commands:
# Claude terminal
AGENT_MEMORY_PROVIDER=claude AGENT_SESSION_ID=ticket-4821-claude-thinkpadx1-20260312t1940 node memory/cli.mjs event --text "start"
# Codex terminal
AGENT_MEMORY_PROVIDER=codex AGENT_SESSION_ID=ticket-4821-codex-thinkpadp1-20260312t1942 node memory/cli.mjs event --text "start"
Reproducible setup flow (recommended):
- On your primary machine, generate and print a portable profile:
node memory/cli.mjs profile --include-key --exports - Copy those exports into your private machine env (
.devcontainer/envs/devcontainer.envor shell profile). - On each machine, set a unique device id:
npm run agent-memory:set-device -- --id <unique-machine-id> - Validate with:
npm run agent-memory:doctor
Template for Docker/devcontainer env wiring:
.devcontainer/envs/agent-memory.env.example.devcontainer/devcontainer.jsonnow forwardsAGENT_MEMORY_*vars from hostlocalEnv
Optional Remote Sync #
Remote sync is disabled by default.
Enable queue + flush:
export AGENT_MEMORY_REMOTE_ENABLED=true
export AGENT_MEMORY_REMOTE_URL="https://aesthetic.computer/api/agent-memory-ingest"
export AGENT_MEMORY_REMOTE_TOKEN="<token>"
Flush queued records:
node memory/cli.mjs flush-remote
Remote ingest endpoint:
system/netlify/functions/agent-memory-ingest.mjs
Recommended for siphoned database setup:
AGENT_MEMORY_MONGODB_CONNECTION_STRINGAGENT_MEMORY_MONGODB_NAMEAGENT_MEMORY_SECRET_ID(defaults toagent-memory)
Store ingest auth token in Mongo secrets collection (same pattern as other services):
_id: "agent-memory"(or yourAGENT_MEMORY_SECRET_ID)- field:
ingestToken(also acceptstokenorremoteToken)
Docker / Rebuild Notes #
- Uses built-in Node modules only (
crypto,fs, etc.). - No package-lock changes required.
- No Dockerfile changes required for basic local-first mode.