Works with Factory App: These memory patterns work identically in both CLI and Factory App—just ensure your working directory is set to your repository root.
The Memory System Architecture
Your memory system consists of three layers:Setting Up Personal Memory
Personal memory follows you across all projects.Step 1: Create the Memory File
Create~/.factory/memories.md:
Step 2: Reference in AGENTS.md
Add to your~/.factory/AGENTS.md or project AGENTS.md:
Setting Up Project Memory
Project memory captures decisions and context specific to a codebase.Step 1: Create Project Memory
Create.factory/memories.md in your project root:
Step 2: Reference in Project AGENTS.md
Update your project’sAGENTS.md:
Memory Categories
Organize your memories into useful categories:Preferences (Personal)
What you like and how you work:Decisions (Project)
What was decided and why:Context (Project)
Background information:History (Both)
What happened when:Automatic Memory Capture
Create a hook that helps you capture memories as you work.The “Remember This” Hook
When you say “remember this:” followed by content, automatically append to memories. You can trigger memory capture with either special characters or phrases. Choose based on your preference:- # prefix trigger
- Phrase trigger
Trigger with
# at the start of your message for quick capture.Usage:- “#we use the repository pattern”
- “##I prefer early returns” (double
##for personal)
~/.factory/hooks/memory-capture.py:/hooks:
- “#we decided to use Zustand for state management”
- “##I prefer early returns” (double
##saves to personal)
- “Remember this: we decided to use Zustand for state management”
- “Note: the auth module uses JWT with 24-hour expiration”
Alternative: Memory Capture Skill
Instead of a hook, you can use a skill that Droid invokes when you ask to remember something. This gives you more interactive control over categorization. See the memory-capture skill example for a ready-to-use implementation.Alternative: Custom Slash Command
For quick manual capture, create a custom slash command: Create~/.factory/commands/remember.md:
/remember we chose PostgreSQL for better ACID compliance to capture memories on demand.
Which approach to choose?
- Hook — Best for automatic capture without extra steps
- Skill — Best when you want Droid to help categorize and format
- Slash Command — Best for quick manual capture with consistent formatting
Memory Maintenance
Keep your memories useful with regular maintenance.Monthly Review Checklist
Archiving Old Memories
When memories become stale, move them to an archive:Advanced: Memory-Aware Skills
Create skills that leverage your memory files:Quick Reference
File Locations
| Memory Type | Location | Scope |
|---|---|---|
| Personal preferences | ~/.factory/memories.md | All projects |
| Project decisions | .factory/memories.md | This project |
| Team conventions | .factory/rules/*.md | This project |
When to Add Memories
| Event | What to Record | Where |
|---|---|---|
| Made an architecture decision | Decision + reasoning | Project |
| Discovered a preference | What you prefer | Personal |
| Learned domain knowledge | Business rules, entities | Project |
| Changed your workflow | New tool or pattern | Personal |
| Resolved a tricky issue | Solution and context | Project |
