Memory management

From hvkshetry/StewardOS · View interactive version

Memory management is an AI agent skill from the GitHub repository hvkshetry/StewardOS. Two-tier memory system that makes Codex CLI a true household collaborator. Decodes shorthand, acronyms, nicknames, and internal language so Codex understands requests like a family office staff member would. AGENTS.md for working memory, memory/ directory for the full knowledge base.

How to use this skill

Skill file

Memory Management

Memory makes Codex your household collaborator - someone who speaks your family's internal language.

The Goal

Transform shorthand into understanding:

User: "check on the reno permits for maple"
              ↓ Codex decodes
"Check on building permits for the Maple Street property renovation
 (123 Maple St, contractor: Davis & Sons, target completion Q3)"

Without memory, that request is meaningless. With memory, Codex knows:

Architecture

AGENTS.md          ← Hot cache (~30 people/entities, common terms)
memory/
  glossary.md      ← Full decoder ring (everything)
  people/          ← Complete profiles
  projects/        ← Project details
  context/         ← Household, services, tools

AGENTS.md (Hot Cache):

memory/glossary.md (Full Glossary):

memory/people/, projects/, context/:

Lookup Flow

User: "ask nita about the enrollment for greenwood"

1. Check AGENTS.md (hot cache)
   → Nita? ✓ Nita Patel, education consultant
   → enrollment? ✓ School enrollment process
   → Greenwood? ✓ Greenwood Academy application

2. If not found → search memory/glossary.md
   → Full glossary has everyone/everything

3. If still not found → ask user
   → "What does X mean? I'll remember it."

This tiered approach keeps AGENTS.md lean (~100 lines) while supporting unlimited scale in memory/.

File Locations

Memory Format Templates

Use tables for compactness in AGENTS.md. Target ~50-80 lines for the hot cache.

For full templates with examples for each file type (AGENTS.md, glossary.md, people profiles, project profiles, household context), see references/templates.md.

Key file structure:

How to Interact

Decoding User Input (Tiered Lookup)

Always decode shorthand before acting on requests:

1. AGENTS.md (hot cache)     → Check first, covers 90% of cases
2. memory/glossary.md        → Full glossary if not in hot cache
3. memory/people/, projects/ → Rich detail when needed
4. Ask user                  → Unknown term? Learn it.

Example:

User: "ask jim about the trust amendment for maple"

AGENTS.md lookup:
  "jim" → Jim Davis, estate attorney ✓
  "trust amendment" → (not in hot cache)
  "maple" → Maple Street property ✓

memory/glossary.md lookup:
  "trust amendment" → property trust restructuring doc ✓

Now Codex can act with full context.

Adding Memory

When user says "remember this" or "X means Y":

  1. Glossary items (acronyms, terms, shorthand):
  1. People:
  1. Projects:
  1. Preferences: Add to AGENTS.md Preferences section

Recalling Memory

When user asks "who is X" or "what does X mean":

  1. Check AGENTS.md first
  2. Check memory/ for full detail
  3. If not found: "I don't know what X means yet. Can you tell me?"

Progressive Disclosure

  1. Load AGENTS.md for quick parsing of any request
  2. Dive into memory/ when you need full context for execution
  3. Example: drafting an email to jim about the trust amendment

Conventions

What Goes Where

| Type | AGENTS.md (Hot Cache) | memory/ (Full Storage) |

|------|----------------------|------------------------|

| Person | Top ~30 frequent contacts | glossary.md + people/{name}.md |

| Acronym/term | ~30 most common | glossary.md (complete list) |

| Project | Active projects only | glossary.md + projects/{name}.md |

| Nickname | In Key People if top 30 | glossary.md (all nicknames) |

| Household context | Quick reference only | context/household.md |

| Preferences | All preferences | - |

| Historical/stale | ✗ Remove | ✓ Keep in memory/ |

Promotion / Demotion

Promote to AGENTS.md when:

Demote to memory/ only when:

This keeps AGENTS.md fresh and relevant.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.