{"name":"code-session-memory: Automatic Vector Memory for AI Coding Sessions","description":"code-session-memory provides automatic vector memory for various AI coding tools like OpenCode, Claude Code, Cursor, VS Code, Codex, and Gemini CLI. It indexes new messages into a vector database after each AI agent turn, enabling semantic search across all your past coding sessions. This tool ensures memory is shared across different platforms, enhancing developer productivity.","github":"https://github.com/djannot/code-session-memory","url":"https://osrepos.com/repo/djannot-code-session-memory","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/djannot-code-session-memory","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/djannot-code-session-memory.md","json":"https://osrepos.com/repo/djannot-code-session-memory.json","topics":["TypeScript","AI","Developer Tools","Vector Database","LLM","Productivity","GitHub","CLI"],"keywords":["TypeScript","AI","Developer Tools","Vector Database","LLM","Productivity","GitHub","CLI"],"stars":null,"summary":"code-session-memory provides automatic vector memory for various AI coding tools like OpenCode, Claude Code, Cursor, VS Code, Codex, and Gemini CLI. It indexes new messages into a vector database after each AI agent turn, enabling semantic search across all your past coding sessions. This tool ensures memory is shared across different platforms, enhancing developer productivity.","content":"## Introduction\n`code-session-memory` is an innovative open-source project that provides automatic vector memory for your AI coding sessions. It integrates seamlessly with popular AI development tools such as OpenCode, Claude Code, Cursor, VS Code, Codex, and Gemini CLI. The core idea is to prevent losing context from your past AI interactions by automatically indexing new messages into a vector database after each agent turn. This enables powerful semantic search capabilities, allowing both you and your AI agent to retrieve relevant information from previous sessions, regardless of the tool used.\n\n## Installation\nTo get started with `code-session-memory`, you'll need a few prerequisites and a simple installation command.\n\n### Prerequisites\n*   Node.js ? 18\n*   An OpenAI API key (for `text-embedding-3-large`)\n*   At least one supported tool installed (OpenCode, Claude Code, Cursor, VS Code, Codex, or Gemini CLI)\n\n### Install\nRun the following command to set up `code-session-memory` for all detected tools on your machine:\nbash\nnpx code-session-memory install\n\nThis command automatically configures plugins, hooks, skills, and MCP server entries for OpenCode, Claude Code, Cursor, VS Code, Codex, and Gemini CLI. All tools will share the same local SQLite database by default, located at `~/.local/share/code-session-memory/sessions.db`, and the same MCP server for querying past sessions. Remember to restart your AI coding tool to activate the changes.\n\n### Set Your API Key\nEnsure your OpenAI API key is set as an environment variable:\nbash\nexport OPENAI_API_KEY=sk-...\n\nIt's recommended to add this to your shell profile (`.bashrc`, `.zshrc`, etc.) for persistent access.\n\n## Examples\nOnce installed, memory indexing is fully automatic. Here are some ways to interact with your indexed sessions.\n\n### Verify Installation\nYou can check the status of your installation and database with:\nbash\nnpx code-session-memory status\n\nThis command provides an overview of your database, indexed chunks, tracked sessions, and the installation status for each integrated tool.\n\n### Querying from the CLI\nSearch your indexed sessions directly from the terminal using natural language queries:\nbash\nnpx code-session-memory query \"authentication middleware\"\nnpx code-session-memory query \"auth flow\" --source opencode\nnpx code-session-memory query \"error handling\" --from 2026-02-01 --to 2026-02-20\n\nYou can filter results by source tool, limit the number of results, and specify date ranges.\n\n### Browsing Sessions\nAn interactive CLI browser allows you to inspect and manage your sessions:\nbash\nnpx code-session-memory sessions\n\nFrom here, you can print a session's full content, compact it for restarting a new session (generating a summary of context, key decisions, current state, and unresolved issues), or delete it.\n\n### Web UI\nFor a comprehensive visual experience, `code-session-memory` offers a full-featured web interface:\nbash\nnpx code-session-memory web\n\nOpen <a href=\"http://localhost:3333\" target=\"_blank\">http://localhost:3333</a> in your browser to access a dashboard with search, session browsing, detailed session analytics, and status information.\n\n### Asking the Agent About Past Sessions\nThe installed skill teaches your AI agent when and how to use these memory tools. You can prompt your agent with questions like:\n*   \"How did we implement the authentication middleware last week?\"\n*   \"Have we discussed this error before?\"\n*   \"What was our decision about the database schema?\"\n\n## Why Use It\n`code-session-memory` significantly boosts developer productivity by addressing the challenge of context loss in AI-assisted coding.\n\n*   **Seamless Cross-Tool Memory**: It unifies your coding memory across various AI tools, ensuring that knowledge gained in one session is accessible in another, regardless of the platform.\n*   **Intelligent Semantic Search**: Leverage natural language queries to semantically search through all your past interactions, quickly retrieving relevant code snippets, decisions, or discussions.\n*   **Efficient Session Management**: Tools for browsing, summarizing, and deleting sessions, both via CLI and a user-friendly web interface, give you full control over your coding history.\n*   **Flexible and Scalable Storage**: Choose between a local SQLite database for simplicity or a centralized PostgreSQL with `pgvector` backend for sharing memory across multiple machines or using managed services like [Supabase](https://supabase.com \"Supabase\" target=\"_blank\").\n*   **Optimized Performance**: Incremental indexing ensures that only new messages are processed, making each indexing pass fast and efficient, even for long sessions.\n*   **Structured Analytics**: Gain insights into your coding process with detailed analytics on message counts, tool usage, and active session duration.\n\n## Links\n*   GitHub Repository: [djannot/code-session-memory](https://github.com/djannot/code-session-memory \"djannot/code-session-memory on GitHub\" target=\"_blank\")","metrics":{"detailViews":6,"githubClicks":3},"dates":{"published":null,"modified":"2026-08-15T12:57:08.000Z"}}