ODAM Memory for Cursor

Do you have a TLD for your website?

Yes

Is your OpenVSX namespace verified?

Yes

Link to OpenVSX URL

Link to website linking back to OpenVSX

Screenshot of the website linking back to the OpenVSX URL

Description

ODAM Memory for Cursor

Long-term memory extension for Cursor AI assistant powered by ODAM.

Features

:brain: Long-term Memory: Persistent memory across sessions
:counterclockwise_arrows_button: Automatic Sync: Automatically saves and retrieves context
:memo: Code Artifacts: Tracks code changes and artifacts
:magnifying_glass_tilted_left: Context Injection: Injects relevant memory into chat context
:bar_chart: Memory Analytics: View memory statistics and usage

How It Works

Cursor Hooks: Official beforeSubmitPrompt, afterAgentResponse, afterAgentThought hooks call cursor-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_id and session_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:

:white_check_mark: Proven Solutions: Only successful approaches (status: success, test_status: passed) are prioritized
:warning: Known Issues: Failed approaches (status: failed, outcome: regression) are marked and excluded from positive context, but included in warnings
:magnifying_glass_tilted_left: Relevance Ranking: Context is ranked by semantic similarity to the current query
:bar_chart: Confidence Scoring: Only high-confidence entities (confidence > 0.7) are included
:counterclockwise_arrows_button: 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
Development

Prerequisites

Node.js 18+
TypeScript 5.0+
VS Code / Cursor IDE

What practical benefit do you gain from using long-term memory?

In my work, I use only AGENTS.md in my style and I do not want to use the context of previous/other chats in the current one.

1 Like

In practice, long-term memory becomes useful when reality diverges from static instructions:

Practical benefits we observed:

  • It remembers what actually worked in the past (not just what should work in theory)

  • It avoids repeating known mistakes, regressions, or rejected approaches

  • It retains implicit knowledge that rarely makes it into AGENTS.md (e.g. β€œthis library caused a memory leak in prod”, β€œthis migration was reverted”, β€œthis pattern is fragile under load”)

  • It reduces the need to restate project history, constraints, and decisions across sessions

Importantly, long-term memory does not have to mean β€œreuse previous chat context.”

A well-designed memory layer:

  • Retrieves only semantically relevant facts, not past conversations

  • Acts as a knowledge cache, not conversational carry-over

  • Can be strictly filtered (e.g. only proven solutions, passed tests, accepted patterns)

Think of it less as β€œchat memory” and more as:

Versioned project knowledge that evolves automatically from real work.

If your projects are short-lived, single-developer, or perfectly documented upfront, AGENTS.md is often sufficient.

For long-running, multi-month systems with changing constraints, long-term memory mainly saves time, prevents errors, and reduces cognitive load β€” nothing more, nothing less.

We have added the verification checkmark.

1 Like