memory-consolidate

star 1

Nightly consolidation of working memory, Core Memory reconciliation, and Deep Truths lifecycle management. Runs at 2am CT (08:00 UTC) via the responsibility scheduler.

Tachin-ai-Corporation By Tachin-ai-Corporation schedule Updated 6/14/2026

Skill: Memory Consolidation

When to Use

Automatically triggered by nightly cron. Do not invoke manually. Performs nightly consolidation of working memory, Core Memory reconciliation, and Deep Truths lifecycle management.

Commands

No executable commands are governed directly by this skill (handled via daemon cron).

Procedures

This is the agent's "sleep cycle" — processing the day's experiences across all three memory layers.

Nightly Consolidation Playbook

  1. Gather Working Memory: Read /opt/corekit/workspace/MEMORY.md to see recent focus and open items.
  2. Retrieve Recent Conversations: Run session-summary --hours 24 --limit 20 to extract user interactions.
  3. Scan Recent Work Ledger: The brain daemon queries the agent's completed work envelopes from the last 7 days (via the same episodic retrieval used for recall). Use these to identify facts worth promoting — completed missions carry verified outcomes.
  4. Scan Recent Core Memory: Run core-memory-read --since 30d --limit 20 to scan recent long-term writes.
  5. Scan Full Category Archives: Run core-memory-read --category <cat> for categories: architecture, operations, iam, decisions, patterns, errors.
  6. Triage Working Memory: Classify every entry in MEMORY.md into one of: ACTIVE, COMPLETED, STALE, or PROMOTE.
  7. Identify Outdated Core Memories: Compare recent work against the long-term archive to locate contradicted, redundant, or stale entries.
  8. Retire or Supersede: Run core-memory-retire --id <entry-id> --reason "<reason>" for stale items, or core-memory-write --fact "<fact>" --category <cat> --supersedes <old-id> for updates. (Max 5 per run).
  9. Promote Stable Facts: Run core-memory-write --fact "<fact>" --category <cat> for promoted items. (Max 5 per run).
  10. Prune and Rewrite Working Memory: Overwrite /opt/corekit/workspace/MEMORY.md with only active items, using the template format (must be under 2,000 characters).
  11. Review and Update Deep Truths: Run update-deep-truths --list and modify if needed using --add or --remove. (Max 2 changes per run).
  12. Generate Report: Output a structured summary showing counts of triaged, retired, and promoted items.

Architectural Details

Three-Layer Memory Architecture

The work ledger (primes/{id}/work/) serves as an episodic recall source — a retrieval mechanism over the system's own audit trail (B-23). It is not a fourth consolidated memory layer; facts from work history are promoted into Core Memory through the normal triage process (B-5 preserved).

Layer Storage When Loaded Lifespan Your Job
Working Memory (MEMORY.md) Local file Every Cortex call (system prompt) Hours–days Prune completed/stale items, keep < 2,000 chars
Core Memory (Firestore) core_memory collection On-demand via recall Weeks–months Retire stale entries, promote stable new facts
Deep Truths (SOUL.md § Deep Truths) Local file Every Cortex call (system prompt) Months–permanent Change only with strong multi-session evidence

Phase 5 MEMORY.md Template

# MEMORY (<Specialty>)

## Current Focus
- What the agent is actively working on

## Active Context
- Operational state, environment notes, pending items

## Open Items
- Unresolved blockers or follow-ups

Deep Truths Review Criteria

  • When to Add: Evidence spans 3+ separate sessions, stable in Core Memory for 7+ days, cite 2+ Core Memory IDs as evidence, universally applicable, single sentence, shapes behaviour.
  • When to Remove: Contradicted by newer evidence, environment/tooling has changed, or redundant with other truths.

Error Recovery

Error / Symptom Likely Cause Recovery
core-memory-write or core-memory-retire fails Firestore connection timeout or rate limit Retry the operation once. If it continues to fail, log the failure and defer the update to the next night's consolidation run.
Cannot write to MEMORY.md File is locked or permission denied Wait 5 seconds and retry the write operation. If it fails again, log a warning and proceed with the remaining steps.
Deep truths limit exceeded (10) Attempting to add an 11th truth Run update-deep-truths --list, identify and remove a less critical or redundant truth first, then add the new one.
Install via CLI
npx skills add https://github.com/Tachin-ai-Corporation/architect-prime-gcp-agent --skill memory-consolidate
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator
Tachin-ai-Corporation
Tachin-ai-Corporation Explore all skills →