A framework-agnostic AI agent memory system that provides automatic awareness and understanding of files in your memory directory through AI-powered semantic analysis. Features native automatic integration for Claude Code and manual integration support for Cursor AI, Continue.dev, Aider, Cline, and custom frameworks.
Current Version: v0.11.0 (CHANGELOG.md)
- Overview
- Why Use This?
- Supported AI Agent Frameworks
- Architecture
- Quick Start
- Installation
- Integration Setup
- Managing Integrations
- Usage
- Supported File Types
- Configuration Options
- Example Outputs
- Development
- Limitations & Known Issues
- Troubleshooting
- Contributing
- License
Agentic Memorizer provides AI agents with persistent, semantic awareness of your local files. Instead of manually managing which files to include in context or repeatedly explaining what files exist, your AI agent automatically receives a comprehensive, AI-powered index showing what files you have, what they contain, their purpose, and how to access them.
Works seamlessly with Claude Code (automatic setup), Cursor AI, Continue.dev, Aider, Cline, and any custom framework that can execute shell commands.
A background daemon continuously watches your designated memory directory (~/.agentic-memorizer/memory/ by default), automatically discovering and analyzing files as they're added or modified. Each file is processed to extract metadata (word counts, dimensions, page counts, etc.) andβusing the Claude APIβsemantically analyzed to understand its content, purpose, and key topics. This information is maintained in a precomputed index that loads quickly when your AI agent starts.
When you launch your AI agent, the precomputed index is loaded into its context:
- Claude Code: SessionStart hooks automatically load the index
- Other frameworks: Configure your agent to run the read command on startup
Your AI agent can then:
- Discover what files exist without you listing them
- Understand file content and purpose before reading them
- Decide which files to access based on semantic relevance
- Access files efficiently using the appropriate method (Read tool for text/code/images, extraction for PDFs/docs)
Automatic File Management:
- Discovers files as you add them to the memory directory
- Updates the index automatically when files are modified or deleted
- Maintains a complete catalog without manual intervention
Semantic Understanding:
- AI-powered summaries of file content and purpose
- Semantic tags and key topics for each file
- Document type classification (e.g., "technical-guide", "architecture-diagram")
- Vision analysis for images using Claude's multimodal capabilities
Efficiency:
- Background daemon handles all processing asynchronously
- Smart caching only re-analyzes changed files
- Precomputed index enables quick Claude Code startup
- Minimal API usageβonly new/modified files are analyzed
Wide Format Support:
- Direct reading: Markdown, text, JSON/YAML, code files, images, VTT transcripts
- Extraction supported: Word documents (DOCX), PowerPoint (PPTX), PDFs
- Automatic metadata extraction for all file types
Integration:
- Framework-agnostic with native support for multiple AI agent frameworks
- Automatic setup for Claude Code via SessionStart hooks
- Manual integration for Cursor AI, Continue.dev, Aider, Cline, and custom frameworks
- Configurable output formats (XML, Markdown, JSON)
- Integration management commands for detection, setup, validation, and health checks
- Optional health monitoring and logging
Instead of:
- β Manually copying file contents into prompts
- β Pre-loading all files into context (wasting tokens)
- β Repeatedly explaining what files exist to Claude
- β Managing which files to include/exclude manually
You get:
- β Automatic file awareness on every session
- β Smart, on-demand file access (AI agent decides what to read)
- β Semantic understanding of content before reading
- β Efficient token usage (only index, not full content)
- β Works across sessions with persistent cache
Agentic Memorizer integrates with multiple AI agent frameworks, providing either automatic setup or manual integration instructions.
Claude Code - Full automatic integration with one-command setup
- Automatic framework detection and configuration
- One-command setup:
agentic-memorizer integrations setup claude-code-hook - SessionStart hook configuration with all matchers (startup, resume, clear, compact)
- Default XML output with JSON envelope wrapping for proper hook formatting
- Full lifecycle management (setup, update, remove, validate)
The following frameworks require manual configuration file editing. The integrations setup command provides detailed, framework-specific instructions:
Cursor AI - Manual configuration with context file or custom commands
- Command:
agentic-memorizer integrations setup cursor - Provides setup instructions for context files or custom commands
- Markdown output (optimized for readability)
Continue.dev - Manual configuration via context providers
- Command:
agentic-memorizer integrations setup continue - Provides setup instructions for Continue config file (
~/.continue/config.json) - Markdown output (optimized for readability)
Aider - Manual integration via shell alias or command execution
- Command:
agentic-memorizer integrations setup aider - Provides setup instructions for shell aliases or pre-session commands
- Markdown output (optimized for readability)
Cline - Manual configuration via VS Code settings
- Command:
agentic-memorizer integrations setup cline - Provides setup instructions for Cline extension settings
- Markdown output (optimized for readability)
Custom Frameworks - Generic integration for any framework
- Works with any agent that can execute shell commands
- XML, Markdown, or JSON output formats available
- Just needs ability to execute commands and capture output
| Feature | Claude Code (Hook) | Claude Code (MCP) | Other Frameworks |
|---|---|---|---|
| Setup Type | Automatic | Automatic | Manual |
| Delivery | SessionStart injection | On-demand tools | User-configured |
| Output Format | XML (JSON-wrapped) | N/A (tool-based) | Markdown |
| Best For | Complete awareness | Large directories | Flexibility |
| Validation | Automatic | Automatic | Manual |
Three-Phase Processing Pipeline:
- Metadata Extraction (
internal/metadata/) - Fast, deterministic extraction using specialized handlers for 9 file type categories - Semantic Analysis (
internal/semantic/) - AI-powered content understanding via Claude API - Caching (
internal/cache/) - Content-hash-based storage achieving >95% cache hit rates
Background Daemon (internal/daemon/):
- Walker (
internal/walker/) - Full directory scans during rebuilds - File Watcher (
internal/watcher/) - Real-time monitoring with fsnotify - Worker Pool - Parallel processing with rate limiting (default 3 workers, 20 calls/min)
Semantic Search (internal/search/):
- Substring-based filename matching
- Tag and topic search
- Summary text search
- Relevance-ranked results
Index Management (internal/index/):
- Thread-safe operations
- Atomic writes via temp file + rename
- Two-level versioning
Integration Framework (internal/integrations/):
- Adapter pattern for Claude Code (hook + MCP), Cursor, Continue, Aider, Cline, custom
- Independent output processors (XML, Markdown, JSON)
MCP Server (internal/mcp/):
- JSON-RPC 2.0 stdio transport
- Three tools:
search_files,get_file_metadata,list_recent_files - Integrates with semantic search
Configuration (internal/config/):
- Layered: defaults β YAML β environment variables
- Hot-reload support via
config reloadcommand
The daemon handles all processing in the background, so AI agent startup remains quick regardless of file count.
Get up and running quickly with your AI agent:
go install github.com/leefowlercu/agentic-memorizer@latestexport ANTHROPIC_API_KEY="your-key-here"For Claude Code users, automatic setup configures everything for you:
agentic-memorizer initialize --setup-integrationsThis will:
- Create config at
~/.agentic-memorizer/config.yaml - Create memory directory at
~/.agentic-memorizer/memory/ - Automatically configure Claude Code SessionStart hooks and MCP Server integration (no manual editing required)
Then start the daemon:
agentic-memorizer daemon start
# OR set up as system service (recommended):
agentic-memorizer daemon systemctl # Linux
agentic-memorizer daemon launchctl # macOSSkip to step 4 below.
For Cursor AI, Continue.dev, Aider, or Cline:
# Initialize
agentic-memorizer initialize
# Start daemon
agentic-memorizer daemon startThen get framework-specific setup instructions:
# Get setup instructions for your framework
agentic-memorizer integrations setup cursor # For Cursor AI
agentic-memorizer integrations setup continue # For Continue.dev
agentic-memorizer integrations setup aider # For Aider
agentic-memorizer integrations setup cline # For ClineEach command provides detailed instructions on where to add the memory index command in your framework's configuration. Follow those instructions before proceeding to step 4.
# Add any files you want your AI agent to be aware of
cp ~/important-notes.md ~/.agentic-memorizer/memory/
cp ~/project-docs/*.pdf ~/.agentic-memorizer/memory/documents/The daemon will automatically detect and index these files.
Claude Code:
claudeClaude automatically loads the memory index via SessionStart hooks.
Other Frameworks:
Start your agent normally. The memory index will load based on the configuration you set up in step 3.
Your AI agent now automatically knows about all files in your memory directory!
For detailed installation options, configuration, and advanced usage, see the sections below.
- Go 1.25.1 or later
- Claude API key (get one here)
- An AI agent framework: Claude Code, Cursor AI, Continue.dev, Aider, or Cline
go install github.com/leefowlercu/agentic-memorizer@latestThen run the initialize command to set up configuration:
# Interactive setup (prompts for integrations)
agentic-memorizer initialize
# Or with flags for automated setup
agentic-memorizer initialize --setup-integrationsThis creates:
- Config file at
~/.agentic-memorizer/config.yaml - Memory directory at
~/.agentic-memorizer/memory/ - Cache directory at
~/.agentic-memorizer/.cache/(for semantic analysis cache) - Index file at
~/.agentic-memorizer/index.json(created by daemon on first run)
The initialize command can optionally configure Claude Code SessionStart hooks automatically with --setup-integrations.
After initialization, start the daemon:
agentic-memorizer daemon start
# OR set up as system service (recommended for production):
agentic-memorizer daemon systemctl # Linux
agentic-memorizer daemon launchctl # macOS# Build and install
make installThis will:
- Build the
agentic-memorizerbinary with version info from git - Install it to
~/.local/bin/agentic-memorizer
The build automatically injects version information from git tags and commits, providing accurate version tracking in logs and index files.
Set your API key via environment variable (recommended):
export ANTHROPIC_API_KEY="your-key-here"Or edit ~/.agentic-memorizer/config.yaml:
claude:
api_key: "your-api-key-here"Custom Setup:
# Custom memory directory
agentic-memorizer initialize --memory-root ~/my-memory
# Custom cache directory
agentic-memorizer initialize --cache-dir ~/my-memory/.cache
# Force overwrite existing config
agentic-memorizer initialize --forceClaude Code enjoys full automatic integration support with one-command setup.
agentic-memorizer integrations setup claude-code-hookThis command automatically:
- Detects your Claude Code installation (
~/.claude/directory) - Creates or updates
~/.claude/settings.json - Preserves existing settings (won't overwrite other configurations)
- Adds SessionStart hooks for all matchers (startup, resume, clear, compact)
- Configures the command:
agentic-memorizer read --format xml --integration claude-code-hook - Creates backup at
~/.claude/settings.json.backup
You can also use the --setup-integrations flag during initialization:
agentic-memorizer initialize --setup-integrations
agentic-memorizer daemon startIf you prefer manual configuration, add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "/path/to/agentic-memorizer read --format xml --integration claude-code-hook"
}
]
}
// Repeat for "resume", "clear", and "compact" matchers
]
}
}Note: Include all four SessionStart matchers to ensure the memory index loads throughout your session lifecycle.
Verify your setup:
agentic-memorizer integrations validateRemove the integration:
agentic-memorizer integrations remove claude-code-hookClaude Code also supports integration via the Model Context Protocol (MCP), providing advanced semantic search capabilities through MCP tools.
agentic-memorizer integrations setup claude-code-mcpThis command automatically:
- Detects your Claude Code installation (
~/.claude/directory) - Creates or updates
~/.claude.json(MCP server configuration) - Registers the
agentic-memorizerMCP server - Configures environment variables (
MEMORIZER_MEMORY_ROOT) - Sets the binary command path
- Creates backup at
~/.claude.json.backup
The MCP server exposes three tools to Claude Code:
-
search_files- Semantic search across indexed files- Substring-based filename matching
- Tag and topic search
- Summary text search
- Relevance-ranked results
- Category filtering
-
get_file_metadata- Retrieve complete metadata for a specific file- File metadata (size, type, category)
- Semantic analysis (summary, tags, topics)
- Document-specific fields (word count, page count, dimensions)
-
list_recent_files- List recently modified files- Configurable lookback period (days)
- Sorted by modification date
- Includes full metadata
The MCP server provides pre-configured prompt templates that help you interact with your memory index efficiently:
-
analyze-file- Deep analysis of a specific file- Generates detailed analysis using semantic metadata
- Arguments:
file_path(required),focus(optional) - Example: Focus on security, performance, or architecture aspects
-
search-context- Build effective search queries- Helps construct semantic search queries
- Arguments:
topic(required),category(optional) - Returns ranked search strategies and related terms
-
explain-summary- Understand AI-generated summaries- Detailed explanation of file semantic analysis
- Arguments:
file_path(required) - Explains summary, tags, topics, and confidence scores
These prompts appear in Claude Code's prompt selector and can be invoked with arguments to generate context-aware messages based on your memory index.
The MCP server has dedicated configuration in config.yaml:
mcp:
log_file: ~/.agentic-memorizer/mcp.log # MCP server logs
log_level: info # Log level (debug/info/warn/error)The MCP server is automatically started by Claude Code when configured. You can also run it manually for testing:
# Start MCP server in stdio mode
agentic-memorizer mcp start
# Start with debug logging
agentic-memorizer mcp start --log-level debug
# View MCP logs
tail -f ~/.agentic-memorizer/mcp.logThe server communicates via stdin/stdout using JSON-RPC 2.0 protocol.
You can use one or both Claude Code integration methods:
-
SessionStart Hooks (
claude-code-hook): Injects full memory index at session start- Best for: Always-available context, complete file awareness
- Trade-off: Larger initial context, all files loaded upfront
-
MCP Server (
claude-code-mcp): Provides on-demand tools for semantic search- Best for: Large memory directories, selective file discovery
- Trade-off: Requires explicit tool use, context fetched on demand
Many users enable both for maximum flexibility.
Verify your MCP setup:
agentic-memorizer integrations validate
agentic-memorizer integrations healthRemove the MCP integration:
agentic-memorizer integrations remove claude-code-mcpCursor AI requires manual configuration.
Get framework-specific instructions:
agentic-memorizer integrations setup cursorConfigure a script to regenerate context file:
#!/bin/bash
agentic-memorizer read --format markdown > ~/.cursor/memory-context.mdAdd to Cursor's context sources:
- File path:
~/.cursor/memory-context.md - Auto-reload: Enabled
If Cursor supports custom commands, add:
{
"customCommands": [
{
"name": "Load Memory",
"command": "agentic-memorizer read --format markdown"
}
]
}Output Format: Cursor works best with Markdown output (default for this integration).
Continue.dev requires manual configuration file editing.
Get framework-specific instructions:
agentic-memorizer integrations setup continue-
Locate your Continue configuration (typically
~/.continue/config.jsonor.continue/config.jsonin your workspace) -
Add a context provider for agentic-memorizer:
{
"contextProviders": [
{
"name": "agentic-memory",
"params": {
"command": "agentic-memorizer read --format markdown"
}
}
]
}- Restart Continue.dev
In Continue chat, reference the memory index:
@agentic-memory What files do I have about API design?
Output Format: Continue works best with Markdown output (default for this integration).
Aider can access the memory index via shell integration.
Get framework-specific instructions:
agentic-memorizer integrations setup aiderAdd to your shell profile (~/.bashrc, ~/.zshrc):
alias aider-with-memory='agentic-memorizer read --format markdown && aider'Usage:
aider-with-memoryBefore starting Aider, run:
agentic-memorizer read --format markdown > /tmp/memory-index.mdThen in Aider:
/add /tmp/memory-index.md
Output Format: Aider works best with Markdown output (default for this integration).
Cline requires manual configuration via VS Code settings.
Get framework-specific instructions:
agentic-memorizer integrations setup cline-
Locate your Cline configuration (typically in VS Code settings under Cline extension)
-
Add a startup command or context provider:
{
"cline.contextCommands": [
{
"name": "Load Memory Index",
"command": "agentic-memorizer read --format markdown"
}
]
}- Configure Cline to run this command on session start or manually trigger it
Run the memory index command via Cline's command palette or configure it to run automatically on startup.
Output Format: Cline works best with Markdown output (default for this integration).
Any AI agent framework that can execute shell commands can integrate with agentic-memorizer.
Your framework must be able to:
- Execute shell commands
- Capture command output (stdout)
- Add output to the agent's context
-
Determine how your framework executes commands at startup or on-demand
-
Configure it to run:
agentic-memorizer read --format <xml|markdown|json>- Choose output format based on your framework:
- XML: Best for programmatic parsing, structured data
- Markdown: Best for human readability, LLM consumption
- JSON: Best for programmatic integration, custom parsing
Pattern 1: Startup Hook
{
"onStartup": {
"commands": [
"agentic-memorizer read --format markdown"
]
}
}Pattern 2: Context Provider
{
"contextProviders": [
{
"name": "memory",
"command": "agentic-memorizer read --format markdown"
}
]
}Pattern 3: Manual Command
Add a custom agent command that runs:
agentic-memorizer read --format markdownThen invoke it when needed:
@memory What files do I have?
- Ensure daemon is running:
agentic-memorizer daemon status- Test command output:
agentic-memorizer read --format markdown- Verify your framework captures and displays the output
The integrations command group provides comprehensive tools for managing integrations with various AI agent frameworks.
agentic-memorizer integrations listShows all registered integrations with their status and configuration:
Example Output:
β claude-code-hook
Description: Claude Code SessionStart hooks integration
Version: 1.0.0
Status: configured
β claude-code-mcp
Description: Claude Code MCP server integration
Version: 1.0.0
Status: configured
β cursor
Description: Cursor AI integration (manual setup required)
Version: 1.0.0
Status: not configured
β continue
Description: Continue.dev integration (manual setup required)
Version: 1.0.0
Status: not configured
β aider
Description: Aider integration (manual setup required)
Version: 1.0.0
Status: not configured
β cline
Description: Cline integration (manual setup required)
Version: 1.0.0
Status: not configured
Automatically detect which agent frameworks are installed on your system:
agentic-memorizer integrations detectExample Output:
Detected Frameworks:
β claude-code-hook (installed at ~/.claude)
Checks for framework-specific configuration directories and files.
# SessionStart hooks setup
agentic-memorizer integrations setup claude-code-hook
# MCP server setup
agentic-memorizer integrations setup claude-code-mcp
# With custom binary path
agentic-memorizer integrations setup claude-code-hook --binary-path /custom/path/agentic-memorizerFor Claude Code, this automatically:
- Detects the Claude settings file (
~/.claude/settings.json) - Adds SessionStart hooks for all matchers (startup, resume, clear, compact)
- Configures the correct command with
--integration claude-code-hookflag - Preserves existing settings and creates backup
# Get framework-specific setup instructions
agentic-memorizer integrations setup cursor # Cursor AI
agentic-memorizer integrations setup continue # Continue.dev
agentic-memorizer integrations setup aider # Aider
agentic-memorizer integrations setup cline # ClineEach command provides detailed manual setup instructions specific to that framework, including:
- Where to find the framework's configuration file
- What configuration to add
- Example configuration snippets
- Recommended output format
agentic-memorizer integrations remove claude-code-hook
agentic-memorizer integrations remove claude-code-mcpRemoves the integration configuration from the framework's settings file. For Claude Code, this:
- Removes SessionStart hooks added by agentic-memorizer
- Preserves other hooks and settings
- Creates backup before modification
Check that all configured integrations are properly set up:
agentic-memorizer integrations validateExample Output:
Validating integrations...
β claude-code-hook: Valid (settings file exists, hooks configured)
Validates:
- Configuration file exists and is readable
- Integration-specific settings are properly formatted
- Required commands are configured
Comprehensive health check including both detection and validation:
agentic-memorizer integrations healthExample Output:
Framework Detection:
β claude-code-hook (installed at ~/.claude)
Configuration Validation:
β claude-code-hook: Valid (settings file exists, hooks configured)
Overall Status: Healthy (1/1 configured integrations valid)
Performs:
- Framework installation detection
- Configuration file validation
- Integration setup verification
- Overall health status summary
The background daemon is the core of Agentic Memorizer. It maintains a precomputed index for quick startup, watching your memory directory and automatically updating the index as files change.
# Start the daemon (run in foreground - use Ctrl+C to stop)
agentic-memorizer daemon start
# OR set up as system service for automatic management (recommended):
agentic-memorizer daemon systemctl # Linux
agentic-memorizer daemon launchctl # macOSNote: If you used initialize --setup-integrations, the integration is already configured. Otherwise, configure your AI agent framework to call agentic-memorizer read (see Integration Setup section above).
# Start daemon (runs in foreground - press Ctrl+C to stop)
agentic-memorizer daemon start
# Check daemon status
agentic-memorizer daemon status
# Stop daemon
agentic-memorizer daemon stop
# Restart daemon
agentic-memorizer daemon restart
# Force immediate rebuild
agentic-memorizer daemon rebuild
# View daemon logs
agentic-memorizer daemon logs # Last 50 lines
agentic-memorizer daemon logs -f # Follow logs
agentic-memorizer daemon logs -n 100 # Last 100 lines
# Hot-reload configuration without daemon restart
agentic-memorizer config reloadThe daemon:
- Watches your memory directory for file changes using fsnotify
- Processes files in parallel using a worker pool (3 workers by default)
- Rate limits API calls to respect Claude API limits (20/min default)
- Maintains a precomputed
index.jsonfile with all metadata and semantic analysis - Updates the index automatically when files are added/modified/deleted
- Supports hot-reload of most configuration settings via
config reloadcommand
When you run agentic-memorizer read, it simply loads the precomputed index from disk instead of analyzing all files.
In ~/.agentic-memorizer/config.yaml:
daemon:
enabled: true # Enable daemon mode
debounce_ms: 500 # Debounce file events (milliseconds)
workers: 3 # Parallel worker count
rate_limit_per_min: 20 # API rate limit
full_rebuild_interval_minutes: 60 # Periodic full rebuild interval
http_port: 0 # HTTP server for health + SSE (0 = disabled)
log_file: ~/.agentic-memorizer/daemon.log
log_level: info # debug, info, warn, errorHot-Reloading: Most settings can be hot-reloaded using agentic-memorizer config reload without restarting the daemon:
- β
daemon.workers,daemon.rate_limit_per_min,daemon.debounce_ms - β
daemon.full_rebuild_interval_minutes,daemon.http_port - β
analysis.*settings,claude.*settings - β
memory_root,analysis.cache_dir,daemon.log_file,mcp.log_file(require restart)
For production use, run the daemon as a system service that starts automatically and restarts on failure. The application provides commands to generate service configuration files for systemd (Linux) and launchd (macOS).
Benefits of running as a service:
- Automatic start on system boot or user login
- Automatic restart if daemon crashes
- Centralized log management
- Health monitoring and status checking
- No manual terminal session required
Generate a systemd unit file:
agentic-memorizer daemon systemctlThis command outputs a complete systemd unit file. To install:
Option A: User Service (Recommended - No root required)
# Create directory
mkdir -p ~/.config/systemd/user
# Generate and save unit file
agentic-memorizer daemon systemctl > ~/.config/systemd/user/agentic-memorizer.service
# Reload systemd
systemctl --user daemon-reload
# Enable autostart
systemctl --user enable agentic-memorizer
# Start service
systemctl --user start agentic-memorizer
# Check status
systemctl --user status agentic-memorizer
# View logs
journalctl --user -u agentic-memorizer -fOption B: System-Wide Service (Requires root)
# Generate and save unit file (requires sudo)
agentic-memorizer daemon systemctl | sudo tee /etc/systemd/system/agentic-memorizer.service
# Reload systemd
sudo systemctl daemon-reload
# Enable autostart
sudo systemctl enable agentic-memorizer
# Start service
sudo systemctl start agentic-memorizer
# Check status
systemctl status agentic-memorizer
# View logs
journalctl -u agentic-memorizer -fManaging the service:
# Stop service
systemctl --user stop agentic-memorizer
# Restart service
systemctl --user restart agentic-memorizer
# Disable autostart
systemctl --user disable agentic-memorizer
# Remove service
systemctl --user stop agentic-memorizer
systemctl --user disable agentic-memorizer
rm ~/.config/systemd/user/agentic-memorizer.service
systemctl --user daemon-reloadGenerate a launchd property list:
agentic-memorizer daemon launchctlThis command outputs a complete launchd plist file. To install:
# Create directory
mkdir -p ~/Library/LaunchAgents
# Generate and save plist
agentic-memorizer daemon launchctl > ~/Library/LaunchAgents/com.$(whoami).agentic-memorizer.plist
# Load service
launchctl load ~/Library/LaunchAgents/com.$(whoami).agentic-memorizer.plist
# Start service (if not running)
launchctl start com.$(whoami).agentic-memorizer
# Check if running
launchctl list | grep agentic-memorizerManaging the service:
# Stop service
launchctl stop com.$(whoami).agentic-memorizer
# Restart service
launchctl stop com.$(whoami).agentic-memorizer
launchctl start com.$(whoami).agentic-memorizer
# Disable autostart (unload)
launchctl unload ~/Library/LaunchAgents/com.$(whoami).agentic-memorizer.plist
# Remove service
launchctl unload ~/Library/LaunchAgents/com.$(whoami).agentic-memorizer.plist
rm ~/Library/LaunchAgents/com.$(whoami).agentic-memorizer.plistView logs:
# Tail daemon log
tail -f ~/.agentic-memorizer/daemon.log
# Check Console.app for system messages (macOS)
open /Applications/Utilities/Console.appFor development environments or servers without systemd, use Supervisor:
Install Supervisor:
# Ubuntu/Debian
sudo apt-get install supervisor
# macOS
brew install supervisor
# Or via pip
pip install supervisorConfigure:
Create /etc/supervisor/conf.d/agentic-memorizer.conf:
[program:agentic-memorizer]
command=/home/youruser/.local/bin/agentic-memorizer daemon start
directory=/home/youruser
autostart=true
autorestart=true
startretries=3
user=youruser
redirect_stderr=true
stdout_logfile=/var/log/agentic-memorizer/daemon.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=3
environment=HOME="/home/youruser"Replace youruser with your username and adjust paths as needed.
Manage with supervisorctl:
# Reload config
sudo supervisorctl reread
sudo supervisorctl update
# Start service
sudo supervisorctl start agentic-memorizer
# Check status
sudo supervisorctl status agentic-memorizer
# Stop service
sudo supervisorctl stop agentic-memorizer
# Restart service
sudo supervisorctl restart agentic-memorizer
# View logs
sudo supervisorctl tail -f agentic-memorizerWhen upgrading to a new version, the upgrade process depends on how you're running the daemon.
systemd (Linux):
# Stop service
systemctl --user stop agentic-memorizer
# Upgrade binary
go install github.com/leefowlercu/agentic-memorizer@latest
# OR: cd /path/to/repo && make install
# Start service
systemctl --user start agentic-memorizer
# Verify
systemctl --user status agentic-memorizer
agentic-memorizer versionOr use restart for one command:
# Stop and upgrade (Makefile handles daemon stop)
make install
# Restart service
systemctl --user restart agentic-memorizerlaunchd (macOS):
# Stop service
launchctl stop com.$(whoami).agentic-memorizer
# Upgrade binary
go install github.com/leefowlercu/agentic-memorizer@latest
# OR: cd /path/to/repo && make install
# Start service
launchctl start com.$(whoami).agentic-memorizer
# Verify
launchctl list | grep agentic-memorizer
agentic-memorizer versionSupervisor:
# Stop service
sudo supervisorctl stop agentic-memorizer
# Upgrade binary
go install github.com/leefowlercu/agentic-memorizer@latest
# Start service
sudo supervisorctl start agentic-memorizer
# Verify
sudo supervisorctl status agentic-memorizerIf running daemon manually (not as service):
# Stop daemon
agentic-memorizer daemon stop
# Upgrade
go install github.com/leefowlercu/agentic-memorizer@latest
# OR: cd /path/to/repo && make install
# Start daemon
agentic-memorizer daemon start
# Verify
agentic-memorizer versionNote: The Makefile install target automatically stops the daemon before replacing the binary:
# This command handles daemon shutdown automatically
make installService files typically do not need to be regenerated when upgrading unless:
- The binary path changed
- New configuration options require service file changes
- Release notes explicitly mention service file updates
Service files reference the binary by path, not version:
ExecStart=/home/user/.local/bin/agentic-memorizer daemon startThe service manager automatically uses whatever binary exists at that path after upgrade.
Manual daemon process:
- β Must manually stop before upgrade
- β Must manually restart after upgrade
- β On macOS, replacing running binary triggers security warnings
- β Old process may continue running from deleted inode
Service managers:
- β Orchestrated shutdown and restart
- β No security warnings
- β One-command upgrade with restart
- β Rollback capability if new version fails
- β Health monitoring during upgrade
Enable HTTP server for health checks and SSE notifications:
daemon:
http_port: 8080Then check health at: http://localhost:8080/health
Response includes uptime, files processed, API calls, errors, and build status.
Check daemon status:
./agentic-memorizer daemon statusCommon issues:
-
Daemon won't start - "daemon already running"
- Check if daemon is actually running:
./agentic-memorizer daemon status - If not running but PID file exists:
rm ~/.agentic-memorizer/daemon.pid - Try starting again
- Check if daemon is actually running:
-
Daemon crashes or exits immediately
- Check logs:
tail -f ~/.agentic-memorizer/daemon.log - Verify config file:
cat ~/.agentic-memorizer/config.yaml - Ensure Claude API key is set (in config or
ANTHROPIC_API_KEYenv var) - Check file permissions on cache directory
- Check logs:
-
Index not updating after file changes
- Verify daemon is running:
./agentic-memorizer daemon status - Check watcher is active in status output
- Review daemon logs for file watcher errors
- Ensure files aren't in skipped directories (
.cache,.git)
- Verify daemon is running:
-
High API usage
- Reduce workers:
daemon.workers: 1in config - Lower rate limit:
daemon.rate_limit_per_min: 10 - Increase rebuild interval:
daemon.full_rebuild_interval_minutes: 120 - Add files to skip list:
analysis.skip_filesin config
- Reduce workers:
-
Index corruption after crash
- Daemon automatically loads last good index on startup
- Force rebuild:
./agentic-memorizer daemon stop && ./agentic-memorizer daemon start - If still corrupted:
rm ~/.agentic-memorizer/index.jsonand restart
-
Service won't start (macOS/Linux)
- macOS: Check Console.app for launchd errors
- Linux: Check systemd logs:
journalctl -u agentic-memorizer.service -n 50 - Verify binary path in service config matches installation location
- Check user permissions on config and cache directories
Debug logging:
daemon:
log_level: debugSimply add files to ~/.agentic-memorizer/memory/ (or the directory you've configured as the memory_root in config.yaml):
# Organize however you like
~/.agentic-memorizer/memory/
βββ documents/
β βββ project-plan.md
βββ presentations/
β βββ quarterly-review.pptx
βββ images/
βββ architecture-diagram.pngOn your next Claude Code session, these files will be automatically analyzed and indexed.
View the precomputed index:
# Start daemon if not already running
agentic-memorizer daemon start
# In another terminal, read the index
agentic-memorizer readThis outputs the index (XML by default) that AI agents receive. The daemon must be running (or have completed at least one indexing cycle) for the index file to exist.
Commands:
# Initialize config and memory directory
agentic-memorizer initialize [flags]
# Manage background daemon
agentic-memorizer daemon start
agentic-memorizer daemon stop
agentic-memorizer daemon status
agentic-memorizer daemon systemctl # Generate systemd unit file
agentic-memorizer daemon launchctl # Generate launchd plist
# Read precomputed index (for SessionStart hooks)
agentic-memorizer read [flags]
# Manage agent framework integrations
agentic-memorizer integrations list
agentic-memorizer integrations detect
agentic-memorizer integrations setup <integration-name>
agentic-memorizer integrations remove <integration-name>
agentic-memorizer integrations validate
agentic-memorizer integrations health
# MCP server
agentic-memorizer mcp start
# Manage configuration
agentic-memorizer config validate
agentic-memorizer config reload
# Get help
agentic-memorizer --help
agentic-memorizer initialize --help
agentic-memorizer daemon --help
agentic-memorizer read --help
agentic-memorizer integrations --help
agentic-memorizer config --helpCommon Flags:
# Read command flags
--format <xml|markdown|json> # Output format
--integration <name> # Format for specific integration (claude-code-hook, etc)
# Init command flags
--memory-root <dir> # Custom memory directory
--cache-dir <dir> # Custom cache directory
--force # Overwrite existing config
--setup-integrations # Configure agent framework integrations
--skip-integrations # Skip integration setup prompt
--http-port <port> # HTTP API port (0=disable, -1=interactive prompt)Examples:
# Initialize (interactive prompts for API key, HTTP port, integrations)
agentic-memorizer initialize
# Initialize with HTTP API enabled on port 7600 (scripted, no prompt)
agentic-memorizer initialize --http-port 7600 --setup-integrations
# Read index (XML format)
agentic-memorizer read
# Read index (Markdown format)
agentic-memorizer read --format markdown
# Read index (JSON format)
agentic-memorizer read --format json
# Read with Claude Code hook integration (SessionStart)
agentic-memorizer read --format xml --integration claude-code-hook
# Note: MCP integration uses tools, not read command
# Start daemon
agentic-memorizer daemon start
# Check daemon status
agentic-memorizer daemon status
# Force rebuild index
agentic-memorizer daemon rebuild
# List available integrations
agentic-memorizer integrations list
# Detect installed agent frameworks
agentic-memorizer integrations detect
# Setup Claude Code SessionStart hooks
agentic-memorizer integrations setup claude-code-hook
# Setup Claude Code MCP server
agentic-memorizer integrations setup claude-code-mcp
# Remove integrations
agentic-memorizer integrations remove claude-code-hook
agentic-memorizer integrations remove claude-code-mcp
# Validate integration configurations
agentic-memorizer integrations validateSemantic analysis can be enabled or disabled in config.yaml:
analysis:
enable: true # Set to false to skip Claude API callsWhen disabled, the daemon will only extract file metadata without semantic analysis.
- Markdown (
.md) - Text files (
.txt) - Configuration files (
.json,.yaml,.yml,.toml,.xml) - Images (
.png,.jpg,.jpeg,.gif,.webp) - Code files (
.go,.py,.js,.ts,.java,.c,.cpp,.rs,.rb,.php,.html,.css,.sh,.bash) - Transcripts (
.vtt,.srt)
- Word documents (
.docx) - PowerPoint (
.pptx) - PDFs (
.pdf)
The index tells your AI agent which method to use for each file.
See config.yaml.example for all options:
- API Settings: Model, tokens, timeout, vision enable
- Analysis: Enable/disable, file size limits, file exclusions, cache directory
- Daemon: Worker count, rate limits, rebuild intervals, health check, debounce timing
- Output: Format (xml/markdown/json), recent activity days
- MCP: Log file path, log level
- Integrations: Tracks enabled integrations (auto-managed by CLI)
The indexer automatically excludes:
- Hidden files and directories (starting with
.) - The
.cache/directory (where analyses are cached) - The
agentic-memorizerbinary itself (if located in the memory directory)
You can exclude additional files by name in config.yaml:
analysis:
skip_files:
- agentic-memorizer # Default
- my-private-notes.md
- temp-file.txtFiles in the skip list are completely ignored during indexing and won't appear in the generated index.
By default, configuration and data files are stored in ~/.agentic-memorizer/. You can customize this location by setting the MEMORIZER_APP_DIR environment variable:
# Use a custom app directory
export MEMORIZER_APP_DIR=/path/to/custom/location
agentic-memorizer initialize
# Or for a single command
MEMORIZER_APP_DIR=/tmp/test-instance agentic-memorizer daemon startFiles stored in the app directory:
config.yaml- Configuration fileindex.json- Precomputed indexdaemon.pid- Daemon process IDdaemon.log- Daemon logs (if configured)
Use cases:
- Testing: Run isolated test instances without affecting your main instance
- Multi-instance: Run multiple independent instances for different projects
- Containers: Use custom paths in Docker or other containerized environments
- CI/CD: Isolate build/test environments
Note: The memory directory and cache directory locations are still controlled by config.yaml settings, not MEMORIZER_APP_DIR. Only the application's own files (config, index, PID, logs) use the app directory.
The memorizer supports three output formats:
Highly structured XML following Anthropic's recommendations for Claude prompt engineering:
agentic-memorizer read
# or explicitly:
agentic-memorizer read --format xmlHuman-readable markdown, formatted for direct viewing:
agentic-memorizer read --format markdownPretty-printed JSON representation of the index:
agentic-memorizer read --format jsonUse the --integration flag to format output for specific agent frameworks. This wraps the index in the appropriate structure for that framework:
# Claude Code hook integration (SessionStart injection)
agentic-memorizer read --format xml --integration claude-code-hook
# Can also use markdown or json formats
agentic-memorizer read --format markdown --integration claude-code-hook
# Note: MCP integration doesn't use read - uses tools insteadClaude Code Integration Output Structure:
The Claude Code integration wraps the formatted index in a SessionStart hook JSON envelope:
{
"continue": true,
"suppressOutput": true,
"systemMessage": "Memory index updated: 15 files (5 documents, 3 images, 2 presentations, 5 code files), 2.3 MB total β 12 cached, 3 analyzed",
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "<memory_index>...</memory_index>"
}
}- continue: Always
true- allows session to proceed - suppressOutput: Always
true- keeps verbose index out of transcript - systemMessage: Concise summary visible to user in UI
- hookSpecificOutput: Contains the full index (XML, Markdown, or JSON) in
additionalContext, which Claude Code adds to the context window
More Info
Claude Hook JSON Common Fields
Claude SessionStart Hook Fields
Here are examples of what the memory index looks like in each format:
Abbreviated example showing structure (actual output includes all files):
<memory_index>
<metadata>
<generated>2025-10-05T14:30:22-04:00</generated>
<file_count>3</file_count>
<total_size_human>2.0 MB</total_size_human>
<root_path>/Users/username/.agentic-memorizer/memory</root_path>
<cache_stats>
<cached_files>2</cached_files>
<analyzed_files>1</analyzed_files>
</cache_stats>
</metadata>
<recent_activity days="7">
<file><path>documents/api-design-guide.md</path><modified>2025-10-04</modified></file>
</recent_activity>
<categories>
<category name="documents" count="1" total_size="45.2 KB">
<file>
<name>api-design-guide.md</name>
<path>/Users/username/.agentic-memorizer/memory/documents/api-design-guide.md</path>
<modified>2025-10-04</modified>
<size_human>45.2 KB</size_human>
<file_type>markdown</file_type>
<readable>true</readable>
<metadata>
<word_count>4520</word_count>
<sections>
<section>Introduction</section>
<section>RESTful Principles</section>
<section>Versioning Strategies</section>
<section>Authentication</section>
<section>Error Handling</section>
<section>Rate Limiting</section>
<section>Documentation</section>
<section>Best Practices</section>
</sections>
</metadata>
<semantic>
<summary>Comprehensive API design guidelines covering RESTful principles, versioning strategies, authentication patterns, and best practices for building scalable microservices.</summary>
<document_type>technical-guide</document_type>
<topics>
<topic>RESTful API design principles and conventions</topic>
<topic>API versioning and backward compatibility</topic>
<!-- Additional topics -->
</topics>
<tags>
<tag>api-design</tag>
<tag>rest</tag>
<tag>microservices</tag>
</tags>
</semantic>
</file>
<!-- Additional files in this category -->
</category>
<!-- Additional categories: code, images, presentations, etc. -->
</categories>
<usage_guide>
<direct_read_extensions>md, txt, json, yaml, vtt, go, py, js, ts, png, jpg</direct_read_extensions>
<direct_read_tool>Read tool</direct_read_tool>
<extraction_required_extensions>docx, pptx, pdf</extraction_required_extensions>
<extraction_required_tool>Bash + conversion tools</extraction_required_tool>
</usage_guide>
</memory_index>Abbreviated example showing structure (actual output includes all files):
# Claude Code Agentic Memory Index
π
Generated: 2025-10-05 14:30:24
π Files: 3 | πΎ Total Size: 2.0 MB
π Root: /Users/username/.agentic-memorizer/memory
## π Recent Activity (Last 7 Days)
- 2025-10-04: `documents/api-design-guide.md`
---
## π Documents (1 files, 45.2 KB)
### api-design-guide.md
**Path**: `/Users/username/.agentic-memorizer/memory/documents/api-design-guide.md`
**Modified**: 2025-10-04 | **Size**: 45.2 KB | **Words**: 4,520
**Sections**: Introduction β’ RESTful Principles β’ Versioning Strategies β’ Authentication β’ Error Handling β’ Rate Limiting β’ Documentation β’ Best Practices
**Type**: Markdown β’ Technical-Guide
**Summary**: Comprehensive API design guidelines covering RESTful principles, versioning strategies, authentication patterns, and best practices for building scalable microservices.
**Topics**: RESTful API design principles, API versioning, Authentication patterns, Rate limiting
**Tags**: `api-design` `rest` `microservices` `best-practices`
β Use Read tool directly
## π» Code (1 files, 12.8 KB)
[... similar structure for code files ...]
## πΌοΈ Images (1 files, 1.4 MB)
[... similar structure for images ...]
## Usage Guide
**Reading Files**:
- β
**Direct**: Markdown, text, VTT, JSON, YAML, images, code β Use Read tool
- β οΈ **Extraction needed**: DOCX, PPTX, PDF β Use Bash + conversion toolsagentic-memorizer/
βββ main.go # Main entry point
βββ LICENSE # MIT License
βββ .goreleaser.yaml # GoReleaser configuration for multi-platform releases
βββ cmd/
β βββ root.go # Root command
β βββ initialize/ # Initialization command
β β βββ initialize.go
β βββ daemon/ # Daemon management commands
β β βββ daemon.go # Parent daemon command
β β βββ subcommands/ # Daemon subcommands (8 total)
β β βββ start.go
β β βββ stop.go
β β βββ status.go
β β βββ restart.go
β β βββ rebuild.go
β β βββ logs.go
β β βββ systemctl.go # Generate systemd unit files
β β βββ launchctl.go # Generate launchd plist files
β βββ mcp/ # MCP server commands
β β βββ mcp.go # Parent mcp command
β β βββ subcommands/
β β βββ start.go # Start MCP server
β βββ integrations/ # Integration management commands
β β βββ integrations.go # Parent integrations command
β β βββ subcommands/ # Integration subcommands (6 total)
β β βββ list.go
β β βββ detect.go
β β βββ setup.go
β β βββ remove.go
β β βββ validate.go
β β βββ health.go
β β βββ helpers.go
β βββ config/ # Configuration commands
β β βββ config.go # Parent config command
β β βββ subcommands/ # Config subcommands (2 total)
β β βββ validate.go
β β βββ reload.go
β βββ read/ # Read precomputed index
β β βββ read.go
β βββ version/ # Version command
β βββ version.go
βββ internal/
β βββ config/ # Configuration loading, validation, and hot-reload
β βββ daemon/ # Background daemon implementation and worker pool
β βββ index/ # Index management and atomic writes
β βββ watcher/ # File system watching (fsnotify)
β βββ walker/ # File system traversal with filtering
β βββ metadata/ # File metadata extraction (9 category handlers)
β βββ semantic/ # Claude API integration for semantic analysis
β βββ cache/ # Content-addressable analysis caching
β βββ search/ # Semantic search engine (substring, tag, topic, summary)
β βββ mcp/ # MCP server implementation
β β βββ protocol/ # JSON-RPC 2.0 protocol messages
β β βββ transport/ # Stdio transport layer
β βββ integrations/ # Integration framework and adapters
β β βββ output/ # Output formatting (XML/Markdown/JSON)
β β βββ adapters/ # Framework-specific adapters
β β βββ claude/ # Hook and MCP adapters for Claude Code
β βββ version/ # Version information and embedding
β βββ VERSION # Semantic version file (embedded)
β βββ version.go # Version getters with buildinfo fallback
β βββ version_test.go
βββ scripts/ # Release automation scripts
β βββ bump-version.sh # Semantic version bumping
β βββ prepare-release.sh # Release preparation and automation
βββ pkg/types/ # Shared types and data structures
βββ docs/subsystems/ # Comprehensive subsystem documentation
βββ testdata/ # Test files
# Building
make build # Build binary with version info from git
make install # Build and install to ~/.local/bin
# Testing
make test # Run unit tests only (fast, no external dependencies)
make test-integration # Run integration tests only (requires daemon, slower)
make test-all # Run all tests (unit + integration)
make test-race # Run tests with race detector (important for concurrent code)
make coverage # Generate coverage report
make coverage-html # Generate and view HTML coverage report
# Code Quality
make fmt # Format code with gofmt
make vet # Run go vet
make lint # Run golangci-lint (if installed)
make check # Run all checks (fmt, vet, test-all)
# Utilities
make clean # Remove build artifacts
make clean-cache # Remove cache files only
make deps # Update dependenciesTest Types:
- Unit tests (
make test) - Fast, no external dependencies - Integration tests (
make test-integration) - Full daemon lifecycle, requires-tags=integration - Integration tests use
MEMORIZER_APP_DIRfor isolated environments - Test data in
testdata/directory
- Create handler in
internal/metadata/ - Implement
FileHandlerinterface:type FileHandler interface { Extract(path string, info os.FileInfo) (*types.FileMetadata, error) CanHandle(ext string) bool }
- Register in
internal/metadata/extractor.go
See existing handlers for examples.
-
API Costs: Semantic analysis uses Claude API calls (costs apply)
- Mitigated by caching (only analyzes new/modified files)
- Can disable semantic analysis in config:
analysis.enable: falsefor metadata-only mode
-
File Size Limit: Default 10MB max for semantic analysis
- Configurable via
analysis.max_file_sizein config - Larger files are indexed with metadata only
- Configurable via
-
Internet Required: Needs connection for Claude API calls
- Cached analyses work offline
- Metadata extraction works offline
-
File Format Support: Limited to formats with extractors
- Common formats covered (docs, images, code, etc.)
- Binary files without extractors get basic metadata only
- Some PPTX files with complex formatting may have incomplete extraction
- PDF page count detection is basic (stub implementation)
- Very large directories (1000+ files) may take time on first run
Set your API key in config or environment:
export ANTHROPIC_API_KEY="your-key-here"- Verify daemon is running:
agentic-memorizer daemon status - Check your framework's integration configuration:
- Claude Code: Check
~/.claude/settings.jsonhas SessionStart hooks configured - Other frameworks: Verify you followed the setup instructions from
agentic-memorizer integrations setup <framework-name>
- Claude Code: Check
- Verify binary path is correct (
~/.local/bin/agentic-memorizeror~/go/bin/agentic-memorizer) - Test manually:
agentic-memorizer read - Check your AI agent's output/logs for errors
- Some settings require daemon restart (see Daemon Configuration section)
- Validate config syntax:
agentic-memorizer config validate - Check daemon logs:
tail -f ~/.agentic-memorizer/daemon.log - If reload fails, restart:
agentic-memorizer daemon restart
When indexing many files:
- Reduce daemon workers:
daemon.workers: 1in config - Lower rate limit:
daemon.rate_limit_per_min: 10in config - Disable semantic analysis temporarily:
analysis.enable: falsein config
Clear cache to force re-analysis of all files:
rm -rf ~/.agentic-memorizer/.cache
agentic-memorizer daemon restartContributions are welcome! To contribute:
- Report Issues: Open an issue on GitHub describing the problem
- Suggest Features: Propose new features via GitHub issues
- Submit Pull Requests: Fork the repo, make changes, and submit a PR
- Follow Standards: Use Go conventions, add tests, update docs
See existing code for examples and patterns.
MIT License - see LICENSE file for details.