ODAM Memory for Cursor
Long-term memory extension for Cursor AI assistant powered by ODAM.
Features
- π§ Long-term Memory: Persistent memory across sessions
- π Automatic Sync: Automatically saves and retrieves context
- π Code Artifacts: Tracks code changes and artifacts
- π Context Injection: Injects relevant memory into chat context
- π Memory Analytics: View memory statistics and usage
Installation
From VSIX File
- Download the latest
.vsixfile from Releases - Open Cursor
- Press
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux) - Type:
Extensions: Install from VSIX... - Select the downloaded
.vsixfile
From Source
git clone https://github.com/aipsyhelp/Cursor_OD...
ODAM Memory for Cursor
Long-term memory extension for Cursor AI assistant powered by ODAM.
Features
- π§ Long-term Memory: Persistent memory across sessions
- π Automatic Sync: Automatically saves and retrieves context
- π Code Artifacts: Tracks code changes and artifacts
- π Context Injection: Injects relevant memory into chat context
- π Memory Analytics: View memory statistics and usage
Installation
From VSIX File
- Download the latest
.vsixfile from Releases - Open Cursor
- Press
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux) - Type:
Extensions: Install from VSIX... - Select the downloaded
.vsixfile
From Source
git clone https://github.com/aipsyhelp/Cursor_ODAM.git
cd Cursor_ODAM/github-release
npm install
npm run compile
npm run package
Then install the generated .vsix file.
Configuration
Getting Your API Key
To use this extension, youβll need an ODAM API key. As developers, you can request a test API key from us:
π§ Email: ai@psyhelp.info
Weβre happy to provide you with an API key for testing our extension. Please include:
- Your name and organization
- Brief description of your use case
- Expected testing duration
Once you receive your API key, follow the configuration steps below.
Configuration Steps
- Open Cursor Settings (
Cmd+,orCtrl+,) - Search for "ODAM"
- Configure:
odam.enabled: Enable/disable the extensionodam.apiUrl: ODAM API URL (default:https://api.odam.dev)odam.apiKey: Your ODAM API key (required - see "Getting Your API Key" above)odam.userId: User ID (auto-generated if empty)
Quick Setup via Command Palette
- Press
Cmd+Shift+P/Ctrl+Shift+P - Type:
ODAM: Configure Memory - Enter your API key
Usage
Basic Usage
Once configured, the extension works automatically:
- Chat with Cursor: Your queries and responses are automatically saved to ODAM
- Memory Context: Relevant memory is automatically injected into chat context
- Code Tracking: Code changes are tracked and saved as artifacts
Commands
ODAM: Show Memory- View current memory statisticsODAM: Show Context Logs- View context flow logsODAM: View Data in ODAM- View data stored in ODAMODAM: Reset Project Memory- Clear project memoryODAM: Configure Memory- Configure extension settings
Verifying Hooks
- Confirm that
~/.cursor/hooks.jsoncontains entries forodam-before.sh,odam-after.sh, andodam-thought.sh - Make sure
~/.cursor/bin/cursor-odam-hookexists and is executable - Inspect
~/.cursor/odam-hook-config.jsonto see the local Hook Event Server port
How It Works
- Cursor Hooks: Official
beforeSubmitPrompt,afterAgentResponse,afterAgentThoughthooks callcursor-odam-hook(auto-installed to~/.cursor/hooks/odam-*.sh) - Hook Event Server: The extension runs a local secure HTTP server that accepts hook events in real time
- Save Interactions: User queries and AI responses are saved to ODAM via
/api/v1/code-memory/record - Retrieve Context: Relevant memory is retrieved via
/api/v1/code-memory/context - Inject Context: Memory context is injected into
.cursor/rules/odam-memory.mdc - Cursor Uses Context: Cursor automatically reads the memory file and uses it in chat
Note: The hook scripts (
~/.cursor/hooks/odam-before.sh,...-after.sh,...-thought.sh) and global hooks configuration (~/.cursor/hooks.json) are created or updated automatically when the extension is activated. If you already have custom hooks, the ODAM entries are appended without removing existing ones.
Architecture
System Flow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cursor IDE β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β β Chat UI β β Code Editor β β File System Events β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββββ¬ββββββββββββ β
β β β β β
β ββββββββββββββββββββΌββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββ β
β β ODAM Extension (Cursor) β β
β β ββββββββββββββββββββββββββ β β
β β β Hook Event Processor β β β
β β β - beforeSubmitPrompt β β β
β β β - afterAgentResponse β β β
β β β - afterAgentThought β β β
β β βββββββββββββ¬βββββββββββββ β β
β β β β β
β β βββββββββββββΌβββββββββββββ β β
β β β Memory File Updater β β β
β β β - Updates .mdc file β β β
β β β - Fetches context β β β
β β βββββββββββββ¬βββββββββββββ β β
β β β β β
β β βββββββββββββΌβββββββββββββ β β
β β β Code Artifact Tracker β β β
β β β - Monitors changes β β β
β β β - Extracts entities β β β
β β βββββββββββββ¬βββββββββββββ β β
β β β β β
β β βββββββββββββΌβββββββββββββ β β
β β β Project Knowledge β β β
β β β Indexer β β β
β β β - Indexes docs β β β
β β βββββββββββββ¬βββββββββββββ β β
β ββββββββββββββββΌββββββββββββββββ β
β β β
βββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β HTTPS/REST API
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ODAM API Server β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Code Memory API β β
β β POST /api/v1/code-memory/record β β
β β POST /api/v1/code-memory/context β β
β βββββββββββββββββ¬ββββββββββββββββββββββββββββ¬ββββββββββββββββ β
β β β β
β ββββββββββΌβββββββββ ββββββββββΌβββββββββ β
β β Semantic Analysisβ β Context Builder β β
β β - LLM Processingβ β - Memory Search β β
β β - Entity Extractβ β - Graph Traverseβ β
β β - Relationship β β - Filter Errors β β
β β Detection β β - Rank Results β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ β
β β β β
ββββββββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββββββββ
β β
βββββββββββΌβββββββββββ βββββββββββββΌβββββββββββ
β Data Storage β β Knowledge Graph β
β β β β
β ββββββββββββββββ β β βββββββββββββββββββ β
β β ChromaDB β β β β Neo4j β β
β β (Vectors) β β β β (Relationships) β β
β β Embeddings β β β β Entity Graph β β
β ββββββββββββββββ β β βββββββββββββββββββ β
β β β β
β ββββββββββββββββ β β β
β β Cosmos DB β β β β
β β (Documents) β β β β
β β Episodic β β β β
β β Semantic β β β β
β ββββββββββββββββ β β β
ββββββββββββββββββββββ βββββββββββββββββββββββββ
ODAM Semantic Analysis & Knowledge Graph
ODAM performs advanced semantic analysis to build a comprehensive knowledge graph:
1. Semantic Analysis Pipeline
- Text Processing: Natural language understanding using LLM (GPT-4o-mini)
- Entity Extraction: Identifies entities (Person, Technology, Project, Language, Tool, Library, Framework, Preference, Error, Solution, Approach, Pattern, Code Style)
- Relationship Detection: Discovers connections between entities (uses, depends_on, implements, fixes, causes)
- Embedding Generation: Converts text to high-dimensional vectors (768+ dimensions) for semantic similarity search
2. Vector Storage (ChromaDB)
- Embeddings: All text (queries, responses, code, documentation) is converted to embeddings
- Semantic Search: Fast similarity search using cosine distance
- Multi-Modal: Supports code, natural language, and structured data
- Privacy: User data is isolated per
user_idandsession_id
3. Knowledge Graph (Neo4j)
- Entity Nodes: Represents extracted entities with properties (name, type, confidence, metadata)
- Relationships: Connects entities with typed edges (RELATES_TO, CONTAINS, IMPLEMENTS, FIXES)
- Graph Traversal: Finds related entities through graph queries
- Dynamic Entities: Entities evolve over time as new information is added
4. Intelligent Context Filtering
ODAM intelligently filters memory context to provide only relevant and useful information:
- β
Proven Solutions: Only successful approaches (
status: success,test_status: passed) are prioritized - β οΈ Known Issues: Failed approaches (
status: failed,outcome: regression) are marked and excluded from positive context, but included in warnings - π Relevance Ranking: Context is ranked by semantic similarity to the current query
- π Confidence Scoring: Only high-confidence entities (
confidence > 0.7) are included - π Temporal Filtering: Recent successful solutions are prioritized over older ones
5. Data Security & Privacy
- Encrypted Storage: All data is encrypted at rest (AES-256)
- HTTPS Only: All API communication uses TLS 1.3
- User Isolation: Data is strictly isolated per user (
user_id) and project (session_id) - No Data Sharing: User data is never shared between users or projects
- API Key Authentication: Secure API key-based authentication
- Audit Logging: All data access is logged for security compliance
6. Memory Types
ODAM stores multiple types of memory:
- Episodic Memory: Specific conversations and events (timestamped)
- Semantic Memory: Facts about the user and project (persistent)
- Procedural Memory: Code patterns and solutions (reusable)
- Emotional Memory: User preferences and style (personalized)
Benefits of ODAMβs Approach
- Semantic Understanding: Unlike keyword-based search, ODAM understands meaning and context
- Long-Term Memory: Remembers project history, user preferences, and successful solutions
- Error Prevention: Automatically avoids repeating past mistakes
- Context Awareness: Provides relevant context based on semantic similarity, not just keywords
- Scalability: Vector search scales to millions of memories efficiently
- Privacy: User data is encrypted and isolated
- Intelligence: Learns from past interactions to improve future responses
Documentation
- Changes and Architecture - Detailed documentation of all changes, project isolation architecture, memory statistics fixes, and technical implementation details
Development
Prerequisites
- Node.js 18+
- TypeScript 5.0+
- VS Code / Cursor IDE
Setup
npm install
npm run compile
Build
npm run package
Development Mode
- Open project in VS Code/Cursor
- Press
F5to launch Extension Development Host - Test your changes in the new window
API Endpoints
The extension uses the following ODAM API endpoints:
POST /api/v1/code-memory/record- Save interactions and artifactsPOST /api/v1/code-memory/context- Retrieve memory contextGET /health- Health check
Security
- API keys are stored securely in VS Code/Cursor settings (encrypted)
- All communication uses HTTPS
- No sensitive data is logged
See SECURITY.md for more information.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Author
Andrii Kryvosheiev
Support
- Issues: GitHub Issues
- Documentation: See the README, CONTRIBUTING, and SECURITY guides in this repository
Changelog
1.0.0
- Initial release
- Basic memory functionality
- Code artifact tracking
- Context injection
- Memory analytics
Made with β€οΈ for the Cursor community