Skip to main content
Extract and save structured learnings from text output. This tool automatically detects and saves learning sections from your output.

Overview

mem_capture_passive looks for sections like ## Key Learnings: or ## Aprendizajes Clave: in text output and extracts numbered or bulleted items. Each item is saved as a separate observation with type passive. This is useful for:
  • Automatically capturing knowledge at the end of tasks
  • Extracting learnings from agent responses
  • Building a knowledge base from subagent completions
  • Saving discoveries without manual mem_save calls

Parameters

content
string
required
The text output containing a learnings section. Must include a heading like ## Key Learnings: followed by numbered or bulleted items.
session_id
string
Session ID to associate the learnings with. Defaults to manual-save-{project}.
project
string
Project name to scope the learnings. Defaults to the current directory name.
source
string
Source identifier for tracking where learnings came from (e.g., subagent-stop, session-end, manual).

Response

saved
number
Number of new learnings saved
skipped
number
Number of duplicate learnings skipped (already exist in memory)
total
number
Total number of learnings found in the input

Expected Format

The tool recognizes two heading formats: English:
## Key Learnings:

1. First learning item
2. Second learning item
Spanish:
## Aprendizajes Clave:

1. Primer aprendizaje
2. Segundo aprendizaje
You can also use bulleted lists:
## Key Learnings:

- Learning with bullet points
- Another learning

Example Usage

Basic Usage

{
  "content": "## Key Learnings:\n\n1. bcrypt cost=12 is the right balance for our server performance\n2. JWT refresh tokens need atomic rotation to prevent race conditions",
  "session_id": "session-abc123",
  "project": "auth-service"
}
Response:
{
  "saved": 2,
  "skipped": 0,
  "total": 2
}
Each learning is saved as a separate observation:
  • Title: First 50 characters of the learning
  • Type: passive
  • Content: Full learning text
  • Project: auth-service
  • Session: session-abc123

With Duplicates

{
  "content": "## Key Learnings:\n\n1. bcrypt cost=12 is the right balance\n2. New learning about rate limiting",
  "session_id": "session-xyz789",
  "project": "auth-service"
}
Response:
{
  "saved": 1,
  "skipped": 1,
  "total": 2
}
The first learning was already saved in a previous call, so it’s skipped. Only the new learning about rate limiting is saved.

Deduplication

The tool uses content-based deduplication:
  • Each learning is hashed based on normalized content (lowercase, whitespace trimmed)
  • If the hash matches an existing observation in the same project within a 15-minute window, it’s skipped
  • This prevents duplicate saves when the same learnings appear in multiple outputs

Use Cases

End-of-Task Knowledge Capture

When completing a task, include a Key Learnings section:
I've successfully implemented user authentication.

## Key Learnings:

1. Passport.js local strategy requires bcrypt version 5+ for async hash
2. JWT expiry should be configurable per environment (15m dev, 1h prod)
3. Refresh token rotation prevents token replay attacks
Call mem_capture_passive with this output to automatically save all three learnings.

Subagent Completion Hooks

When a subagent finishes work, extract learnings automatically:
{
  "content": "<subagent output with learnings section>",
  "source": "subagent-stop",
  "project": "current-project"
}

Session End Summary

Capture learnings from end-of-session summaries:
{
  "content": "<session summary with discoveries>",
  "source": "session-end",
  "session_id": "session-final"
}

Comparison with mem_save

Featuremem_capture_passivemem_save
FormatExtracts from markdown headingsStructured What/Why/Where/Learned
GranularityOne observation per learning itemOne observation per save call
Use CaseAutomatic extraction from outputExplicit, proactive saves
ControlLess control (auto-parsed)Full control over structure
DeduplicationAutomatic within 15-min windowManual topic key upserts
Use mem_save for deliberate, structured memories. Use mem_capture_passive for automatic knowledge extraction from text.

Profile

Profile: agent (deferred loading) This tool is in the agent profile but has DeferLoading enabled, meaning it’s available to agents but not loaded into context by default. Agents can discover it through tool search when needed. Why deferred? Most agents use mem_save for explicit memory creation. Passive capture is specialized for automated workflows and may not be needed in every session.

mem_save

Save structured observations explicitly

mem_search

Search saved learnings

mem_session_summary

Save comprehensive session summaries

POST /observations/passive

HTTP API for passive capture

Build docs developers (and LLMs) love