MemoGemini MCP Server is a Model Context Protocol (MCP) server designed to act as a "cognitive extension" for AI agents, specifically optimized for the Gemini CLI. It provides persistent memory capabilities through three distinct systems, allowing agents to retain information across sessions and projects.
MemoGemini implements three layers of memory:
- File Memory: Persistent storage for long-form documentation, notes, and structured data using Markdown files.
- Semantic Memory: Unstructured text storage with vector embeddings for similarity-based retrieval, powered by Qdrant.
- Fact Memory: High-speed key-value storage for specific facts and preferences, powered by Redis.
memogemini-mcp-server/
├── src/
│ ├── server.ts # Main entry point: initializes server and registers tools
│ ├── config.ts # Centralized configuration (env vars)
│ ├── fact/ # Fact Memory (Redis) implementation
│ ├── file/ # File Memory (FS) implementation
│ └── semantic/ # Semantic Memory (Qdrant) implementation
├── tests/ # Unit and integration tests
├── gemini-extension.json # Configuration for Gemini CLI extension
├── package.json # Dependencies and scripts
├── Dockerfile # Container definition
├── docker-compose.yml # Orchestration for app, Redis, and Qdrant
└── GEMINI.md # System prompt for the AI agent
- Runtime: Node.js (ES Modules)
- Language: TypeScript
- Vector DB: Qdrant
- KV Store: Redis
- Embeddings:
@huggingface/transformers - SDK:
@modelcontextprotocol/sdk
- Node.js (v18+)
- Docker & Docker Compose
Copy the example environment file and adjust the values:
cp .env.example .env-
Install Dependencies:
npm install
-
Build Project:
npm run build
-
Run Tests:
npm test -
Start Server:
npm start
To install extension for gemini-cli:
gemini extensions install https://github.com/GrehBan/memogemini.gitwrite_note: Save markdown content.read_note: Retrieve note content.list_notes: List all notes in a folder.forget_note: Delete a note.
remember: Store text with embeddings.search_memory: Semantic search in stored memories.forget_memory: Remove a specific memory.checkpoint_semantic: Trigger a Qdrant snapshot.
remember_fact: Store a key-value pair.recall_fact: Retrieve a value by key.list_facts: List all stored keys.forget_fact: Delete a fact.checkpoint_facts: Trigger a Redis BGSAVE.
- Module System: This project uses native ES Modules.
- Validation: All tool inputs are validated using
zod. - Config: Use
src/config.tsfor all configuration; never hardcode values. - Testing: Add unit tests in
tests/for any new logic.