Claude Memory Tool

Enable Anthropic's native memory tool for Claude models

The --claude-memory flag enables Anthropic’s native memory tool for Claude models, allowing the agent to store and retrieve information across conversations.

Quick Start

bash
praisonai "Research and remember findings" --claude-memory --llm anthropic/claude-sonnet-4-20250514

!Claude Memory Stores Preferences

Usage

Basic Usage

bash
praisonai "Research and remember findings" --claude-memory --llm anthropic/claude-sonnet-4-20250514

Expected Output:

๐Ÿง  Claude Memory Tool enabled

โ•ญโ”€ Agent Info โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  ๐Ÿ‘ค Agent: DirectAgent                                                       โ”‚
โ”‚  Role: Assistant                                                             โ”‚
โ”‚  Model: anthropic/claude-sonnet-4-20250514                                          โ”‚
โ”‚  Memory: Claude Memory Tool                                                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Response โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ I've researched the topic and stored the key findings in memory:            โ”‚
โ”‚                                                                              โ”‚
โ”‚ ๐Ÿ“ Stored: "AI trends 2025 - multimodal systems, agent architectures"       โ”‚
โ”‚ ๐Ÿ“ Stored: "Key players: OpenAI, Anthropic, Google, Meta"                   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Combine with Other Flags

bash
# Claude memory with planning
praisonai "Research and summarize" --claude-memory --planning --llm anthropic/claude-sonnet-4-20250514

# Claude memory with metrics
praisonai "Analyze and remember" --claude-memory --metrics --llm anthropic/claude-sonnet-4-20250514

Requirements

RequirementValue
ProviderAnthropic only
Modelsclaude-sonnet-4-20250514, claude-3-opus, claude-3-sonnet, claude-3-haiku
API KeyANTHROPIC_API_KEY environment variable

How It Works

  1. Enable: The --claude-memory flag activates Anthropic’s native memory tool
  2. Store: Claude can store information using the memory tool
  3. Retrieve: Claude can retrieve stored information in future conversations
  4. Persist: Memory persists across conversation sessions
Diagram

Store

Retrieve

User Query

Claude Agent

Memory Tool

Memory Storage

Response

Comparison with Other Memory Options

Feature--claude-memory--memory--auto-memory
ProviderAnthropic onlyAnyAny
StorageAnthropic managedLocal fileLocal file
ControlClaude decidesAgent extractsAuto-extraction
PersistenceAnthropic serversLocal storageLocal storage

Examples

Research Task

bash
praisonai "Research quantum computing advances and remember key breakthroughs" \
  --claude-memory --llm anthropic/claude-sonnet-4-20250514

Learning Session

bash
praisonai "Teach me about machine learning, remember what I've learned" \
  --claude-memory --llm anthropic/claude-sonnet-4-20250514

Project Context

bash
praisonai "Remember the project requirements: REST API with auth, PostgreSQL, Docker" \
  --claude-memory --llm anthropic/claude-sonnet-4-20250514

Programmatic Usage

python
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a research assistant that remembers findings",
    model="anthropic/claude-sonnet-4-20250514",
    memory={"claude_memory": True}  # Enable Claude Memory Tool
)

result = agent.start("Research AI trends and remember key findings")

Best Practices

Use Claude Memory ForUse Local Memory For
General researchSensitive data
Learning sessionsOffline usage
Project contextCustom storage
Cross-session recallUser isolation

Related