Skip to content

Persistent semantic memory for Claude Code via Qdrant. Store, search, and retrieve context across sessions.

License

Notifications You must be signed in to change notification settings

Hidden-History/ai-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

110 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🧠 AI-Memory

AI-Memory Banner

Version 2.0.5 Stars License Issues PRs Welcome


Cure AI Amnesia.

AI-Memory is a persistent context layer designed to give your agents institutional memory. By bridging LLMs with a high-performance vector database (Qdrant), this framework ensures your agents remember architectural decisions, project rules, and past interactions across every session.

Explore the Docs | Report a Bug | Request a Feature


πŸš€ Key Features

  • πŸ’Ύ Long-Term Persistence: Stop re-explaining your codebase. Agents retrieve past context automatically at session start.
  • πŸ“‚ Structured BMAD Integration: Purpose-built for BMAD workflows and multi-agent "Party Mode."
  • πŸ” Semantic Retrieval: Uses vector embeddings to find relevant memories based on intent, not just keywords.
  • βš–οΈ Decision Tracking: Automatically captures "lessons learned" and integration rules during the dev cycle.

🧬 Bespoke Neural Memory

This isn't a database you configure. It's institutional memory that forms as you build.

Traditional knowledge bases require upfront schema design and manual curation. AI-Memory takes a different approach: let the LLM and human decide what matters, and capture it as it happens.

🎯 Error fixed? Captured. πŸ“ Architecture decision made? Stored. πŸ“ Convention established? Remembered.

Your agents don't just executeβ€”they learn.

Aspect Benefit
🎨 Bespoke Memory unique to YOUR project
⚑ JIT Creation Emerges from work, not config
πŸ’« Transient β†’ Persistent Sessions become knowledge
πŸͺΆ Token Efficient ~500 token focused memories
πŸš€ Lightweight Docker + Qdrant + Python

✨ V2.0 Memory System

  • πŸ—‚οΈ Three Specialized Collections: code-patterns (HOW), conventions (WHAT), discussions (WHY)
  • 🎯 17 Memory Types: Precise categorization for implementation, errors, decisions, Jira issues, and more
  • ⚑ 6 Automatic Triggers: Smart context injection when you need it most
  • πŸ” Intent Detection: Automatically routes queries to the right collection
  • πŸ’¬ Conversation Memory: Turn-by-turn capture with post-compaction context continuity
  • πŸ” Cascading Search: Falls back across collections for comprehensive results
  • πŸ“Š Monitoring: Prometheus metrics + Grafana dashboards
  • πŸ›‘οΈ Graceful Degradation: Works even when services are temporarily unavailable
  • πŸ‘₯ Multi-Project Isolation: group_id filtering keeps projects separate

New here? Jump to Quick Start to get running in 5 minutes.


πŸ”— Jira Cloud Integration

Bring your work context into semantic memory with built-in Jira Cloud support:

  • Semantic Search: Search Jira issues and comments by meaning, not just keywords
  • Full & Incremental Sync: Initial backfill or fast daily updates via JQL
  • ADF Conversion: Atlassian Document Format β†’ plain text for accurate embeddings
  • Rich Filtering: Search by project, issue type, status, priority, or author
  • Issue Lookup: Retrieve complete issue context (issue + all comments, chronologically)
  • Dedicated Collection: jira-data collection keeps Jira content separate from code memory
  • Tenant Isolation: group_id based on Jira instance hostname prevents cross-instance leakage
  • Two Skills: /jira-sync for synchronization, /search-jira for semantic search

See docs/JIRA-INTEGRATION.md for setup and usage guide.


πŸ”¬ Knowledge Discovery

Best Practices Researcher

When you ask "how should I..." or "what's the best way to...", AI-Memory's best-practices-researcher activates:

  1. Search Local Knowledge - Checks the conventions collection first
  2. Web Research - Searches 2024-2026 sources if needed
  3. Save Findings - Stores to oversight/knowledge/best-practices/BP-XXX.md
  4. Database Storage - Adds to Qdrant for future retrieval
  5. Skill Evaluation - Determines if findings warrant a reusable skill

Skill Creator Agent

When research reveals a repeatable process, the skill-creator agent can generate a Claude Code skill:

User: "Research best practices for writing commit messages"
β†’ Best Practices Researcher finds patterns
β†’ Evaluates: "This is a repeatable process with clear steps"
β†’ User confirms: "Yes, create a skill"
β†’ Skill Creator generates .claude/skills/writing-commits/SKILL.md

The Result: Your AI agents continuously discover and codify knowledge into reusable skills.


πŸ›‘οΈ Complete Your AI Stack: Parzival Oversight Agent

Memory is only half the equation. Quality is the other half.

AI-Memory gives your agents institutional knowledge. Parzival ensures they use it wisely.

🎯 Quality Gatekeeper β€” Never ship bugs, always verify before approval πŸ”„ Review Cycles β€” Automated review β†’ fix β†’ verify loops 🚫 Drift Prevention β€” Behavioral constraints keep agents on track πŸ“‹ Structured Oversight β€” Templates for bugs, decisions, specs, tracking πŸ“Š Observability Built-In β€” Metrics, logging, Grafana dashboards from day one

Parzival recommends. You decide.

Component Purpose
🧠 AI-Memory Remembers β€” Context persistence
πŸ›‘οΈ Parzival Validates β€” Quality assurance
πŸ”— Together Agents that learn AND verify

Memory + Oversight = Reliable AI

β†’ Get Parzival

Works with BMAD Method β€” Enhances BMAD workflows with persistent memory, but works standalone with any Claude Code project.


πŸ—οΈ Architecture

V2.0 Memory System

Claude Code Session
    β”œβ”€β”€ SessionStart Hooks (resume|compact) β†’ Context injection on session resume and post-compaction
    β”œβ”€β”€ UserPromptSubmit Hooks β†’ Unified keyword trigger (decisions/best practices/session history)
    β”œβ”€β”€ PreToolUse Hooks β†’ Smart triggers (new file/first edit conventions)
    β”œβ”€β”€ PostToolUse Hooks β†’ Capture code patterns + error detection
    β”œβ”€β”€ PreCompact Hook β†’ Save conversation before compaction
    └── Stop Hook β†’ Capture agent responses

Python Core (src/memory/)
    β”œβ”€β”€ config.py         β†’ Environment configuration
    β”œβ”€β”€ storage.py        β†’ Qdrant CRUD operations
    β”œβ”€β”€ search.py         β†’ Semantic search + cascading
    β”œβ”€β”€ intent.py         β†’ Intent detection + routing
    β”œβ”€β”€ triggers.py       β†’ Automatic trigger configuration
    β”œβ”€β”€ embeddings.py     β†’ Jina AI embeddings (768d)
    └── deduplication.py  β†’ Hash + similarity dedup

Docker Services
    β”œβ”€β”€ Qdrant (port 26350)
    β”œβ”€β”€ Embedding Service (port 28080)
    β”œβ”€β”€ Classifier Worker (LLM reclassification)
    β”œβ”€β”€ Streamlit Dashboard (port 28501)
    └── Monitoring Stack (--profile monitoring)
        β”œβ”€β”€ Prometheus (port 29090)
        β”œβ”€β”€ Pushgateway (port 29091)
        └── Grafana (port 23000)

Collection Structure

Collection Purpose Example Types
code-patterns HOW things are built implementation, error_fix, refactor
conventions WHAT rules to follow rule, guideline, naming, structure
discussions WHY things were decided decision, session, preference
jira-data External work items from Jira Cloud jira_issue, jira_comment

Note: The jira-data collection is conditional β€” it is only created when Jira sync is enabled (JIRA_SYNC_ENABLED=true).

Automatic Triggers

The memory system automatically retrieves relevant context:

  • Error Detection: When a command fails, retrieves past error fixes
  • New File Creation: Retrieves naming conventions and structure patterns
  • First Edit: Retrieves file-specific patterns on first modification
  • Decision Keywords: "Why did we..." triggers decision memory retrieval
  • Best Practices Keywords: "How should I..." triggers convention retrieval
  • Session History Keywords: "What have we done..." triggers session summary retrieval

Trigger Keyword Reference

The following keywords automatically activate memory retrieval when detected in your prompts:

Decision Keywords (20 patterns) β†’ Searches discussions for past decisions
Category Keywords
Decision recall why did we, why do we, what was decided, what did we decide
Memory recall remember when, remember the decision, remember what, remember how, do you remember, recall when, recall the, recall how
Session references last session, previous session, earlier we, before we, previously, last time we, what did we do, where did we leave off
Session History Keywords (16 patterns) β†’ Searches discussions for session summaries
Category Keywords
Project status what have we done, what did we work on, project status, where were we, what's the status
Continuation continue from, pick up where, continue where
Remaining work what's left to do, remaining work, what's next for, what's next on, what's next in the, next steps, todo, tasks remaining
Best Practices Keywords (27 patterns) β†’ Searches conventions for guidelines
Category Keywords
Standards best practice, best practices, coding standard, coding standards, convention, conventions for
Patterns what's the pattern, what is the pattern, naming convention, style guide
Guidance how should i, how do i, what's the right way, what is the right way
Research research the pattern, research best practice, look up, find out about, what do the docs say
Recommendations should i use, what's recommended, what is recommended, recommended approach, preferred approach, preferred way, industry standard, common pattern

Note: Keywords are case-insensitive. Only structured patterns trigger retrieval to avoid false positives on casual conversation.

LLM Memory Classifier

The optional LLM Classifier automatically reclassifies captured memories into more precise types:

  • Rule-based first: Fast pattern matching (free, <10ms)
  • LLM fallback: AI classification when rules don't match
  • Provider chain: Primary provider with automatic fallback

Quick Setup:

# Configure in docker/.env
MEMORY_CLASSIFIER_ENABLED=true
MEMORY_CLASSIFIER_PRIMARY_PROVIDER=ollama    # or: openrouter, claude, openai
MEMORY_CLASSIFIER_FALLBACK_PROVIDERS=openrouter

# For Ollama (free, local)
OLLAMA_BASE_URL=http://host.docker.internal:11434
OLLAMA_MODEL=sam860/LFM2:2.6b

# For OpenRouter (free tier available)
OPENROUTER_API_KEY=sk-or-v1-your-key
OPENROUTER_MODEL=google/gemma-2-9b-it:free

See docs/llm-classifier.md for complete setup guide, provider options, and troubleshooting.

πŸš€ Quick Start

1. Start Services

# Core services (Qdrant + Embedding)
docker compose -f docker/docker-compose.yml up -d

# With monitoring (adds Prometheus, Grafana, Pushgateway)
docker compose -f docker/docker-compose.yml --profile monitoring up -d

2. Verify Services

# Check Qdrant (port 26350)
curl http://localhost:26350/health

# Check Embedding Service (port 28080)
curl http://localhost:28080/health

# Check Grafana (port 23000) - if monitoring enabled
open http://localhost:23000  # admin/admin

3. Install to Project

./scripts/install.sh /path/to/your-project

# With convention seeding (recommended)
SEED_BEST_PRACTICES=true ./scripts/install.sh /path/to/your-project

Expected Output:

═══════════════════════════════════════════════════════════
  AI Memory Module Health Check
═══════════════════════════════════════════════════════════

[1/3] Checking Qdrant (localhost:26350)...
  βœ… Qdrant is healthy

[2/3] Checking Embedding Service (localhost:28080)...
  βœ… Embedding service is healthy

[3/3] Checking Monitoring API (localhost:28000)...
  βœ… Monitoring API is healthy

═══════════════════════════════════════════════════════════
  All Services Healthy βœ…
═══════════════════════════════════════════════════════════

πŸ“¦ Installation

Prerequisites

  • Python 3.10+ (3.11+ required for AsyncSDKWrapper)
  • Docker 20.10+ (for Qdrant + embedding service)
  • Claude Code (target project where memory will be installed)

Installation Steps

See INSTALL.md for detailed installation instructions including:

  • System requirements with version compatibility
  • Step-by-step installation for macOS, Linux, and Windows (WSL2)
  • Automated installer and manual installation methods
  • Post-installation verification
  • Configuration options
  • Uninstallation procedures

βš™οΈ Configuration

πŸ”Œ Service Ports

All services use 2XXXX prefix to avoid conflicts:

Service External Internal Access URL
Qdrant 26350 6333 localhost:26350
Embedding 28080 8080 localhost:28080/embed
Monitoring API 28000 8000 localhost:28000/health
Streamlit 28501 8501 localhost:28501
Grafana 23000 3000 localhost:23000
Prometheus 29090 9090 localhost:29090 (--profile monitoring)
Pushgateway 29091 9091 localhost:29091 (--profile monitoring)

Environment Variables

Variable Default Description
QDRANT_HOST localhost Qdrant server hostname
QDRANT_PORT 26350 Qdrant external port
EMBEDDING_HOST localhost Embedding service hostname
EMBEDDING_PORT 28080 Embedding service port
AI_MEMORY_INSTALL_DIR ~/.ai-memory Installation directory
MEMORY_LOG_LEVEL INFO Logging level (DEBUG/INFO/WARNING)

Jira Cloud Integration (Optional):

Variable Default Description
JIRA_INSTANCE_URL (empty) Jira Cloud URL (e.g., https://company.atlassian.net)
JIRA_EMAIL (empty) Jira account email for Basic Auth
JIRA_API_TOKEN (empty) API token from id.atlassian.com
JIRA_PROJECTS (empty) Comma-separated project keys (e.g., PROJ,DEV,OPS)
JIRA_SYNC_ENABLED false Enable Jira synchronization
JIRA_SYNC_DELAY_MS 100 Delay between API requests (ms)

See docs/JIRA-INTEGRATION.md for complete Jira setup guide.

Override Example:

export QDRANT_PORT=16333  # Use custom port
export MEMORY_LOG_LEVEL=DEBUG  # Enable verbose logging

πŸ’‘ Usage

πŸ”§ Automatic Memory Capture

Memory capture happens automatically via Claude Code hooks:

  1. SessionStart (resume/compact only): Injects relevant memories when resuming a session or after context compaction
  2. PostToolUse: Captures code patterns (Write/Edit/NotebookEdit tools) in background (<500ms)
  3. PreCompact: Saves session summary before context compaction (auto or manual /compact)
  4. Stop: Optional per-response cleanup

No manual intervention required - hooks handle everything.

The "Aha Moment": Claude remembers your previous sessions automatically. Start a new session and Claude will say "Welcome back! Last session we worked on..." without you reminding it.

🎯 Manual Memory Operations

Use slash commands for manual control:

# Check system status
/memory-status

# Manually save current session
/save-memory

# Search across all memories
/search-memory <query>

# Jira Cloud Integration (requires JIRA_SYNC_ENABLED=true)
/jira-sync              # Incremental sync from Jira
/jira-sync --full       # Full sync (all issues and comments)
/search-jira "query"    # Semantic search across Jira content
/search-jira --issue PROJ-42  # Lookup issue + all comments

See docs/HOOKS.md for hook documentation, docs/COMMANDS.md for commands, docs/llm-classifier.md for LLM classifier setup, and docs/JIRA-INTEGRATION.md for Jira integration guide.

πŸ€– AsyncSDKWrapper (Agent SDK Integration)

The AsyncSDKWrapper provides full async/await support for building custom Agent SDK agents with persistent memory.

Features:

  • Full async/await support compatible with Agent SDK
  • Rate limiting with token bucket algorithm (Tier 1: 50 RPM, 30K TPM)
  • Exponential backoff retry with jitter (3 retries: 1s, 2s, 4s Β±20%)
  • Automatic conversation capture to discussions collection
  • Background storage (fire-and-forget pattern)
  • Prometheus metrics integration

Basic Usage:

import asyncio
from src.memory import AsyncSDKWrapper

async def main():
    async with AsyncSDKWrapper(cwd="/path/to/project") as wrapper:
        # Send message with automatic rate limiting and retry
        result = await wrapper.send_message(
            prompt="What is async/await?",
            model="claude-sonnet-4-5-20250929",
            max_tokens=500
        )

        print(f"Response: {result['content']}")
        print(f"Session ID: {result['session_id']}")

asyncio.run(main())

Streaming Responses (Buffered):

Note: Current implementation buffers the full response for retry reliability. True progressive streaming planned for future release.

async with AsyncSDKWrapper(cwd="/path/to/project") as wrapper:
    async for chunk in wrapper.send_message_buffered(
        prompt="Explain Python async",
        model="claude-sonnet-4-5-20250929",
        max_tokens=800
    ):
        print(chunk, end='', flush=True)

Custom Rate Limits:

async with AsyncSDKWrapper(
    cwd="/path/to/project",
    requests_per_minute=100,   # Tier 2
    tokens_per_minute=100000   # Tier 2
) as wrapper:
    result = await wrapper.send_message("Hello!")

Examples:

  • examples/async_sdk_basic.py - Basic async/await usage, context manager pattern, session ID logging, rate limiting demonstration
  • examples/async_sdk_streaming.py - Streaming response handling (buffered), progressive chunk processing, retry behavior
  • examples/async_sdk_rate_limiting.py - Custom rate limit configuration, queue depth/timeout settings, error handling for different API tiers

Configuration:

Set ANTHROPIC_API_KEY environment variable before using AsyncSDKWrapper:

export ANTHROPIC_API_KEY=sk-ant-api03-...

Rate Limiting:

The wrapper implements token bucket algorithm matching Anthropic's rate limits:

Tier Requests/Min Tokens/Min
Free 5 10,000
Tier 1 50 (default) 30,000 (default)
Tier 2 100 100,000
Tier 3+ 1,000+ 400,000+

Circuit breaker protections:

  • Max queue depth: 100 requests
  • Queue timeout: 60 seconds
  • Raises QueueTimeoutError or QueueDepthExceededError if exceeded

Retry Strategy:

Automatic exponential backoff retry (DEC-029):

  • Max retries: 3
  • Delays: 1s, 2s, 4s (with Β±20% jitter)
  • Retries on: 429 (rate limit), 529 (overload), network errors
  • No retry on: 4xx client errors (except 429), auth failures
  • Respects retry-after header when provided

Memory Capture:

All messages are automatically captured to the discussions collection:

  • User messages β†’ user_message type
  • Agent responses β†’ agent_response type
  • Background storage (non-blocking)
  • Session-based grouping with turn numbers

See src/memory/async_sdk_wrapper.py for complete API documentation.

For complete design rationale, see oversight/specs/tech-debt-035/phase-2-design.md.

πŸ‘₯ Multi-Project Support

Memories are automatically isolated by group_id (derived from project directory):

# Project A: group_id = "project-a"
# Project B: group_id = "project-b"
# Searches only return memories from current project

V2.0 Collection Isolation:

  • code-patterns: Implementation patterns (per-project isolation)
  • conventions: Coding standards and rules (shared across projects by default)
  • discussions: Decisions, sessions, conversations (per-project isolation)

πŸ”§ Troubleshooting

Common Issues

See TROUBLESHOOTING.md for comprehensive troubleshooting, including:

  • Services won't start
  • Health check failures
  • Memories not captured
  • Search not working
  • Performance problems
  • Data persistence issues

Recovery Script

If hooks are misbehaving (e.g., after a failed install or upgrade), use the recovery script to scan and repair all project configurations:

# Dry-run: shows what would change (safe, no modifications)
python scripts/recover_hook_guards.py

# Apply fixes across all discovered projects
python scripts/recover_hook_guards.py --apply

# Scan only: list all discovered project settings.json files
python scripts/recover_hook_guards.py --scan

The recovery script automatically discovers projects via:

  1. ~/.ai-memory/installed_projects.json manifest (primary)
  2. Sibling directories of AI_MEMORY_INSTALL_DIR (fallback)
  3. Common project paths (additional fallback)

It fixes: unguarded hook commands (BUG-066), broad SessionStart matchers (BUG-078), and other known configuration issues. Always run with dry-run first to review changes.

Quick Diagnostic Commands

# Check all services
docker compose -f docker/docker-compose.yml ps

# Check logs
docker compose -f docker/docker-compose.yml logs

# Check health
python scripts/health-check.py

# Check ports
lsof -i :26350  # Qdrant
lsof -i :28080  # Embedding
lsof -i :28000  # Monitoring API

Services Won't Start

Symptom: docker compose up -d fails or services exit immediately

Solution:

  1. Check port availability:

    lsof -i :26350  # Qdrant
    lsof -i :28080  # Embedding
  2. Check Docker logs:

    docker compose -f docker/docker-compose.yml logs
  3. Ensure Docker daemon is running:

    docker ps  # Should not error

Health Check Fails

Symptom: python scripts/health-check.py shows unhealthy services

Solution:

  1. Check service status:

    docker compose -f docker/docker-compose.yml ps
  2. Verify ports are accessible:

    curl http://localhost:26350/health  # Qdrant
    curl http://localhost:28080/health  # Embedding
  3. Check logs for errors:

    docker compose -f docker/docker-compose.yml logs qdrant
    docker compose -f docker/docker-compose.yml logs embedding

Memories Not Captured

Symptom: PostToolUse hook doesn't store memories

Solution:

  1. Check hook configuration in .claude/settings.json:

    {
      "hooks": {
        "PostToolUse": [{
          "matcher": "Write|Edit",
          "hooks": [{"type": "command", "command": ".claude/hooks/scripts/post_tool_capture.py"}]
        }]
      }
    }
  2. Verify hook script is executable:

    ls -la .claude/hooks/scripts/post_tool_capture.py
    chmod +x .claude/hooks/scripts/post_tool_capture.py
  3. Check hook logs (if logging enabled):

    cat ~/.ai-memory/logs/hook.log

For more detailed troubleshooting, see TROUBLESHOOTING.md.

πŸ“Š Monitoring

Grafana Dashboards (V3)

Access Grafana at http://localhost:23000 (admin/admin):

Dashboard Purpose
NFR Performance Overview All 6 NFR metrics with SLO compliance
Hook Activity Hook execution rates, latency heatmaps
Memory Operations Captures, retrievals, deduplication
System Health Service status, error rates

Performance Targets (NFRs)

NFR Metric Target
NFR-P1 Hook execution <500ms
NFR-P2 Batch embedding <2s
NFR-P3 Session injection <3s
NFR-P4 Dedup check <100ms
NFR-P5 Retrieval query <500ms
NFR-P6 Real-time embedding <500ms

Service Ports

Service Port
Grafana 23000
Prometheus 29090
Pushgateway 29091

Key Metrics

All metrics use aimemory_ prefix (BP-045 compliant):

Metric Description
aimemory_hook_duration_seconds Hook execution time (NFR-P1)
aimemory_captures_total Total memory capture attempts
aimemory_retrievals_total Total retrieval operations
aimemory_trigger_fires_total Automatic trigger activations

See docs/MONITORING.md for complete monitoring guide and docs/prometheus-queries.md for query examples.

πŸ’Ύ Backup & Restore

Protect your AI memories with built-in backup and restore scripts.

Quick Backup

# Setup (one-time)
cd /path/to/ai-memory
python3 -m venv .venv && source .venv/bin/activate
pip install httpx

# Get your Qdrant API key
cat ~/.ai-memory/docker/.env | grep QDRANT_API_KEY
export QDRANT_API_KEY="your-key-here"

# Run backup
python scripts/backup_qdrant.py

Backups are stored in backups/ directory with timestamped folders containing:

  • Collection snapshots (discussions, conventions, code-patterns)
  • Configuration files
  • Verification manifest

Quick Restore

python scripts/restore_qdrant.py backups/2026-02-03_143052

See docs/BACKUP-RESTORE.md for complete instructions including troubleshooting.

Coming soon: Backup and restore scripts will be updated in the next version to support the jira-data collection, including Jira database backup and reinstall.

πŸ“ˆ Performance

⚑ Benchmarks

  • Hook overhead: <500ms (PostToolUse forks to background)
  • Embedding generation: <2s (pre-warmed Docker service)
  • SessionStart context injection: <3s
  • Deduplication check: <100ms

Optimization Tips

  1. Enable monitoring profile for production use:

    docker compose -f docker/docker-compose.yml --profile monitoring up -d
  2. Adjust batch size for large projects:

    export MEMORY_BATCH_SIZE=100  # Default: 50
  3. Increase cache TTL for stable projects:

    export MEMORY_CACHE_TTL=3600  # Default: 1800 seconds

πŸ› οΈ Development

πŸ§ͺ Running Tests

# Run all tests
pytest tests/

# Run specific test file
pytest tests/test_storage.py -v

# Run integration tests only
pytest tests/integration/ -v

Project Structure

ai-memory/
β”œβ”€β”€ src/memory/          # Core Python modules
β”œβ”€β”€ .claude/
β”‚   β”œβ”€β”€ hooks/scripts/   # Hook implementations
β”‚   └── skills/          # Skill definitions
β”œβ”€β”€ docker/              # Docker Compose and service configs
β”œβ”€β”€ scripts/             # Installation and management scripts
β”œβ”€β”€ tests/               # pytest test suite
└── docs/                # Additional documentation

Coding Conventions

  • Python (PEP 8 Strict): Files snake_case.py, Functions snake_case(), Classes PascalCase, Constants UPPER_SNAKE
  • Qdrant Payload Fields: Always snake_case (content_hash, group_id, source_hook)
  • Structured Logging: Use logger.info("event", extra={"key": "value"}), never f-strings
  • Hook Exit Codes: 0 (success), 1 (non-blocking error), 2 (blocking error - rare)
  • Graceful Degradation: All components must fail silently - Claude works without memory

See CONTRIBUTING.md for complete development setup and coding standards.

🀝 Contributing

We welcome contributions! To contribute:

  1. Fork the repository and create a feature branch
  2. Follow coding conventions (see Development section above)
  3. Write tests for all new functionality
  4. Ensure all tests pass: pytest tests/
  5. Update documentation if adding features
  6. Submit a pull request with a clear description

See CONTRIBUTING.md for detailed development setup and pull request process.

πŸ“„ License

MIT License - see LICENSE for details.


Accessibility

This documentation follows WCAG 2.2 Level AA accessibility standards (ISO/IEC 40500:2025):

  • βœ… Proper heading hierarchy (h1 β†’ h2 β†’ h3)
  • βœ… Descriptive link text (no "click here")
  • βœ… Code blocks with language identifiers
  • βœ… Tables with headers for screen readers
  • βœ… Consistent bullet style (hyphens)
  • βœ… ASCII art diagrams for universal compatibility

For accessibility concerns or suggestions, please open an issue.


Documentation Best Practices Applied (2026):

This README follows current best practices for technical documentation:

About

Persistent semantic memory for Claude Code via Qdrant. Store, search, and retrieve context across sessions.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •