# VasperaMemory 🧠

**The #1 AI Memory Platform for Developers** — Persistent context across Cursor, Claude, Windsurf & all MCP-compatible AI tools.

[![npm version](https://badge.fury.io/js/vasperamemory.svg)](https://www.npmjs.com/package/vasperamemory)
[![Downloads](https://img.shields.io/npm/dm/vasperamemory.svg)](https://www.npmjs.com/package/vasperamemory)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)

---

## 🚀 One Command. All Your AI Tools Remember.

```bash
npx vasperamemory@latest connect
```

**Enter your email. That's the entire setup.** No website, no copying keys, no config files to edit.

---

## The Problem Every Developer Faces

| Without VasperaMemory | With VasperaMemory |
|----------------------|-------------------|
| "We use Supabase, not Firebase..." (every session) | AI already knows your stack |
| "No mock data, use real APIs..." (again) | Preferences remembered forever |
| "This error? I fixed it last week..." | Previous fix suggested instantly |
| "Don't change that file, it'll break auth" | Impact analysis warns you first |
| Re-explaining architecture every day | Context persists across all tools |

**Developers lose 2-3 hours daily re-explaining context to AI tools.** VasperaMemory eliminates this completely.

---

## ✨ Key Features

### 💰 **Token Savings Metrics**
See exactly how many tokens VasperaMemory saves by compressing your context. Uses **tiktoken** for accurate measurement.
```bash
npx vasperamemory status
# Shows: Compressed: 1.2K tokens | Full history: 8.5K | Saved: 86%
```

### 🏠 **Local-Only Mode**
Run VasperaMemory **100% offline** with local SQLite storage. No cloud, no API keys, complete privacy.
```bash
npx vasperamemory@latest connect --local
```

### 📚 **Documentation Intelligence** ⭐ NEW
Auto-index all your markdown docs with data lineage tracking. Search across specs, guides, and technical docs. Detect knowledge gaps.
```bash
# Auto-indexes docs/ folder on connect
index_documentation → get_indexed_docs → search_docs
```

### 🔗 **File Relationship Analysis** ⭐ NEW
Understand how your files are connected through imports, git co-changes, and test relationships.
```bash
analyze_file_relationships → get_related_files
```

### 🔄 **Auto-Indexing** ⭐ NEW
Automatic entity extraction when files are mentioned. No manual indexing — just use VasperaMemory normally and it builds a knowledge graph in the background.
```bash
# Entities extracted: functions, classes, imports, exports
# Import graph built automatically
# Patterns tracked with file counts
reindex_project  # Manual bulk re-index when needed
```

### 📝 **Git Decision Extraction** ⭐ NEW
Automatically extract architectural decisions from your commit messages. Keywords like "decided", "refactored", "migrated" trigger auto-capture.
```bash
extract_decisions_from_commits
```

### 🤖 **Zero-Effort Context Injection**
Context is **automatically injected** when you start a session. No tools to call — your AI already knows your project, recent decisions, and warnings.

### 🎯 **Smart Intent Router**
Just ask `help_me "Is it safe to change auth.ts?"` — VasperaMemory figures out which tools to call and returns a fused answer. No memorizing 30 tools.

### ⚠️ **Proactive Risk Warnings**
Mention a file? VasperaMemory automatically checks its risk level, known issues, and past problems — warns you before you break something.

### 🔍 **Automatic Error Recognition**
See an error in terminal output? VasperaMemory auto-detects it and suggests past fixes. No searching required.

### 🧠 **Persistent AI Memory**
Your decisions, patterns, and preferences persist across sessions and tools. Tell your AI once, it remembers forever.

### 🔄 **Cross-Tool Sync**
Works with **Cursor**, **Claude Code**, **Windsurf**, **VS Code + Copilot**, **JetBrains**, and any MCP-compatible tool. One memory, all tools.

### ⚡ **Auto-Capture from Git**
Decisions are automatically extracted from your commit messages via git hooks. Zero manual entry — every commit teaches your AI.

### 🔧 **Smart Error Memory**
When you fix an error, that fix is saved. Next time the same error appears, the fix is suggested instantly.

### 📊 **Code Intelligence**
Deep AST analysis: detect design patterns, calculate complexity, find code smells, get architectural insights.

### 🎯 **Impact Analysis**
Before changing code, see what depends on it. Catch breaking changes before they happen.

### ⏳ **Temporal Evolution** ⭐ NEW
Track how your code evolves over time. See entity timelines, detect renames, and identify stability patterns.
```bash
get_entity_evolution → detect_semantic_drift → get_evolution_patterns
```

### 🔮 **Proactive Intelligence** ⭐ NEW
AI-powered pattern detection and change impact prediction. Find similar code across your codebase.
```bash
detect_patterns → predict_change_impact → find_similar_code
```

### 🔗 **Cross-Project Learning**
Patterns that worked in your other projects are automatically suggested in new ones.

### 📋 **Session Continuity**
Every session resumes where you left off: pending work, recent decisions, warnings, and context.

---

## 💻 Supported AI Tools

| Tool | Status | Auto-Setup |
|------|--------|------------|
| **Cursor** | ✅ Full Support | ✅ Auto-configured |
| **Claude Code** | ✅ Full Support | ✅ Auto-configured |
| **Windsurf** | ✅ Full Support | ✅ Auto-configured |
| **VS Code + Copilot** | ✅ Full Support | ✅ Auto-configured |
| **Any MCP Tool** | ✅ Full Support | ✅ Auto-configured |

---

## 🛠️ 40+ AI-Powered Tools

### ⭐ Smart Router (NEW)
- **`help_me`** — Just describe what you need. Automatically routes to the right tools and returns fused results.

### Unified Tools (Most Powerful)
- **`decisions`** — Capture, search, timeline, and recent decisions in one tool
- **`analyze_code`** — Structure, patterns, complexity, smells, insights in one call
- **`memory`** — Capture, search, and fuse context from your project
- **`errors`** — Search fixes, capture new fixes, see recent errors

### 📚 Documentation Intelligence ⭐ NEW
- **`index_documentation`** — Auto-scan and index all markdown docs with data lineage tracking
- **`get_indexed_docs`** — Browse indexed documentation by category (product, technical, guides)
- **`search_docs`** — Full-text search across all project documentation
- **`detect_knowledge_gaps`** — Find areas of your codebase lacking documentation

### 🔗 File Relationships & Auto-Indexing ⭐ NEW
- **`analyze_file_relationships`** — Build relationship graph from imports and git co-changes
- **`get_related_files`** — See what files are related (imports, tests, co-changed)
- **`extract_decisions_from_commits`** — Auto-extract architectural decisions from git history
- **`reindex_project`** — Bulk re-index project files to rebuild entity graph
- **`search_entities`** — Search extracted entities (functions, classes, imports)

### ⏳ Temporal Evolution ⭐ NEW
- **`get_entity_evolution`** — Track how functions/classes change over time with stability scores
- **`detect_semantic_drift`** — Detect when behavior changes without name changes
- **`get_evolution_patterns`** — Identify patterns like "frequent refactoring" or "stable core"
- **`get_unstable_entities`** — Find code that changes too often (high drift risk)

### 🔮 Proactive Intelligence ⭐ NEW
- **`detect_patterns`** — Recognize design patterns (Repository, Factory, Observer, etc.)
- **`predict_change_impact`** — See ripple effects before you modify code
- **`find_similar_code`** — Find similar implementations across your codebase

### Session & Context
- **`resume_session`** — Get full context at conversation start (auto-injected!)
- **`save_session`** — Preserve context for next time
- **`get_file_context`** — Know everything about a file before editing
- **`update_file_context`** — Record file purpose, issues, patterns, and risk level
- **`get_token_savings`** — See how many tokens VasperaMemory saves (tiktoken-accurate)

### Intelligence
- **`suggest_approach`** — Get guidance before starting a task
- **`estimate_change_risk`** — Know what you might break (auto-called when files mentioned!)
- **`get_cross_project_patterns`** — Learn from your other projects
- **`suggest_from_other_projects`** — Get suggestions from similar work

### MCP Resources (Auto-Injection)
- **`vasperamemory://session/context`** — Full session context, auto-available
- **`vasperamemory://project/summary`** — Project overview
- **`vasperamemory://decisions/recent`** — Recent decisions

### And More
- Codebase summary, recent changes, pattern learning, preferences, git sync, feature flags...

---

## 📊 Real Results

> "I used to spend 10 minutes every session explaining our architecture. Now I just start coding."
> — **Senior Engineer, Series B Startup**

> "The error-fix memory is incredible. Found a fix I made 2 months ago in seconds."
> — **Full-Stack Developer**

> "Impact analysis caught 3 potential bugs before I even pushed."
> — **Tech Lead**

**Quantified improvements:**
- ⚡ **40% reduction** in context re-explanation time
- 🐛 **50% fewer** repeated errors
- 🎯 **35% faster** prototype-to-MVP cycles
- 💡 **80% reduction** in manual prompt engineering

---

## 🔒 Security

- **Local-only mode** — Keep all data on your machine with `--local` flag
- **Your code stays local** — We store memories, not your codebase
- **Project isolation** — Row-level security keeps projects separate
- **Enterprise security** — Following industry best practices
- **Self-hostable** — Run on your own infrastructure (coming soon)

---

## ⚡ Quick Start

### Just One Command
```bash
npx vasperamemory@latest connect
```

**That's it!** Enter your email when prompted → API key is generated automatically → All your AI tools are configured.

No website signup required. No copying keys. Just your email.

---

## 📋 CLI Commands

```bash
# Cloud mode (default) — enter email when prompted
npx vasperamemory@latest connect

# Local-only mode — no cloud, no API keys, 100% private
npx vasperamemory@latest connect --local

# Check connection status
npx vasperamemory status

# Sync git history to capture decisions (optional - git hooks do this automatically)
npx vasperamemory sync

# Disconnect this project
npx vasperamemory disconnect

# View help
npx vasperamemory --help
```

**Cloud mode:** Enter your email → API key generated automatically → All AI tools configured

**Local mode:** SQLite database → FTS5 search → No external dependencies → Data at `~/.vasperamemory/local/`

**Both modes auto-configure:** Cursor, Claude Code, Windsurf, VS Code

---

## 🆚 Why VasperaMemory Wins

| Feature | VasperaMemory | GitHub Copilot | Cursor | Others |
|---------|---------------|----------------|--------|--------|
| **Auto context injection** | ✅ **Automatic** | ❌ None | ❌ None | ❌ |
| **Auto-indexing** | ✅ **Background entity extraction** | ❌ None | ❌ None | ❌ |
| **Token savings metrics** | ✅ **tiktoken-accurate** | ❌ None | ❌ None | ❌ |
| **Proactive warnings** | ✅ **Auto-detects risk** | ❌ None | ❌ None | ❌ |
| **Smart intent routing** | ✅ **help_me tool** | ❌ None | ❌ None | ❌ |
| Persistent memory | ✅ Forever | ❌ Session only | ❌ Session only | ❌ |
| Cross-tool sync | ✅ All tools | ❌ VS Code only | ❌ Cursor only | ❌ |
| Auto-capture decisions | ✅ Git hooks | ❌ None | ❌ None | ❌ |
| Error fix memory | ✅ Auto-suggests | ❌ None | ❌ None | ❌ |
| Impact analysis | ✅ Before changes | ❌ None | ❌ None | ❌ |
| Cross-project learning | ✅ Portfolio-wide | ❌ None | ❌ None | ❌ |
| Code intelligence (AST) | ✅ Deep analysis | ⚠️ Basic | ⚠️ Basic | ❌ |
| Session continuity | ✅ Full context | ❌ Cold start | ❌ Cold start | ❌ |
| **Setup time** | ✅ **3 minutes** | - | - | - |

---

## 🏢 Team Memory Hub ⭐ NEW

Share AI memory across your entire development team:

```bash
# Create a team
npx vasperamemory team create "Acme Engineering"

# Invite team members
npx vasperamemory team invite teammate@company.com

# Join a team (via invite link)
npx vasperamemory team join <invite-token>

# Link current project to team
npx vasperamemory team connect <team-id>

# View team activity
npx vasperamemory team activity
```

**Team features include:**
- **Shared Memory** — Decisions, patterns, and fixes sync across all team members
- **Instant Onboarding** — New devs get full project context in minutes, not weeks
- **Conflict Detection** — Automatically detect when memories contradict each other
- **Activity Feed** — See what your team is learning in real-time
- **Role-Based Access** — Owner, admin, member, viewer roles
- **Multi-Project Support** — Link multiple projects to one team

---

## 📦 Build Your Own AI Apps

VasperaMemory provides SDKs to add persistent memory to your own AI applications:

| SDK | Package | Integrations |
|-----|---------|--------------|
| **Python** | `pip install vasperamemory` | LangChain, LlamaIndex |
| **TypeScript** | `npm install vasperamemory-sdk` | Vercel AI SDK |

See [SDK Documentation](https://vasperamemory.com/docs/sdk) for usage examples.

---

## 🤝 Contributing

VasperaMemory CLI and SDKs are open source (MIT License). We welcome contributions!

- 📖 [Contributing Guide](./CONTRIBUTING.md)
- 🐛 [Report a Bug](https://github.com/RCOLKITT/VasperaMemory/issues/new?template=bug_report.md)
- 💡 [Request a Feature](https://github.com/RCOLKITT/VasperaMemory/issues/new?template=feature_request.md)

---

## 🔗 Links

- **Website**: [vasperamemory.com](https://vasperamemory.com)
- **Documentation**: [vasperamemory.com/docs](https://vasperamemory.com/docs)
- **Pricing**: [vasperamemory.com/pricing](https://vasperamemory.com/pricing)
- **GitHub**: [github.com/RCOLKITT/VasperaMemory](https://github.com/RCOLKITT/VasperaMemory)
- **Support**: support@vasperacapital.com

---

## 🔑 Keywords

AI memory, persistent AI context, Cursor memory plugin, Claude memory, Windsurf memory, MCP server, AI coding assistant, developer productivity, AI tools memory, cross-tool AI sync, code intelligence, decision capture, error fix memory, impact analysis, AI assistant memory, coding AI memory, persistent context AI, auto-indexing, entity extraction, knowledge graph, import graph, code pattern detection

---

## 📄 License

MIT License — Use it, modify it, ship it.

---

<p align="center">
  <b>VasperaMemory</b> — The memory layer your AI tools were missing.
</p>

<p align="center">
  <a href="https://vasperamemory.com">🚀 Get Started Free →</a>
</p>
