Experienced LLMs uses an interday cognitive consolidation engine to distill atomic, intraday operational learnings into a high-density, authoritative EXPERIENCE.md document while maintaining an immutable SQLite ledger in ~/.experienced-llms/memory.db.
Consolidation runs either autonomously via a nightly daemon (Pathway A) or directly inside agent cognitive workflows (Pathway B):
[ Intraday Capture ]
│
▼
[ memory.db (SQLite) ]
- Active Facts
- Pending Intraday Facts
│
▼
[ Consolidation Engine ]
(InterdayConsolidator / LLM)
│
┌─────────┴─────────┐
▼ ▼
[ SQLite Ledger ] [ EXPERIENCE.md ]
- Superseded IDs - Clean, token-dense
- Consolidated IDs operational directives
- Audit log entry - Zero timestamps/comments
The consolidation prompt enforces four core heuristics to prevent prompt bloat and maintain factual integrity:
Intraday logs often capture similar lessons across multiple sessions or projects (e.g., repeated notes about test flags or package managers). The engine clusters semantically overlapping directives and condenses them into a single, sharp operational rule rather than appending redundant bullet points.
As projects evolve, newer directives may invalidate earlier decisions (e.g., switching from npm to pnpm, or revising a deployment flow). When the LLM detects a conflict, it preserves the newer directive in updated_experience_markdown and returns the superseded fact's ID in superseded_fact_ids. The engine automatically transitions those rows in SQLite from active to superseded.
By default, the engine maintains 5 canonical sections in fixed order:
# Master AI Experience
## 1. User Directives & Preferences
## 2. Defensive Safeguards & Heuristics
## 3. Project-Specific Constraints
## 4. Anti-Patterns & Critical Gotchas
## 5. Mistake Corrections & FixesMaintaining standard headers ensures that downstream agents and IDE prompt injectors can reliably extract specific subsections.
Agent context windows are finite and expensive.
- Output is constrained to
{max_words}(default1200words, configurable via~/.experienced-llms/config.jsonor--max-words <n>). - Strict token hygiene: zero HTML comments (
<!-- ... -->), zero generation timestamps, and zero conversational fluff.
When the LLM runs consolidation (either via CLI or agent skill), it produces a structured JSON response:
{
"updated_experience_markdown": "# Master AI Experience\n\n## 1. User Directives & Preferences\n...",
"processed_pending_ids": [101, 102, 103],
"superseded_fact_ids": [45, 78],
"summary_of_changes": "Merged WSL npm execution rules, superseded legacy direct-node guidance."
}| Field | Type | Description |
|---|---|---|
updated_experience_markdown |
string |
The complete, standalone markdown content written directly to ~/.experienced-llms/EXPERIENCE.md. |
processed_pending_ids |
array[int] |
List of pending fact IDs that were integrated into the markdown. These are marked is_consolidated = 1. |
superseded_fact_ids |
array[int] |
List of previously active fact IDs rendered obsolete by new learnings. These are marked status = 'superseded'. |
summary_of_changes |
string |
1–2 sentence human-readable summary recorded in the consolidations audit table. |
Users can customize or completely replace the consolidation instructions to suit specialized environments (e.g., enterprise compliance, game development, microservice architectures).
- CLI Flag (
--template <path>): Explicit path passed toexperienced-llms consolidate. - User Home File (
~/.experienced-llms/consolidation_prompt.txt): Custom prompt persisted for all automated/scheduled runs. - Default Built-in Template: Defined in
src/consolidator/prompt_template.py.
Your custom template can include the following placeholder:
{max_words}: Substituted dynamically with the active maximum word ceiling (e.g.,1200).
Create ~/.experienced-llms/consolidation_prompt.txt:
You are the consolidation engine for our Mobile Development team.
Synthesize new learnings and update EXPERIENCE.md under {max_words} words.
SECTIONS:
# Master AI Experience
## 1. Flutter & Dart Best Practices
## 2. Platform Channels & Native Interop
## 3. CI/CD & Fastlane Rules
## 4. Performance & Memory Safeguards
RULES:
- Resolve any conflicting architectural patterns by favoring newer rules.
- Return older superseded rule IDs in 'superseded_fact_ids'.
- Return all integrated pending IDs in 'processed_pending_ids'.
YOU MUST RETURN JSON:
{
"updated_experience_markdown": "# Master AI Experience\\n...",
"processed_pending_ids": [],
"superseded_fact_ids": [],
"summary_of_changes": "..."
}
Preview the prompt payload without calling an LLM:
experienced-llms consolidate --template ./my-template.txt --prepareRun a consolidation using the custom template:
experienced-llms consolidate --template ./my-template.txt --llm "ollama run mistral"