← Back to Blog

6 Memory Types Your AI Agent Needs (And How to Use Each)

March 24, 2026 < 10 min read

Not all memories are created equal. When a user tells your AI agent "I'm a Python developer in Austin who has a meeting with Sarah at 3pm and prefers dark mode," that single sentence contains four completely different types of information — each with different storage needs, retrieval patterns, and expiration rules.

Most agent memory systems treat everything as flat text. Store it, embed it, retrieve by similarity. This works for simple use cases, but it falls apart at scale. A meeting time from last Tuesday shouldn't have the same retrieval weight as a core language preference. A relationship between two people shouldn't be stored the same way as a step-by-step workflow.

After working with hundreds of developers building AI agents, we've identified six distinct memory types that cover virtually every use case. Understanding them — and using the right type for the right information — is the difference between an agent that kinda remembers and one that truly understands.

The Six Memory Types

1 Facts

What: Objective, verifiable information about the world or the user.

Examples: "User is a Python developer." "Company was founded in 2019." "API rate limit is 100 RPM."

Characteristics: Stable over time. Can be verified. May need correction but rarely expire.

2 Preferences

What: Subjective choices, tastes, and configuration settings.

Examples: "Prefers dark mode." "Likes concise responses." "Wants code examples in TypeScript."

Characteristics: Change over time. Personal. Should be weighted by recency — latest preference wins.

3 Events

What: Time-bound occurrences — past, present, or future.

Examples: "Meeting with Sarah at 3pm Tuesday." "Deployed v2.1 on March 15." "Demo scheduled for next Friday."

Characteristics: Have timestamps. Expire naturally. Need temporal reasoning for retrieval.

4 Relationships

What: Connections between entities — people, projects, organizations.

Examples: "Sarah is the team lead." "Project Alpha uses the billing API." "Alex reports to Maria."

Characteristics: Graph-structured. Bidirectional. Enable inference ("Who else is on Sarah's team?").

5 Procedures

What: Step-by-step processes, workflows, and how-to knowledge.

Examples: "To deploy: push to main, wait for CI, then approve in staging." "Bug reports go to #bugs channel, then get triaged Monday."

Characteristics: Ordered steps. Often organization-specific. Should be retrieved as complete sequences, not fragments.

6 Emotional Context

What: Sentiment, frustration levels, excitement, and communication tone markers.

Examples: "User was frustrated about the deployment failure." "Excited about the new feature launch." "Prefers empathetic tone when discussing production issues."

Characteristics: Ephemeral — today's frustration doesn't mean permanent anger. Informs tone, not content.

Storing Each Type: Code Examples

Here's how to store each memory type using the 0Latency API, with type-specific metadata that optimizes retrieval.

Facts

# Python — Storing a fact
import requests

HEADERS = {"X-API-Key": your_api_key, "Content-Type": "application/json"}

requests.post("https://api.0latency.ai/memories/extract", headers=HEADERS, json={
    "agent_id": "assistant",
    "content": "User is a senior Python developer with 8 years of experience",
    "metadata": {
        "type": "fact",
        "confidence": 0.95,     # Explicitly stated by user
        "category": "professional",
        "entities": ["user", "Python"]
    }
})

Preferences

// JavaScript — Storing a preference
await fetch('https://api.0latency.ai/memories/extract', {
  method: 'POST',
  headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    agent_id: 'assistant',
    content: 'User prefers TypeScript over JavaScript for new projects',
    metadata: {
      type: 'preference',
      category: 'language',
      strength: 'strong',         // strong | mild | inferred
      supersedes: 'JavaScript'    // What this preference replaces
    }
  })
});

Events

# Python — Storing an event
requests.post("https://api.0latency.ai/memories/extract", headers=HEADERS, json={
    "agent_id": "assistant",
    "content": "Team standup meeting every Monday and Wednesday at 10am PST",
    "metadata": {
        "type": "event",
        "recurring": True,
        "schedule": "Mon,Wed 10:00 PST",
        "participants": ["user", "Sarah", "Alex"],
        "expires": None  # Recurring — no expiration
    }
})

Relationships

// JavaScript — Storing a relationship
await fetch('https://api.0latency.ai/memories/extract', {
  method: 'POST',
  headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    agent_id: 'assistant',
    content: 'Sarah is the engineering team lead and manages Alex and Jordan',
    metadata: {
      type: 'relationship',
      entities: ['Sarah', 'Alex', 'Jordan'],
      relationships: [
        { from: 'Sarah', to: 'Alex', relation: 'manages' },
        { from: 'Sarah', to: 'Jordan', relation: 'manages' },
        { from: 'Sarah', to: 'engineering', relation: 'leads' }
      ]
    }
  })
});

Procedures

# Python — Storing a procedure
requests.post("https://api.0latency.ai/memories/extract", headers=HEADERS, json={
    "agent_id": "assistant",
    "content": "Deployment process: 1) Push to main branch, 2) Wait for CI green, 3) Create release tag, 4) Approve staging deploy, 5) Run smoke tests, 6) Promote to production",
    "metadata": {
        "type": "procedure",
        "name": "production_deployment",
        "steps": 6,
        "category": "devops",
        "retrieve_as": "complete"  # Always return full sequence
    }
})

Emotional Context

// JavaScript — Storing emotional context
await fetch('https://api.0latency.ai/memories/extract', {
  method: 'POST',
  headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    agent_id: 'assistant',
    content: 'User expressed frustration about repeated CI failures on the billing service',
    metadata: {
      type: 'emotional',
      sentiment: 'frustrated',
      intensity: 0.7,           // 0-1 scale
      topic: 'CI/billing',
      decay: 'fast'             // Emotional context fades quickly
    }
  })
});

Retrieval Optimizations by Type

Storing with types is only half the benefit. The real power comes from type-aware retrieval:

# Python — Type-filtered recall
response = requests.post("https://api.0latency.ai/recall", headers=HEADERS, json={
    "query": "What does the user prefer for new projects?",
    "agent_id": "assistant",
    "filters": {
        "types": ["preference", "fact"],  # Only retrieve preferences and facts
        "recency_weight": 0.8             # Heavily weight recent memories
    }
})

for mem in response.json()["memories"]:
    print(f"[{mem['metadata']['type']}] {mem['content']} (score: {mem['score']:.2f})")

Why Typing Matters at Scale

With 100 memories, flat storage works fine. With 100,000, it becomes a problem. Here's why:

0Latency supports all six memory types natively. Our entity extraction engine can automatically classify memories by type when you don't specify one, and our retrieval system uses type-aware scoring to surface the most relevant memories for any query. See our pricing page for plan details — the Free tier includes 10,000 memories with full type support.

Getting Started

You don't need to implement all six types at once. Start with the most impactful ones for your use case:

  1. Customer support agents: Start with Facts + Preferences + Emotional Context.
  2. Coding assistants: Start with Facts + Preferences + Procedures.
  3. Personal assistants: Start with Events + Relationships + Preferences.
  4. Multi-agent systems: Start with Facts + Relationships + Procedures.

Add more types as your agent matures. The beauty of a typed memory system is that it grows with your application — each new type adds a dimension of understanding without disrupting what's already working.

Frequently Asked Questions

What are the different types of AI agent memory?

The six core memory types are: facts (objective information), preferences (subjective choices), events (time-bound occurrences), relationships (connections between entities), procedures (step-by-step processes), and emotional context (sentiment and tone). Each type has different storage, retrieval, and expiration characteristics.

How do I choose which memory types my agent needs?

Start with the types most relevant to your use case. Customer support agents benefit most from facts, preferences, and emotional context. Coding assistants need facts, preferences, and procedures. Personal assistants thrive with events, relationships, and preferences. Add more types as needs evolve.

Does 0Latency support typed memories?

Yes. 0Latency natively supports all six memory types with type-aware storage, retrieval, and expiration. You can specify types manually via metadata or let the automatic entity extraction engine classify memories for you. All plans, including the Free tier (10,000 memories), include full type support.

Can I mix typed and untyped memories?

Absolutely. 0Latency handles untyped memories seamlessly — they're stored and retrieved normally. Typed memories get additional benefits like type-filtered queries, automatic expiration rules, and optimized retrieval scoring. You can gradually add types to existing memories over time.

How does memory typing improve retrieval performance?

Type filtering reduces the search space by 60-80% for typical queries. Instead of searching all memories, the system only searches relevant types — preferences for preference queries, events for scheduling queries, etc. This reduces latency and improves relevance scoring.

Structured Memory for Smarter Agents

All six memory types, type-aware retrieval, and automatic classification — free to start.

Get your free API key →