Implementation report — February 15, 2026
Anky now has a deep memory system. Before today, every writing session was analyzed in complete isolation — Anky had no idea who you were, what you'd written before, or what patterns run through your consciousness. That's over.
Now, after every 8-minute writing session, Anky:
The result: reflections that feel like they come from someone who actually knows you.
All existing writing sessions were retroactively processed.
How the memory system works under the hood.
User writes for 8 minutes
|
v
┌─────────────────────────┐
│ Writing Session │
│ saved to DB │
└──────────┬──────────────┘
│
┌──────┴──────┐
│ │
v v
┌────────┐ ┌────────────────────────┐
│ Image │ │ Reflection (SSE stream) │
│ Pipeline│ │ + MEMORY CONTEXT │ <── NEW
└───┬────┘ └────────────────────────┘
│
│ (after image is done)
v
┌──────────────────────────────────┐
│ Memory Pipeline (background) │ <── NEW
│ │
│ 1. Embed writing (OpenAI) │
│ 2. Extract memories (Claude) │
│ 3. Store with dedup │
│ 4. Update profile (every 5th) │
└──────────────────────────────────┘
occurrence_count and importance are incremented. This means frequently recurring themes naturally rise to the top.When a user finishes writing and Anky streams back a reflection, the system now does this first:
Three new tables added to anky.db.
Vector storage for writing sessions. Each row = one embedded text.
| Column | Type | Purpose |
|---|---|---|
| id | TEXT PK | Format: ws-{session_id} |
| user_id | TEXT | Who wrote it |
| writing_session_id | TEXT | Link to writing session |
| source | TEXT | "writing" or "memory" |
| content | TEXT | First 500 chars (preview) |
| embedding | BLOB | 1536 x f32 vector |
Structured memories extracted from writing. Deduplicated by semantic similarity.
| Column | Type | Purpose |
|---|---|---|
| id | TEXT PK | UUID |
| user_id | TEXT | Who this memory belongs to |
| category | TEXT | theme / emotion / pattern / breakthrough / avoidance / entity |
| content | TEXT | The memory text |
| importance | REAL | 0.0 – 1.0 (grows with recurrence) |
| occurrence_count | INT | How many times this theme appeared |
| embedding | BLOB | For dedup comparison |
Evolving psychological portrait per user. Updated every 5th session.
| Column | Type | Purpose |
|---|---|---|
| user_id | TEXT PK | One profile per user |
| psychological_profile | TEXT | ~400 word portrait (markdown) |
| emotional_signature | TEXT | Dominant emotional patterns |
| core_tensions | TEXT | Central conflicts/paradoxes |
| growth_edges | TEXT | Where they're evolving |
| total_sessions | INT | Session counter |
src/memory/mod.rs NEWsrc/memory/embeddings.rs NEW — OpenAI embedding client, cosine similarity, vector storage/searchsrc/memory/extraction.rs NEW — Claude Haiku memory extraction, semantic dedup, structured storagesrc/memory/recall.rs NEW — Builds memory context for injection into reflection promptssrc/memory/profile.rs NEW — Psychological profile generation and evolutionsrc/pipeline/memory_pipeline.rs NEW — Orchestrates the full memory pipeline + backfillsrc/db/migrations.rs MOD — 3 new tables + indexessrc/config.rs MOD — Added OPENAI_API_KEY env varsrc/main.rs MOD — Added mod memory;src/services/claude.rs MOD — Memory-enriched reflection functions + streaming with contextsrc/pipeline/image_gen.rs MOD — Spawns memory pipeline after anky completion + memory in fallback reflectionssrc/pipeline/mod.rs MOD — Registered memory_pipeline modulesrc/routes/api.rs MOD — Memory context in stream_reflection + backfill endpointsrc/routes/mod.rs MOD — Registered /api/memory/backfill routeBefore: Every reflection started from zero. Anky was insightful but had amnesia. The 50th session felt exactly like the 1st — no recognition, no continuity, no "I've noticed you keep coming back to this."
After: The reflection system prompt now includes something like:
=== WHAT YOU KNOW ABOUT THIS PERSON ===
[Their full psychological profile — core themes,
emotional signature, growth edges, tensions]
=== RECURRING PATTERNS (significance: high) ===
- theme: building technology as a form of self-inquiry (seen 4x)
- pattern: oscillation between creation and surrender (seen 3x)
- breakthrough: recognizing that the product IS the practice
=== RELEVANT PAST WRITING MOMENTS ===
- "i keep coming back to this idea that the code is
the meditation, not separate from it..."
- "today i realized that every time i try to control
the outcome i lose the thread..."
=== HOW TO USE THIS CONTEXT ===
Reference patterns naturally. Notice evolution. Don't
just validate — show them what's changed since last time.
Claude reads all of this before writing the reflection. The result is a response that feels like it comes from someone who has been paying attention — because it has.
This architecture was inspired by studying the OpenClaw project's memory system, which uses:
The Anky implementation adapts this for a fundamentally different use case: instead of chatbot memory (storing facts), it stores psychological patterns — the emotional undercurrents, recurring tensions, and growth edges that emerge across writing sessions. The deduplication is semantic rather than exact, and the profiles are interpretive rather than factual.
The system is live and working. Potential future enhancements: