> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agents-squads.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Memory

> Give your agents persistent context across sessions

## Why Memory?

Without memory, every session starts fresh. Your agents forget everything.

With memory:

* **Continuity** — Pick up where you left off
* **Learning** — Build on previous work
* **Coordination** — Share context between agents

## Memory Structure

```
.agents/memory/
├── research/              # Squad memory
│   ├── goals.md           # Measurable targets
│   ├── feedback.md        # Last cycle's evaluation
│   └── analyst/
│       └── state.md       # Agent memory
└── company/
    └── strategy.md        # Company-wide "why" — read by every squad
```

See [Memory](https://docs.agents-squads.com/concepts/memory.md) for how these layers cascade into an agent's
context, in priority order, on every run.

## Querying Memory

```bash theme={null}
# Search across all memory
squads memory query "competitor analysis"

# Read a specific squad's memory
squads memory read research

# List all entries
squads memory list
```

## Memory in Action

When an agent runs:

```
1. Load    → Retrieve relevant memory
2. Inject  → Add to agent context
3. Execute → Agent works with full context
4. Update  → Store new learnings
```

## Writing Good Memory

Memory files are markdown. Keep them structured:

```markdown theme={null}
<!-- .agents/memory/research/analyst/state.md -->

# Research Analyst Memory

## Current Focus
Q1 2025 market analysis for enterprise AI agents.

## Recent Work
- Completed competitive analysis (Jan 15)
- Identified 3 new market entrants
- Pricing research in progress

## Key Findings
- Market growing 15% YoY
- Main competitor raised Series B
- Enterprise buyers want transparency

## Blockers
- Need access to Gartner reports
- Waiting on customer interview data

## Next Steps
- Deep dive on pricing strategies
- Interview customer segment
```

## Memory Types

### Agent Memory

Private to each agent:

* Task history
* Learned preferences
* Work in progress

### Squad Memory

Shared across agents in a squad:

* Domain knowledge
* Coordination state
* Team decisions

## Best Practices

> [accordion] Update memory after work
>
> Run `squads memory write <squad> "<learning>"` after significant work.

> [accordion] Keep it current
>
> Stale memory is worse than no memory. Prune outdated info.

> [accordion] Structure consistently
>
> Use the same sections across agents for predictability.

> [accordion] Focus on context, not logs
>
> Memory isn't a log file. Store insights, not events.

## Next Steps

> [card] [CLI Reference](https://docs.agents-squads.com/cli-reference.md)
>
> All memory commands

> [card] [Core Concepts](https://docs.agents-squads.com/concepts/memory.md)
>
> Deep dive on memory


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.