@audaxic/memory-codex
v1.0.0
Published
Codex CLI integration for Audaxic Memory — automatically saves conversation facts and injects semantic context
Maintainers
Readme
@audaxic/memory-codex
Codex CLI integration for Audaxic Memory — automatically saves conversation facts and injects semantic context into the agent.
Installation
npx @audaxic/memory-codex installThis will:
- Prompt for your Audaxic API key (saved to
~/.config/audaxic/config.json) - Copy hook scripts to
~/.codex/audaxic/ - Register hooks in
~/.codex/hooks.json
Get your API key from: https://memory-dashboard.audaxic.com
How It Works
The installer registers two Codex CLI hooks:
UserPromptSubmit → recall.js
When you submit a prompt, this hook:
- Buffers your prompt to
~/.codex/audaxic/buffer.json - Searches Audaxic Memory for relevant context (
POST /search) - Injects retrieved memories as
<audaxic_memory_context>into the agent
Stop → capture.js
When the agent finishes responding, this hook:
- Buffers the assistant's response to
~/.codex/audaxic/buffer.json - When the buffer reaches 30 messages, flushes to
POST /add - Persists to disk immediately so no messages are lost on crash
Architecture
┌──────────────────────────────────────────────────────────────┐
│ Codex CLI │
│ │
│ User types prompt │
│ │ │
│ ▼ │
│ UserPromptSubmit ──► recall.js │
│ │ ├─ buffer user prompt to disk │
│ │ └─ POST /search → inject context │
│ ▼ │
│ LLM responds │
│ │ │
│ ▼ │
│ Stop ──────────────► capture.js │
│ ├─ buffer assistant msg to disk │
│ └─ if buffer >= 30 → POST /add │
└──────────────────────────────────────────────────────────────┘Environment Variable Alternative
Instead of the setup prompt, you can set the API key as an environment variable:
export AUDAXIC_API_KEY="ak_your_key_here"The scripts check in this order:
AUDAXIC_API_KEYenvironment variable~/.config/audaxic/config.jsonconfig file
Uninstall
- Remove hooks from
~/.codex/hooks.json - Delete
~/.codex/audaxic/directory
API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| https://api.memory.audaxic.com/search | POST | Search memories for context injection |
| https://api.memory.audaxic.com/add | POST | Save conversation messages in batch |
Related
License
MIT
