Memory Extension

Memory Extension is a skill for Claude Code, Codex from mongodb-partners/mongodb-gemini-extension. It costs 14 tokens per session (404 once invoked), scanned A, original, Apache-2.0.

A persistent memory layer for the Gemini command-line tool that saves chat history, preferences, and project context in MongoDB Atlas, an online database service.

In plain words
What is it for?
It stores facts such as project settings and searches saved information relevant to a new request. It keeps a recent window of interactions and can find older related facts.
Why use it?
It helps the tool retain useful information between terminal sessions instead of starting with no past context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Gemini CLI.

Good fit It stores facts such as project settings and searches saved information relevant to a new request. It keeps a recent window of interactions and can find older related facts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mongodb-partners/mongodb-gemini-extension/save_chat
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mongodb-partners/mongodb-gemini-extension --skill save_chat
Clone the repo
git clone --depth 1 https://github.com/mongodb-partners/mongodb-gemini-extension

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Memory Extension

README.md
[![agentmods](https://agentmods.dev/badge/skills/mongodb-partners/mongodb-gemini-extension/save_chat/github.svg)](https://agentmods.dev/skills/mongodb-partners/mongodb-gemini-extension/save_chat)
Your own site
<a href="https://agentmods.dev/skills/mongodb-partners/mongodb-gemini-extension/save_chat"><img src="https://agentmods.dev/badge/skills/mongodb-partners/mongodb-gemini-extension/save_chat/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Memory Extension

Your own site · 80×15
<a href="https://agentmods.dev/skills/mongodb-partners/mongodb-gemini-extension/save_chat"><img src="https://agentmods.dev/badge/skills/mongodb-partners/mongodb-gemini-extension/save_chat.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 404 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00404
Opus 5 $0.00007 $0.00202
Sonnet 5 $0.00003 $0.00081
Haiku 4.5 $0.00001 $0.00040

Measured 9d ago against content hash 8cd6bed8caaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

Memory Extension scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/save_chat/SKILL.md · 45 lines

What it actually says

Gemini CLI: MongoDB Agentic Memory Extension

This extension provides a persistent memory layer for the Gemini CLI using MongoDB Atlas. It enables the AI to "remember" previous interactions, user preferences, and project-specific context across different terminal sessions.

Workflow

  • Session Persistence: Maintains a sliding window of the last 20 interactions for immediate context.
  • Semantic Long-Term Memory: Uses MongoDB Atlas Vector Search to recall relevant facts from past weeks/months.
  • Preference Management: Store environment-specific configurations (e.g., "always use Yarn over NPM").
  • Automatic Context Injection: Automatically fetches relevant "memory documents" before Gemini generates a response.

🛠️ Skills Included

1. store_memory

Saves a specific fact or interaction to the long-term database.

  • Input: fact (string), category (string: 'preference', 'project', 'snippet')
  • Usage: "Gemini, remember that this project uses MongoDB version 7.0."

2. recall_context

Searches the database for information relevant to the current prompt.

  • Input: query (string)
  • Logic: Performs a $vectorSearch against the memory collection.

3. clear_session

Wipes the short-term memory for the current session ID.

📋 Prerequisites

  • MongoDB Atlas Cluster (Free Tier works great)
  • Gemini API Key
  • Node.js / Python environment for the CLI extension

⚙️ Configuration

Add your MongoDB connection string to your environment variables:

The MONGODB_URI value will be read from the mongo.config.json file.

EXPORT MONGODB_URI="mongodb+srv://<user>:<password>@cluster.mongodb.net/gemini_memory"
EXPORT VECTOR_INDEX_NAME="vector_index"
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 45 lines · 14 tokens per session scan A 8cd6bed8caaf

Subscribe to this mod's changes

Memory Extension is a skill published in the GitHub repository mongodb-partners/mongodb-gemini-extension (5 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 14 tokens to every session and 404 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

prisma-mongodb-upgrade

Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma Next. Triggers on "upgrade prisma mongodb"…

nitrocloudofficial/nitrostack · 95 tokens

byted-volcengine-mongodb

An operations tool for Volcengine MongoDB, a document database that stores data in flexible, JSON-like records. It can query managed MongoDB instances and return details for further explanation or diagnosis.

bytedance/agentkit-samples · 82 tokens

setup

Install Memoria and configure MCP for AI tools (Kiro, Cursor, Claude Code, Codex, Gemini CLI). Decision tree for Cloud vs self-hosted mode, database, embedding provider. Use when helping users set up Memoria.

matrixorigin/memoria · 50 tokens

dynamic

Fullstack development with bkend.ai BaaS — authentication, database, API integration. Triggers: fullstack, BaaS, login, signup, database, web app.

ww-w-ai/bkit-claude-code · 38 tokens