code-session-memory: Automatic Vector Memory for AI Coding Sessions

This repository profile is provided by osrepos.com, an open source repository discovery platform.

code-session-memory: Automatic Vector Memory for AI Coding Sessions

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

Analyzed by OSRepos on August 15, 2026

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 pgvector backend 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

Related repositories

Similar repositories that may be relevant next.

SandBase CLI: Connect Your AI Agent to 2,000+ Models and APIs

SandBase CLI: Connect Your AI Agent to 2,000+ Models and APIs

September 4, 2026

SandBase CLI is an open-source command-line interface and local MCP server that supercharges AI agents. It connects 25 popular AI clients, such as Claude Code, Cursor, and ChatGPT, to over 2,000 AI models and APIs, simplifying complex integrations. This powerful tool streamlines AI agent development by offering a unified gateway, removing the hassle of API key management and configuration.

AI AgentsCLILLM
Tessera: A Comprehensive Workspace for AI Coding Sessions and Agent Orchestration

Tessera: A Comprehensive Workspace for AI Coding Sessions and Agent Orchestration

September 4, 2026

Tessera is a powerful workspace for organizing AI coding sessions, acting as a local control room for agents like Claude Code, Codex, and OpenCode. It enables parallel sessions, isolated Git worktrees, and Kanban boards, streamlining complex AI development workflows. Developers can manage agents, track tasks, and complete Git operations all within one integrated environment.

tesseraAI codingdeveloper tools
OGAD: Private, On-Device AI with an OpenAI-Compatible Local Gateway

OGAD: Private, On-Device AI with an OpenAI-Compatible Local Gateway

September 4, 2026

OGAD (Off Grid AI Desktop) is an open-source, AGPL-licensed application for private, on-device AI. It enables users to run various open models, including text, vision, image, and voice, entirely locally through a single OpenAI-compatible gateway. This ensures complete data privacy with no cloud dependencies, accounts, or API keys.

Local AIOn-Device AIPrivacy
Magic Context: Unbounded, Self-Managing Memory for AI Coding Agents

Magic Context: Unbounded, Self-Managing Memory for AI Coding Agents

September 2, 2026

Magic Context is a powerful GitHub repository that provides unbounded, self-managing memory for AI coding agents. Acting as the 'hippocampus' for agents, it ensures continuous learning and recall across sessions without disruptive context compaction. This tool, part of CortexKit, allows agents to build lasting project knowledge and maintain context efficiently.

AI AgentsAgent MemoryContext Management

Source repository

Open the original repository on GitHub.

8 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️