code-session-memory: Automatic Vector Memory for AI Coding Sessions
This repository profile is provided by osrepos.com, an open source repository discovery platform.

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.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
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.
Installation
To get started with code-session-memory, you'll need a few prerequisites and a simple installation command.
Prerequisites
- Node.js ? 18
- An OpenAI API key (for
text-embedding-3-large) - At least one supported tool installed (OpenCode, Claude Code, Cursor, VS Code, Codex, or Gemini CLI)
Install
Run the following command to set up code-session-memory for all detected tools on your machine:
npx code-session-memory install
This 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.
Set Your API Key
Ensure your OpenAI API key is set as an environment variable:
export OPENAI_API_KEY=sk-...
It's recommended to add this to your shell profile (.bashrc, .zshrc, etc.) for persistent access.
Examples
Once installed, memory indexing is fully automatic. Here are some ways to interact with your indexed sessions.
Verify Installation
You can check the status of your installation and database with:
npx code-session-memory status
This command provides an overview of your database, indexed chunks, tracked sessions, and the installation status for each integrated tool.
Querying from the CLI
Search your indexed sessions directly from the terminal using natural language queries:
npx code-session-memory query "authentication middleware"
npx code-session-memory query "auth flow" --source opencode
npx code-session-memory query "error handling" --from 2026-02-01 --to 2026-02-20
You can filter results by source tool, limit the number of results, and specify date ranges.
Browsing Sessions
An interactive CLI browser allows you to inspect and manage your sessions:
npx code-session-memory sessions
From 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.
Web UI
For a comprehensive visual experience, code-session-memory offers a full-featured web interface:
npx code-session-memory web
Open http://localhost:3333 in your browser to access a dashboard with search, session browsing, detailed session analytics, and status information.
Asking the Agent About Past Sessions
The installed skill teaches your AI agent when and how to use these memory tools. You can prompt your agent with questions like:
- "How did we implement the authentication middleware last week?"
- "Have we discussed this error before?"
- "What was our decision about the database schema?"
Why Use It
code-session-memory significantly boosts developer productivity by addressing the challenge of context loss in AI-assisted coding.
- 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.
- Intelligent Semantic Search: Leverage natural language queries to semantically search through all your past interactions, quickly retrieving relevant code snippets, decisions, or discussions.
- 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.
- Flexible and Scalable Storage: Choose between a local SQLite database for simplicity or a centralized PostgreSQL with
pgvectorbackend for sharing memory across multiple machines or using managed services like Supabase. - Optimized Performance: Incremental indexing ensures that only new messages are processed, making each indexing pass fast and efficient, even for long sessions.
- Structured Analytics: Gain insights into your coding process with detailed analytics on message counts, tool usage, and active session duration.
Links
- GitHub Repository: djannot/code-session-memory
Related repositories
Similar repositories that may be relevant next.

Cloudflare Computer: Give Your Agent a Virtual Filesystem
August 14, 2026
Cloudflare Computer is an innovative project that provides a virtual filesystem within a Durable Object, allowing agents to interact with a persistent state. It offers pluggable execution backends, including containerized Linux environments and serverless Workers, enabling flexible and powerful agent computing. Currently in preview, it's ideal for experiments and prototypes leveraging Cloudflare's edge infrastructure.

SwarmClaw: Self-Hosted AI Agent Runtime for Autonomous Swarms
August 13, 2026
SwarmClaw is an open-source, self-hosted AI agent runtime and multi-agent framework designed for autonomous agent swarms. It offers durable agent memory, MCP tools, schedules, and delegation, supporting over 23 LLM providers including Claude, GPT, Gemini, OpenRouter, and Ollama. This platform serves as a practical alternative to solutions like Claude Code and LangChain for those seeking self-hosted AI agent orchestration.

json-render: The Generative UI Framework for Dynamic Interfaces
August 12, 2026
json-render is a powerful Generative UI framework that allows developers to create dynamic, personalized user interfaces from natural language prompts. It ensures reliability by constraining AI-generated output to predefined components and actions, offering a predictable and safe way to build cross-platform UIs.

Mercury Agent: A Soul-Driven AI with Hardened Permissions and Multi-Channel Access
August 12, 2026
Mercury Agent is a sophisticated, soul-driven AI agent designed for continuous 24/7 operation, offering robust permission-hardened tools, intelligent token budgeting, and versatile multi-channel access. It remembers what matters, asks for permission before acting, and runs seamlessly from the CLI, Telegram, or a web dashboard. With 31 built-in tools, Kanban boards, and a SQLite-backed Second Brain memory, Mercury provides a comprehensive and secure AI assistant experience.
Source repository
Open the original repository on GitHub.