Tutorial 2 of 729% complete
All tutorials
8 minBeginner

Fluent AI Memory

How automatic context loading works

Fluent AI Memory: How Continuity Makes AI Remember Automatically

Duration: 8 minutes | Difficulty: Beginner | Version: 2.3+

The Problem This Solves

You've logged 50 decisions. But every new AI session, you have to:

  1. Manually call get_quick_context
  2. Hope the AI reads your instruction files
  3. Remind it about past decisions

Fluent AI Memory fixes this. Context loads automatically. No manual steps.

How It Works

Continuity v2.3 implements a 5-phase system to make AI memory "just work":

┌─────────────────────────────────────────────────────────────┐
│                    FLUENT AI MEMORY                          │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  Phase 1: Instruction Files                                  │
│  ├── CLAUDE.md, .cursorrules, copilot-instructions.md       │
│  └── Auto-generated on startup with decision summary         │
│                                                              │
│  Phase 2: Decision Detection                                 │
│  └── Middleware detects patterns → queues reminders          │
│                                                              │
│  Phase 3: First-Call Injection                               │
│  └── First MCP response includes context banner              │
│                                                              │
│  Phase 4: Pattern-Based Reminders                            │
│  └── "You're adding a dependency. Log a decision?"           │
│                                                              │
│  Phase 5: MANDATORY FIRST ACTION                             │
│  └── Instruction files tell AI to call get_quick_context     │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Phase 1: Auto-Generated Instruction Files

When you open a workspace, Continuity creates/updates:

FilePurpose
CLAUDE.mdInstructions for Claude Code
.cursorrulesInstructions for Cursor
.github/copilot-instructions.mdInstructions for GitHub Copilot

These files contain:

markdown
# Project Memory (Auto-generated by Continuity)

## MANDATORY FIRST ACTION

**Before ANY code suggestion or architectural discussion, run:**
@continuity get_quick_context

## Recent Architectural Decisions

1. **decision-123** (Jan 10) - Why PostgreSQL over MongoDB?
2. **decision-124** (Jan 9) - Why TypeScript strict mode?
3. **decision-125** (Jan 8) - Why monorepo structure?
...

## Known Topics
database, architecture, testing, deployment, security

Result: AI reads these files and knows about your project before you ask anything.

Phase 2: Decision Detection Middleware

When you're chatting with AI and say something like:

"Let's use Redis for caching because we need sorted sets"

Continuity's DecisionDetectorMiddleware recognizes this as a decision pattern:

  • dependency-addition - Adding a new package
  • configuration-change - Modifying settings
  • architecture-choice - Choosing between options
  • technology-selection - Picking a tool
  • research-based - Decision after investigation

It queues a reminder for the next tool response.

Phase 3: First-Call Context Injection

The very first MCP tool call in your session gets a context banner prepended:

═══════════════════════════════════════════════════════════
📚 CONTINUITY CONTEXT LOADED
═══════════════════════════════════════════════════════════

Project: my-awesome-app
Total Decisions: 127
Session Goals: Implement user authentication

Recent Decisions:
• decision-127: Why JWT over sessions? (Jan 10)
• decision-126: Why bcrypt for password hashing? (Jan 9)
• decision-125: Why PostgreSQL for user data? (Jan 8)

Known Topics: auth, security, database, api

TIP: Use @continuity search_decisions to find related context
═══════════════════════════════════════════════════════════

[Actual tool response follows...]

Result: AI has context immediately, without you doing anything.

Phase 4: Pattern-Based Reminders

When DecisionDetectorMiddleware detects a decision pattern, it injects a reminder:

═══════════════════════════════════════════════════════════
💡 CONTINUITY REMINDER (priority: high)
═══════════════════════════════════════════════════════════

You're adding a new dependency.

Consider logging this decision:
@continuity log_decision
question="Why add [package-name]?"
answer="[your reasoning]"
tags=["dependency", "tooling"]

This helps future-you (and AI) remember why.
═══════════════════════════════════════════════════════════

Reminders have:

  • Priority levels (high, medium, low)
  • 5-minute TTL (don't nag forever)
  • One-time delivery (consumed after showing)

Phase 5: MANDATORY FIRST ACTION

The instruction files include this section:

markdown
## MANDATORY FIRST ACTION

**Before ANY code suggestion or architectural discussion, run:**

@continuity get_quick_context

This loads the project's decision history. Skipping this = repeating past mistakes.

Well-behaved AI assistants read instruction files on startup, so they'll call get_quick_context automatically.

Real-World Example

Here's what happens when you start a new Claude Code session:

1. Claude reads CLAUDE.md

output
I see this project uses Continuity for memory. Let me load context first.

2. Claude calls get_quick_context

output
@continuity get_quick_context

Result: 127 decisions, recent work on authentication,
known topics: auth, security, database

3. Claude references past decisions

output
You: "Should we add OAuth?"

Claude: "Based on decision-127, you chose JWT for stateless auth.
Adding OAuth would be complementary - JWT for API, OAuth for
social login. This aligns with your security-first approach
from decision-126.

Shall I log this decision to add OAuth?"

Checking Fluent Memory Status

See if context is loading

output
@continuity get_compliance_metrics

Returns:

json
{
  "toolCallsTracked": 45,
  "decisionsLogged": 3,
  "patternsDetected": 7,
  "messagesInjected": 5,
  "complianceRate": 0.71
}

See pattern detection queue

output
@continuity get_mcp_logs lines=20

Shows middleware activity including pattern detection.

Customizing Fluent Memory

Disable auto-injection (VS Code settings)

json
{
  "continuity.autoInject": false
}

Adjust pattern detection sensitivity

json
// .continuity/config.json
{
  "mcpMiddleware": {
    "decisionDetection": {
      "enabled": true,
      "confidenceThreshold": 0.6
    }
  }
}

Regenerate instruction files

output
Cmd+Shift+P → "Continuity: Regenerate Instruction Files"

What Makes This Different

Before Fluent MemoryWith Fluent Memory
Manually call get_quick_contextContext loads automatically
Hope AI reads instruction filesInstruction files auto-generated
No reminders when making decisionsPattern-based nudges to log
Context forgotten between sessionsFirst-call injection restores memory
AI contradicts past decisionsAI references decision IDs

Troubleshooting

Context not loading?

  1. Check instruction files exist: CLAUDE.md, .cursorrules
  2. Ensure MCP is configured: Continuity: Setup MCP
  3. Restart your AI tool completely

Reminders not appearing?

  1. Check pattern detection is enabled in config
  2. Increase MCP log verbosity to see middleware activity
  3. Patterns need specific triggers (adding deps, changing config)

AI not referencing decisions?

  1. Verify decisions exist: @continuity get_quick_context
  2. Search for relevant decisions: @continuity search_decisions
  3. Some AI tools may not read instruction files reliably

Key Takeaways

  1. Fluent Memory = Automatic context loading
  2. 5 phases work together for seamless experience
  3. Instruction files are auto-generated with your decisions
  4. First-call injection gives AI context immediately
  5. Pattern detection reminds you to log decisions
  6. No manual steps required for context to flow

Validated Results

We built Continuity using Continuity. With 800+ decisions:

  • 96% test pass rate for Fluent Memory features
  • AI references decision IDs accurately
  • Session notes persist across days/weeks
  • Pattern detection catches ~70% of decision-worthy moments

This isn't theoretical - it's battle-tested.

← Quick Start | Decision Logging Best Practices →