How It Works

What actually happens when Himiko remembers or looks something up. No jargon, just the mechanics.

Embeddings: the core concept

Think of it like a library

A traditional library organises books by category — history on one shelf, science on another. If you want "books about leadership in wartime," you'd have to check both the history and business sections.

Embeddings work differently. Instead of categories, every piece of information gets a position in a vast space — like placing a pin on a map. Things that are similar in meaning end up close together, even if they use different words. "Leadership in wartime" and "Churchill's management style during the Blitz" would be right next to each other.

When Himiko searches, she doesn't look up keywords. She finds the spot on the map where your question lives, then looks at what's nearby.

What's a "dimension"?

You see "512 dimensions" and "768 dimensions" in the architecture. Here's what that means:

A pin on a map has 2 dimensions (north-south, east-west). That's enough to find a cafe. But to find a similar memory, you need more nuance — was it about a client? Was it urgent? Was it about money? Each dimension captures one facet of meaning.

512 dimensions (Voyage AI, current) = good enough for text. Captures meaning well.

768 dimensions (Gemini, new) = richer. Can distinguish between a photo of a whiteboard and a photo of a product mockup. More dimensions = more nuance = better results, especially for non-text content.

More isn't always better — it costs more storage and slightly slower searches. 768 is the sweet spot for multimodal content.

When Himiko stores a memory

Something happens
Embedding service
Numbers (vector)
Supabase database

Step 1: Something worth remembering happens — a decision, a client interaction, a discovery.
Step 2: The embedding service (currently Voyage AI) converts the text into a list of numbers — its mathematical "position" in meaning-space.
Step 3: Those numbers, plus the original text, get stored in the Supabase database.
Step 4: Ogham automatically checks if any existing memories are similar (above 85% match) and links them together in the knowledge graph. A memory about "Meridian pricing" auto-links to other Meridian memories.

When Himiko searches for a memory

Your question
Embed the question
Find nearest vectors
Rank results

Step 1: You ask a question: "What did we decide about the pricing model?"
Step 2: The question gets embedded — turned into the same kind of numbers as the memories.
Step 3: The database finds memories whose numbers are closest (vector similarity) AND checks for keyword matches. Both results get merged.
Step 4: Ogham ranks what it found using cognitive scoring: memories accessed recently rank higher. Memories linked to many others rank higher. Memories that have been reinforced (confirmed accurate) rank higher. Disputed memories rank lower.

Why hybrid search matters

Vector search alone isn't enough

If you search for "TSFE invoice", vector search finds memories about invoices and TSFE-related topics. Good, but it might also surface vaguely similar things about other clients' billing.

Keyword search catches the exact term "TSFE" and "invoice" — no fuzzy matching, just precision.

Ogham runs both in a single database query, then merges the results. If a memory scores high on both meaning AND exact terms, it floats to the top. This is called Reciprocal Rank Fusion — a fancy name for "combine two lists intelligently."

The knowledge graph

Memories that link to other memories

When Himiko stores a new memory, Ogham checks: is this similar to anything we already know? If the similarity is above 85%, it creates a link between them.

Over time, this builds a web. A memory about "Meridian meeting on 2 April" links to "Meridian invoice sent" links to "Meridian prefers email for billing." When you ask about Meridian, Ogham doesn't just find one memory — it walks the links and brings back the whole cluster.

Link types: similar, supports, contradicts, related, follows, derived from.

Cognitive scoring

Not all memories are equal

Ogham ranks memories based on a model inspired by how human memory works (ACT-R):

FactorEffect
RecencyNewer memories rank higher. Yesterday's decision beats last month's.
FrequencyMemories accessed often rank higher. If Himiko keeps looking something up, it's important.
ConnectivityMemories linked to many others rank higher. Central facts beat isolated ones.
ConfidenceReinforced memories rank higher. Contradicted ones rank lower.
SignalMemories about decisions, errors, or architecture rank higher than casual notes.

All computed in a single SQL query. No AI in the search pipeline — just fast, deterministic ranking.

What happens to old memories?

Automatic condensing

Old, unaccessed memories don't just pile up. Ogham automatically condenses them over time:

Full textKey sentences (~30% of original) → One-line summary with tags

The original is always preserved — if the memory becomes relevant again, it can be restored in full. High-signal and frequently-accessed memories resist condensing. Think of it as your brain naturally fading details of unimportant events while keeping vivid memories of important ones.