Skip to main content

Memory

Cody CLI has a built-in memory system that persists context, facts, and preferences across sessions.

How It Works

Memory is stored as markdown files in .cody/agent-memory/ (project) or ~/.cody/agent-memory/ (global). Cody reads and writes these files automatically during sessions.

Memory Commands

/memory          # open memory panel
/memory show # display all stored memories
/memory clear # clear all memories

You can also ask Cody directly:

  • "Remember that we use Postgres, not MySQL"
  • "Forget what you know about my API keys"

Memory Types

TypeLocationShared?
Project memory.cody/agent-memory/Yes — if committed
User memory~/.cody/agent-memory/No — across all projects
Local memory.cody/agent-memory-local/No — gitignored

ZeroDB Memory (Cloud)

When connected to ZeroDB via MCP, Cody can store and retrieve memories using semantic search — enabling recall across large memory sets that wouldn't fit in context.

cody mcp add zerodb-memory --transport http \
--url https://api.ainative.studio/v1/mcp/zerodb-mcp/messages

CODY.md

Place a CODY.md file at your project root to give Cody persistent instructions — coding standards, architecture notes, team conventions. Cody reads this file automatically at the start of every session.

# My Project

## Stack
- TypeScript, Next.js, Postgres
- Tests with bun:test

## Conventions
- Use camelCase for variables
- All API calls go through src/services/api/