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

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

Response

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

Expected Format

The tool recognizes two heading formats: English:
Spanish:
You can also use bulleted lists:

Example Usage

Basic Usage

Response:
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

Response:
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:
Call mem_capture_passive with this output to automatically save all three learnings.

Subagent Completion Hooks

When a subagent finishes work, extract learnings automatically:

Session End Summary

Capture learnings from end-of-session summaries:

Comparison with mem_save

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