Skip to main content

Persistent memory layer for AI coding assistants. Every conversation remembered, every decision searchable.

Project description

MemoTrail

Your AI coding assistant forgets everything. MemoTrail fixes that.

🇨🇳 中文 · 🇹🇼 繁體中文 · 🇯🇵 日本語 · 🇵🇹 Português · 🇰🇷 한국어 · 🇪🇸 Español · 🇩🇪 Deutsch · 🇫🇷 Français · 🇮🇱 עברית · 🇸🇦 العربية · 🇷🇺 Русский · 🇵🇱 Polski · 🇨🇿 Čeština · 🇳🇱 Nederlands · 🇹🇷 Türkçe · 🇺🇦 Українська · 🇻🇳 Tiếng Việt · 🇮🇩 Indonesia · 🇹🇭 ไทย · 🇮🇳 हिन्दी · 🇧🇩 বাংলা · 🇵🇰 اردو · 🇷🇴 Română · 🇸🇪 Svenska · 🇮🇹 Italiano · 🇬🇷 Ελληνικά · 🇭🇺 Magyar · 🇫🇮 Suomi · 🇩🇰 Dansk · 🇳🇴 Norsk

PyPI version Python 3.11+ License: MIT GitHub stars

A persistent memory layer for AI coding assistants. Every session recorded, every decision searchable, every context remembered.

Quick Start · How It Works · Available Tools · Roadmap


What's New in v0.3.0

  • Automatic session summarization — every session gets an AI-generated summary (no API keys needed)
  • Automatic decision extraction — architectural decisions detected from conversations using pattern matching
  • BM25 keyword search — new search_keyword tool for exact terms, error messages, function names
  • Hybrid search — combines semantic + keyword results using reciprocal rank fusion
  • Cursor IDE support — indexes Cursor chat history from state.vscdb files
  • Real-time file watching — new sessions indexed instantly via watchdog (no restart needed)
  • Chunking strategies — choose between token-based, turn-based, or recursive splitting
  • VS Code extension — search, index, and view stats directly from VS Code
  • 69 tests — comprehensive test coverage across all modules

The Problem

Every new Claude Code session starts from zero. Your AI doesn't remember yesterday's 3-hour debugging session, the architectural decisions you made last week, or the approaches that already failed.

Without MemoTrail:

You: "Let's use Redis for caching"
AI:  "Sure, let's set up Redis"
         ... 2 weeks later, new session ...
You: "Why are we using Redis?"
AI:  "I don't have context on that decision"

With MemoTrail:

You: "Why are we using Redis?"
AI:  "Based on session from Jan 15 — you evaluated Redis vs Memcached.
      Redis was chosen for its data structure support and persistence.
      The discussion is in session #42."

Quick Start

# 1. Install
pip install memotrail

# 2. Connect to Claude Code (current project)
claude mcp add memotrail -- memotrail serve

# Or connect globally (all projects)
claude mcp add -s user memotrail -- memotrail serve

That's it. MemoTrail automatically indexes your history on first launch. Start a new session and ask: "What did we work on last week?"

MemoTrail Demo

How It Works

Step What happens
1. Record MemoTrail auto-indexes new sessions on startup + watches for new files in real-time
2. Chunk Conversations are split using token, turn-based, or recursive strategies
3. Embed Each chunk is embedded using all-MiniLM-L6-v2 (~80MB, runs on CPU)
4. Extract Summaries and architectural decisions are automatically extracted
5. Store Vectors go to ChromaDB, metadata to SQLite — all under ~/.memotrail/
6. Search Semantic + BM25 keyword search across your full history
7. Surface The most relevant past context appears right when you need it

100% local — no cloud, no API keys, no data leaves your machine.

Project-aware — each project's conversations are stored separately. Search within a single project or across all projects at once.

Multi-platform — supports Claude Code and Cursor IDE, with more coming soon.

Available Tools

Once connected, Claude Code gets these MCP tools:

Tool Description
search_chats Semantic search across all past conversations
search_keyword BM25 keyword search — great for exact terms, function names, error messages
get_decisions Retrieve recorded architectural decisions (auto-extracted + manual)
get_recent_sessions List recent coding sessions with AI-generated summaries
get_session_detail Deep dive into a specific session's content
save_memory Manually save important facts or decisions
memory_stats View indexing statistics and storage usage

CLI Commands

memotrail serve                          # Start MCP server (auto-indexes new sessions)
memotrail search "redis caching decision"  # Search from terminal
memotrail stats                          # View indexing stats
memotrail index                          # Manually re-index (optional)

Architecture

~/.memotrail/
├── chroma/          # Vector embeddings (ChromaDB)
└── memotrail.db     # Session metadata (SQLite)
Component Technology Details
Embeddings all-MiniLM-L6-v2 ~80MB, runs on CPU
Vector DB ChromaDB Persistent, local storage
Keyword Search BM25 Pure Python, no extra dependencies
Metadata SQLite Single-file database
File Watching watchdog Real-time session detection
Protocol MCP Model Context Protocol

Supported Platforms

Platform Status Format
Claude Code Supported JSONL session files
Cursor IDE Supported state.vscdb (SQLite)
GitHub Copilot Planned

Chunking Strategies

Strategy Best for
token (default) General use — groups messages up to token limit
turn Conversation-focused — groups user+assistant pairs
recursive Long content — splits on paragraphs, sentences, words

Why MemoTrail?

MemoTrail CLAUDE.md / Rules files Manual notes
Automatic Yes — indexes on every session start No — you write it No
Searchable Semantic search AI reads it, but only what you wrote Ctrl+F only
Scales Thousands of sessions Single file Scattered files
Context-aware Returns relevant context Static rules Manual lookup
Setup 5 minutes Always maintained Always maintained

MemoTrail doesn't replace CLAUDE.md — it complements it. Rules files are for instructions. MemoTrail is for memory.

Roadmap

  • Claude Code session indexing
  • Semantic search across conversations
  • MCP server with 7 tools
  • CLI for indexing and searching
  • Auto-indexing on server startup (no manual memotrail index needed)
  • Automatic decision extraction
  • Session summarization
  • Cursor IDE collector
  • BM25 keyword search + hybrid search
  • Real-time file watching (watchdog)
  • Multiple chunking strategies (token, turn, recursive)
  • VS Code extension
  • Copilot collector
  • Cloud sync (Pro)
  • Team memory (Team)

VS Code Extension

MemoTrail includes a VS Code extension for direct IDE integration.

Commands available:

  • MemoTrail: Search Conversations — semantic search
  • MemoTrail: Keyword Search — BM25 keyword search
  • MemoTrail: Recent Sessions — view session stats
  • MemoTrail: Index Sessions Now — trigger manual indexing
  • MemoTrail: Show Stats — display indexing statistics

Setup:

cd vscode-extension
npm install
npm run compile
# Then press F5 in VS Code to launch Extension Development Host

Development

git clone https://github.com/HalilHopa-Datatent/memotrail.git
cd memotrail
pip install -e ".[dev]"
pytest
ruff check src/

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Good first issues:

  • Add GitHub Copilot session collector
  • Add Windsurf/Codeium session collector
  • Add cloud sync option (opt-in)
  • Add team memory sharing

License

MIT — see LICENSE


Built by Halil Hopa · memotrail.ai

If MemoTrail helps you, consider giving it a star on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memotrail-0.3.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memotrail-0.3.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file memotrail-0.3.1.tar.gz.

File metadata

  • Download URL: memotrail-0.3.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for memotrail-0.3.1.tar.gz
Algorithm Hash digest
SHA256 95e14c479aea43e79f863f81b740b4715d038494c22170dcc5182aac7cb51e64
MD5 df47afba801a52641734c9298a3973ec
BLAKE2b-256 71ecd6334c591422a3021343de79f07187500e410d04d9dc69e1583da7d17d33

See more details on using hashes here.

File details

Details for the file memotrail-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: memotrail-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for memotrail-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b3658da4332d30f6be6665ecb9ed65577adc60dac95be7555a5a8d96676f737
MD5 2b494040cc2f32aff4f0378bb8ef58cd
BLAKE2b-256 bce5e211f75e27d0543ddb38f59403c91b46f5b61aa3e03220e53899cc4af435

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page