Skip to content

How It Works

beginner

Understand Engramma's 10-phase cognitive cycle — from storing a memory to retrieving it with confidence scores and explanations.

The big picture

When you call client.store() or client.retrieve(), Engramma doesn't just save or search vectors. It runs a 10-phase cognitive cycle — a pipeline that encodes, routes, scores, strengthens, and explains your memories.

Think of it as the difference between a hard drive (stores bytes) and a brain (processes, connects, and reasons about information).

The 10-phase cycle

Here's what happens every time you interact with Engramma:

1

Neuromodulation

The engine assesses the current context — novelty, urgency, importance — and sets a 'plasticity gate' that determines how strongly new information will be encoded.
2

Encoding

Your text or embedding is transformed into a high-dimensional compositional representation. Multiple encoding strategies run in parallel to capture different aspects of meaning.
3

Pathway Selection

The Confidence Router evaluates which retrieval pathway (Exact, Energy, or Attention) will best serve the current operation. This decision adapts based on past performance.
4

Plasticity

Connection strengths between memories update using spike-timing rules — recent, frequently co-accessed memories form stronger bonds.
5

Integration

All pathway results merge into a unified score. Confidence values, pathway weights, and routing history combine to produce the final ranking.
6

Semantic Linking

New memories are linked to existing ones based on meaning. Over time, clusters of related memories form naturally.
7

Causal Discovery

The engine identifies potential cause-effect relationships between memories, building a causal graph you can query.
8

Regime Detection

The system monitors its own state. Is it in Normal mode? Exploring new territory? Detecting anomalies? Behavior adapts accordingly.
9

Temporal Tracking

Time-based patterns emerge — the engine notices sequences, predicts likely next queries, and prefetches relevant memories.
10

Consolidation

During sleep cycles, weak memories decay, strong ones strengthen, and related patterns merge — just like biological memory during sleep.

What you observe as a user

You don't need to understand the internal phases to use Engramma. Here's what you actually see:

You do...Engramma does...You get...
store("fact")Phases 1-7 runA pattern_id + importance score
retrieve("query")Phases 1-5 runRanked results with confidence + pathway
explain("query")Phases 1-5 + XAIHuman-readable reasoning chain
consolidate()Phase 10 runsStrengthened/pruned memory state
stats()Reads current statePattern count, regime, health metrics

A concrete example

Let's trace what happens when you store and retrieve a memory:

from engramma_cloud import EngrammaClient
import os

client = EngrammaClient(api_key=os.environ["ENGRAMMA_API_KEY"])

# Store three related facts
client.store("Alice manages the backend team")
client.store("The backend team uses Python and Go")
client.store("Alice prefers async architectures")

# Retrieve — the engine connects these facts
results = client.retrieve("What languages does Alice's team use?")
print(results[0].text)       # "The backend team uses Python and Go"
print(results[0].confidence) # 0.87
print(results[0].pathway)    # "attention"

# The engine used the Attention pathway because the query
# requires connecting "Alice" → "backend team" → "languages"
# (multi-hop reasoning, not a direct text match)

Notice how the engine answered "What languages does Alice's team use?" even though no single stored fact contains both "Alice" and "languages." The Attention pathway connected the dots across memories.

Latency

The full 10-phase cycle completes in milliseconds:

OperationTypical latency
Store (text)3-8 ms
Retrieve (top 5)2-5 ms
Explain5-12 ms
Consolidate50-200 ms (background)

These numbers scale with your memory count. At 100K patterns, retrieve stays under 10ms thanks to optimized index structures.

A vector database does step 2 (encode) and a simplified version of step 5 (rank by cosine similarity). That's 2 out of 10 phases.

Engramma adds:

  • Adaptive routing — not every query needs the same retrieval strategy
  • Causal links — memories don't exist in isolation, they form a graph
  • Temporal awareness — recent and frequently-accessed patterns rank higher
  • Self-monitoring — the engine detects when it's in unfamiliar territory
  • Consolidation — memory quality improves over time without re-indexing

Next steps