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

# How Memory Works

> Understand ZeroTwo's memory system and how it helps maintain context across conversations

ZeroTwo's Memory system automatically learns from your conversations and retains important information across sessions. Unlike conversation history (which is limited to individual chats), Memory provides persistent context that enhances all your interactions with the AI.

## What is Memory?

Memory is ZeroTwo's intelligent context retention system that stores and recalls relevant information about you, your projects, preferences, and previous conversations. It helps the AI provide more personalized and contextually aware responses without requiring you to repeat information.

<Info>
  Think of Memory as the AI's long-term knowledge about you and your work—like how a human colleague remembers your preferences, projects, and past discussions.
</Info>

## How Memory works

Memory operates through several interconnected systems:

<Steps>
  <Step title="Automatic extraction">
    As you interact with ZeroTwo, the Memory system identifies and extracts important information from your conversations—preferences, facts about your projects, decisions you've made, and contextual details.
  </Step>

  <Step title="Intelligent storage">
    Extracted information is stored in structured memory stores, categorized by type (biographical facts, project details, technical preferences, etc.) and associated with relevant context.
  </Step>

  <Step title="Contextual recall">
    When you start a new conversation, Memory automatically retrieves relevant information based on your current query, ensuring the AI has appropriate context without cluttering the conversation.
  </Step>

  <Step title="Continuous learning">
    Memory updates as you provide new information, correct previous details, or as your projects and preferences evolve.
  </Step>
</Steps>

<Tip>
  Memory works seamlessly in the background. You don't need to explicitly "save" information—the system learns naturally from your conversations.
</Tip>

## Types of memory

ZeroTwo maintains different categories of memory for optimal context management:

### Biographical memory

Personal information and preferences about you:

<AccordionGroup>
  <Accordion title="Professional background">
    * Your role and expertise level
    * Technologies and tools you use
    * Programming languages you prefer
    * Years of experience in different areas

    ```text theme={null}
    Example memories:
    - "Senior full-stack developer with 8 years experience"
    - "Prefers TypeScript over JavaScript"
    - "Uses React, Node.js, and PostgreSQL primarily"
    ```
  </Accordion>

  <Accordion title="Work context">
    * Company or organization details
    * Team size and structure
    * Current responsibilities
    * Industry or domain focus

    ```text theme={null}
    Example memories:
    - "Works at a fintech startup"
    - "Team of 5 developers"
    - "Building a payment processing platform"
    ```
  </Accordion>

  <Accordion title="Communication preferences">
    * Desired response style
    * Level of detail preferred
    * Technical depth expectations
    * Code comment preferences

    ```text theme={null}
    Example memories:
    - "Prefers concise explanations with code examples"
    - "Likes detailed inline comments"
    - "Wants security considerations highlighted"
    ```
  </Accordion>
</AccordionGroup>

### Project memory

Information about your active projects:

<ResponseField name="Project details" type="object">
  Names, descriptions, and contexts of projects you're working on.

  ```text theme={null}
  Example:
  - Project: "TaskFlow Pro"
  - Description: "SaaS project management tool"
  - Tech stack: "Next.js, TypeScript, Supabase"
  - Stage: "MVP development"
  ```
</ResponseField>

<ResponseField name="Technical decisions" type="array">
  Architecture choices, design patterns, and technology selections you've made.

  ```text theme={null}
  Example:
  - "Using Zustand for state management instead of Redux"
  - "Chose PostgreSQL for relational data with jsonb for flexibility"
  - "Implementing authentication with NextAuth.js"
  ```
</ResponseField>

<ResponseField name="Current challenges" type="array">
  Problems you're working through and their context.

  ```text theme={null}
  Example:
  - "Optimizing real-time collaboration performance"
  - "Implementing offline-first architecture"
  - "Debugging race condition in WebSocket handlers"
  ```
</ResponseField>

### Conversation memory

Context from previous interactions:

<Expandable title="Conversation context details">
  <ResponseField name="Previous discussions" type="array">
    Topics you've covered and conclusions reached in past conversations.
  </ResponseField>

  <ResponseField name="Code reviews" type="array">
    Feedback provided on your code and patterns identified.
  </ResponseField>

  <ResponseField name="Solutions implemented" type="array">
    Approaches you've chosen and their outcomes.
  </ResponseField>

  <ResponseField name="Recurring patterns" type="array">
    Common questions or tasks you frequently need help with.
  </ResponseField>
</Expandable>

### Technical preferences

Your coding style and technical preferences:

```json theme={null}
{
  "language_preferences": {
    "primary": "TypeScript",
    "secondary": ["Python", "Go"]
  },
  "code_style": {
    "pattern": "functional programming",
    "naming": "camelCase for variables, PascalCase for components",
    "comments": "detailed for complex logic"
  },
  "frameworks": {
    "frontend": "React with Next.js",
    "backend": "Node.js with Express",
    "database": "PostgreSQL with Prisma ORM"
  },
  "testing": {
    "unit": "Jest",
    "integration": "Playwright",
    "preference": "test critical paths, not trivial code"
  }
}
```

## When Memory is used

Memory automatically activates in relevant situations:

<Tabs>
  <Tab title="New conversations">
    When you start a new chat, Memory provides context:

    ```text theme={null}
    You: "Help me add authentication to the app"

    Memory recalls:
    - Your app is "TaskFlow Pro" built with Next.js
    - You previously chose NextAuth.js
    - You use PostgreSQL with Prisma
    - You prefer TypeScript

    AI response incorporates this context without you repeating it.
    ```
  </Tab>

  <Tab title="Technical questions">
    ```text theme={null}
    You: "What's the best way to handle this API error?"

    Memory recalls:
    - Your error handling patterns
    - Your backend framework (Express)
    - Your logging preferences
    - Similar issues you've solved before

    AI provides answers aligned with your established patterns.
    ```
  </Tab>

  <Tab title="Code generation">
    ```text theme={null}
    You: "Generate a database model for user profiles"

    Memory recalls:
    - You use Prisma ORM
    - You prefer TypeScript
    - Your database is PostgreSQL
    - Your naming conventions

    AI generates code matching your stack and style.
    ```
  </Tab>

  <Tab title="Project context">
    ```text theme={null}
    You: "How should I structure the components?"

    Memory recalls:
    - Your project structure preferences
    - Your component organization patterns
    - Your file naming conventions
    - Your React patterns (hooks, functional components)

    AI suggests structure consistent with your approach.
    ```
  </Tab>
</Tabs>

## Memory and privacy

<Warning>
  **Privacy and control:**

  * Memory is stored securely and associated with your account only
  * Memory is not shared between users or across organizations
  * You have full control to view, edit, and delete any memories
  * You can disable Memory entirely if you prefer
  * Memory data is not used to train AI models
</Warning>

### What Memory doesn't store

Memory focuses on professionally relevant context:

* ❌ Sensitive personal information (passwords, API keys, secrets)
* ❌ Private conversations you mark as private
* ❌ Financial or health information
* ❌ Data you explicitly ask not to remember
* ❌ Temporary or example data

<Info>
  ZeroTwo uses secure storage and encryption for Memory data. See [Data and Compliance](/privacy/data-and-compliance) for complete privacy information.
</Info>

## Memory vs. conversation history

Understanding the difference helps you use both effectively:

<CardGroup cols={2}>
  <Card title="Conversation History" icon="comments">
    **Scope**: Single conversation thread

    **Duration**: Exists only within one chat

    **Purpose**: Maintain immediate context

    **Limitation**: Forgotten when chat ends or exceeds token limit

    **Best for**: Iterating on current tasks
  </Card>

  <Card title="Memory" icon="database">
    **Scope**: All conversations

    **Duration**: Persistent across sessions

    **Purpose**: Long-term context retention

    **Limitation**: Stores key facts, not entire conversations

    **Best for**: Personalization and consistency
  </Card>
</CardGroup>

### Using both together

<Steps>
  <Step title="Conversation provides immediate context">
    Your current chat maintains detailed, turn-by-turn context for the active task.
  </Step>

  <Step title="Memory provides background context">
    Memory informs the conversation with relevant background about you and your projects.
  </Step>

  <Step title="Memory learns from conversations">
    Important information from conversations gets extracted into Memory for future use.
  </Step>

  <Step title="Conversations reference Memory">
    New conversations automatically benefit from previously established context.
  </Step>
</Steps>

## Memory accuracy and updates

Memory evolves as your context changes:

### Automatic updates

```text theme={null}
Scenario 1 - Initial learning:
You: "I'm building a todo app with React"
Memory stores: "Building todo app with React"

Scenario 2 - Correction:
You: "Actually, I switched to using Vue instead of React"
Memory updates: "Building todo app with Vue"

Scenario 3 - Addition:
You: "I'm using Supabase for the backend"
Memory adds: "Using Supabase for backend"
```

### Explicit corrections

You can explicitly correct Memory:

```text theme={null}
"Remember that I prefer async/await over promises"
"Update my profile: I'm now a senior engineer"
"Forget about the old authentication system—we migrated to Auth0"
```

<Tip>
  If the AI seems to have outdated context, explicitly mention the change. Memory will update automatically.
</Tip>

## Memory and assistants

[Assistants](/assistants/overview) work in conjunction with Memory:

* **Memory** provides user-level context (who you are, your preferences)
* **Assistants** provide task-specific behaviors (how to respond for specific use cases)
* Together they create highly personalized, contextually appropriate interactions

```text theme={null}
Example with Code Review Assistant:
- Memory knows: Your tech stack, coding style, past patterns
- Assistant provides: Code review expertise and structured feedback
- Result: Code reviews tailored to your stack and style preferences
```

## Limitations and considerations

<AccordionGroup>
  <Accordion title="Token efficiency">
    Memory retrieval consumes tokens from your context window. The system intelligently selects only relevant memories for each conversation.
  </Accordion>

  <Accordion title="Relevance filtering">
    Not all memories apply to every conversation. The system determines which memories are contextually relevant.
  </Accordion>

  <Accordion title="Update lag">
    Very recent information (from the current session) may not yet be in Memory—it's still in conversation history.
  </Accordion>

  <Accordion title="Memory capacity">
    While extensive, Memory focuses on key information rather than storing every detail of every conversation.
  </Accordion>
</AccordionGroup>

## Best practices for using Memory

<Steps>
  <Step title="Be explicit about preferences">
    When you have strong preferences, state them clearly so Memory captures them.

    ```text theme={null}
    "I always want TypeScript types in code examples"
    "I prefer functional components over class components"
    "Always include error handling in implementations"
    ```
  </Step>

  <Step title="Provide project context early">
    When starting work on a new project, provide context upfront.

    ```text theme={null}
    "I'm starting a new project: an e-commerce platform using 
    Next.js, Stripe, and PostgreSQL. Target launch in 3 months."
    ```
  </Step>

  <Step title="Correct outdated information">
    When your context changes, update it explicitly.

    ```text theme={null}
    "We switched from AWS to Vercel for deployment"
    "I moved from using Redux to Zustand for state management"
    ```
  </Step>

  <Step title="Leverage Memory across conversations">
    Don't repeat context—Memory should handle it automatically.

    ```text theme={null}
    Instead of: "In my Next.js app that uses Supabase..."
    Just say: "In my app..."
    Memory provides the context.
    ```
  </Step>
</Steps>

## Memory for teams

In [team workspaces](/projects/create-project), Memory behavior depends on settings:

<Info>
  **Team Memory (if enabled):**

  * Shared context about team projects
  * Team-wide technical decisions
  * Shared code patterns and preferences

  **Individual Memory:**

  * Your personal preferences
  * Your role-specific context
  * Your communication style
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Manage Memory" icon="sliders" href="/memory/manage-reset-export">
    View, edit, and control your Memory data
  </Card>

  <Card title="Custom instructions" icon="cog" href="/prompts/custom-instructions-patterns">
    Complement Memory with persistent instructions
  </Card>

  <Card title="Create assistants" icon="robot" href="/assistants/create">
    Build specialized assistants with Memory context
  </Card>

  <Card title="Privacy and data" icon="shield" href="/privacy/data-and-compliance">
    Learn about data privacy and compliance
  </Card>
</CardGroup>
