Sacred Essence is a long-term memory system for AI agents.
It stores memories as Markdown, summarizes them into layered representations, lets you search and reconstruct context later, and gradually decays low-value memories into distilled residue instead of keeping everything forever.
In one sentence:
Sacred Essence helps an AI agent turn raw events into searchable, human-readable, long-term memory.
Most agents only have one of these:
- short chat history
- a vector database full of opaque chunks
- a notes folder that keeps growing forever
That creates four problems:
-
No real long-term memory
Important things get buried in old conversations. -
No human-readable memory source
If memory only lives inside embeddings or a database, it becomes hard to inspect, edit, or trust. -
No memory lifecycle
Everything is stored forever, so retrieval quality gets worse over time. -
No distillation
Old memories are either kept forever or deleted entirely. There is no middle ground.
Sacred Essence is built to solve exactly that.
Sacred Essence does five main things:
Every memory is kept as a readable file instead of disappearing into a black box.
Each memory can be represented as:
- L0 — tiny semantic abstract
- L1 — structured overview
- L2 — full content
This lets an agent recall cheaply first, then load more detail only when needed.
You can search by meaning, keyword, or constrained scope, then project the relevant memory back into usable context.
Not every memory should remain equally important forever. Sacred Essence gradually downgrades less useful memories.
Before a weak memory disappears, the system can keep its final lesson as a distilled residue.
So instead of this:
- keep everything forever
- or delete everything brutally
it does this:
- keep what matters
- cool what fades
- distill what is still worth preserving
At a high level, Sacred Essence works like this:
Raw event / note
↓
Encode into memory node
↓
Store as Markdown (human-readable source)
↓
Generate L0 / L1 / L2 projections
↓
Retrieve later by search / projection
↓
Decay over time if no longer useful
↓
Distill to SOIL before final removal
This gives you a memory system that is:
- readable
- searchable
- compactable
- decay-aware
- rebuildable if the retrieval layer changes
Sacred Essence uses a lifecycle model instead of infinite storage.
GOLDEN -> protected core memory
SILVER -> active memory
BRONZE -> cooling memory
DUST -> near-forgetting memory
SOIL -> distilled residue
-
GOLDEN
Core memories you want to preserve deliberately. -
SILVER
Active memories that are still useful in current work. -
BRONZE
Older memories that still exist but matter less. -
DUST
Memories close to being forgotten. -
SOIL
The final residue: not full detail, but the durable lesson.
This is one of the main differences between Sacred Essence and ordinary note storage.
Sacred Essence chooses Markdown on purpose.
Because long-term memory should be:
- human-readable
- diffable
- easy to back up
- portable across tools
- not locked into one vendor or one index format
The Markdown files are the source of truth.
Any retrieval/index layer is secondary and can be rebuilt.
If every recall always loads the full memory, token cost and noise go up quickly.
Layered memory fixes that.
A very small semantic anchor. Good for orientation.
A structured summary. Good for deciding whether this memory matters.
The full original memory. Good for deep reconstruction.
This lets an agent do staged recall instead of blindly dumping everything into context.
In practice, Sacred Essence works best as part of a broader agent memory workflow.
A common split looks like this:
-
Daily logs / raw notes
Short-term event capture, rough notes, and session residue. -
Handoff / operational memory
The active workbench: what is in progress, what is blocked, what must be resumed next. -
Sacred Essence
Durable structured memory: distilled events, layered recall, long-term lessons, and decay-aware storage. -
QMD or other local index layer
Retrieval acceleration: semantic search, constrained search, and fallback lookup across the memory space.
That means Sacred Essence is not trying to replace every file in a workflow.
It plays the role of the durable memory core, while handoff handles active continuity and QMD handles faster retrieval.
handoff is the operational layer.
It answers questions like:
- what is currently being worked on?
- what is blocked?
- what should the next agent/session resume first?
- what still needs validation?
This is different from Sacred Essence.
Sacred Essence stores the longer-lived memory artifact.
handoff stores the active continuity state.
A useful rule of thumb is:
- use handoff for immediate coordination
- use Sacred Essence for durable memory
QMD is not the memory itself. It is the retrieval spine / index layer that helps surface memory efficiently.
In a typical setup:
- Sacred Essence keeps the canonical memory artifacts in Markdown
- QMD syncs or indexes those artifacts for faster retrieval
- search can use QMD as an accelerator without changing the source of truth
This separation matters.
If the index changes, the memory still survives. If the memory evolves, the index can be rebuilt.
That is why Sacred Essence and QMD work well together:
- Sacred Essence = memory truth
- QMD = retrieval acceleration
Sacred Essence is useful when an agent needs to remember things like:
- project decisions
- technical lessons
- user preferences
- repeated mistakes
- distilled insights from long work sessions
- stable facts that should survive across sessions
Examples:
- “Why did we choose queue-first retries?”
- “What was the final lesson from that failed deployment?”
- “What matters from a month of research, without loading all raw logs?”
- “What should still remain after the detailed context has faded?”
git clone https://github.com/nerv00kaworu/Sacred-Essence-Viking.git
cd Sacred-Essence-Viking
pip install -r requirements.txtpython main.py encode \
--topic "project" \
--title "Retry architecture" \
--content "We chose queue-first retries to reduce partial failure risk."python main.py list
python main.py list --topic projectpython main.py search "retry queue" -n 5python main.py project --topic project --id abc12345python main.py gcpython main.py gc --executepython main.py qmd sync
python main.py qmd audit
python main.py qmd query "memory decay"
python main.py qmd constrained-search "retry" --nodes id1 id2 id3Because it has:
- memory states
- decay
- projection
- retrieval workflow
- distillation before deletion
Because the memory itself remains:
- readable
- structured
- portable
- inspectable by humans
Because it does more than retrieve chunks. It manages memory quality over time.
That is the real point of the system.
Think of the full memory stack like this:
-
Raw notes / daily logs
Capture events, fragments, and rough session residue. -
Handoff layer
Track active tasks, blocked work, and what must resume next. -
Sacred Essence memory layer
Store durable Markdown memory with L0 / L1 / L2 structure. -
QMD / local retrieval layer
Provide indexing, semantic retrieval, constrained search, and fallback lookup. -
Lifecycle and governance layer
Decide what remains active, what decays, and what gets distilled into SOIL.
Within that stack, Sacred Essence is the durable memory core. It is stronger than a simple notes folder, and broader than a pure search feature.
The public version avoids machine-specific hard-coded paths.
You can override paths with environment variables:
SACRED_ESSENCE_MEMORY_DIRSACRED_ESSENCE_TOPICS_DIRQMD_BIN
If unset, the project falls back to local defaults where possible.
This public repository includes the portable architecture and public-safe code shape.
It intentionally excludes things like:
- private runtime memory contents
- machine-specific deployment details
- secrets and credentials
- private scheduler / automation state
- internal team-specific operational context
Sacred Essence is for people who want agent memory to be:
- long-term
- human-readable
- searchable
- layered
- decay-aware
- capable of graceful forgetting
If you want a system that turns raw events into durable memory instead of just piling up more text, that is what Sacred Essence is for.