@andrebuzeli/advanced-memory-bank v3.3.4
Advanced Memory Bank MCP
A truly zero-dependency memory system for AI assistants, implementing the Model Context Protocol (MCP). This advanced version works out of the box with local file-based storage and built-in embedding algorithms, requiring no external services.
π Features
- Built-in Semantic Understanding: Local embedding algorithm with zero external dependencies
- File-based Storage: Works completely offline with local markdown files
- Memory Consolidation: Automatic merging of similar content
- Dynamic Importance: Weight memories based on access patterns and context
- Adaptive Pruning: Smart memory management when limits are reached
- Enhanced Workflows: Visual guidance through development phases
- Creative Analysis: Trade-off matrices and decision support
- Context Intelligence: AI-powered relevant memory suggestions
- Zero-Dependency Mode: Complete functionality without external dependencies
- Optional Database Integration: PostgreSQL with pgvector available as an optional feature
π Requirements
- Node.js 18+ (ECMAScript modules support)
- Nothing else! (PostgreSQL and OpenAI are completely optional)
π Standalone Mode (v3.2.3+)
The Advanced Memory Bank MCP now features a standalone mode that automatically activates when the MCP SDK is not available. This makes it perfect for use with npx:
"advanced-memory-bank": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@andrebuzeli/advanced-memory-bank"
],
"env": {
"MEMORY_BANK_ROOT": "/path/to/memory/folder"
}
}In standalone mode:
- Basic memory operations work without any dependencies
- File-based memory storage is used without requiring PostgreSQL
- Core tools (list_projects, memory_bank_read, etc.) are fully functional
- Advanced semantic features gracefully degrade to simpler implementations
This makes deployment much easier in environments where installing dependencies might be challenging.
π§ Installation
Simple Installation (Zero Configuration)
# NPM installation
npm install @andrebuzeli/advanced-memory-bank
# Or use directly with npx
npx @andrebuzeli/advanced-memory-bankDevelopment Installation
# Clone the repository
git clone https://github.com/andrebuzeli/advanced-memory-bank.git
cd advanced-memory-bank-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run the MCP server
npm run startπΎ Database Setup
Setting Up PostgreSQL with pgvector
- Install PostgreSQL 14 or later
- Install pgvector extension:
CREATE EXTENSION vector;- Create a database for memory storage:
CREATE DATABASE memory_bank;- Run the initialization script:
npm run db:initThis will:
- Create necessary tables for memory storage
- Set up indexes for vector similarity search
- Initialize the memory structure
π₯οΈ VS Code / Cursor Integration
Add the MCP to your VS Code or Cursor settings.json:
"modelContextProtocolServers": {
"advanced-memory-bank": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@andrebuzeli/advanced-memory-bank"
],
"env": {
"MEMORY_BANK_ROOT": "/path/to/memory/folder"
}
}
}That's it! No database setup, API keys, or additional configuration required.
π Memory System Architecture
Memory Storage Architecture
ββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββ
β Memory Manager βββββ>β Built-in Vector βββββ>β Local β
β β<βββββ Embeddings β<βββββ File System β
ββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββ
β β
β β
ββββββββββββββββββ ββββββββββββββββ
β Optional DB β<---------------------------β Memory Banks β
β (if enabled) β β Directory β
ββββββββββββββββββ ββββββββββββββββMemory Types
The system maintains various types of memories:
- Core Memories: Always present (
summary.md,status.md, etc.) - Dynamic Memories: Created as needed (analyses, creative decisions, etc.)
Vector Embedding and Similarity
- Memory content is converted to vector embeddings using built-in TF-IDF algorithm
- Semantic similarity calculated using cosine distance locally
- Similar memories above threshold are automatically consolidated
- No external APIs or services required
π¦ MCP Tools
Basic Tools
list_projects: List all available projectslist_project_files: List files within a projectmemory_bank_read: Read memory contentmemory_bank_write: Create new memorymemory_bank_update: Update existing memory
Advanced Tools
semantic_search: Search memory using natural languagecontext_intelligence: AI-powered memory suggestionsenhanced_thinking: Sequential thinking with visual contextcreative_analyzer: Decision analysis with trade-offsworkflow_navigator: Visual guidance through workflow statesmemory_analyzer: Analyze memory dependencies and suggest cleanup
New in v3.3.0
memory_bank_delete: Apaga um arquivo.mdda memΓ³ria do projeto (filesystem e banco, se habilitado)memory_bank_update: Agora aceita o parΓ’metro opcionalremoveTextpara remover um trecho especΓfico do.mdalΓ©m de adicionar conteΓΊdo
π Batch Update Support (v3.3.3)
The memory_bank_update tool now supports batch updates. You can update a single file as before, or update multiple files in one call:
Single Update Example
memory_bank_update({
projectName: "my-project",
fileName: "notes.md",
content: "New content for notes.md"
})Batch Update Example
memory_bank_update({
projectName: "my-project",
updates: [
{ fileName: "notes.md", content: "New content for notes.md" },
{ fileName: "summary.md", content: "Update summary", removeText: "old line" }
]
})- The default is single update (fileName + content). For multiple files, use the
updatesarray. - The optional
removeTextparameter can be used in both modes to remove a specific snippet from a file.
Exemplo de uso
Apagar um arquivo .md:
{
"projectName": "meu-projeto",
"fileName": "anotacoes.md"
}Remover trecho especΓfico de um .md:
{
"projectName": "meu-projeto",
"fileName": "anotacoes.md",
"removeText": "trecho a ser removido"
}Adicionar conteΓΊdo e remover trecho ao mesmo tempo:
{
"projectName": "meu-projeto",
"fileName": "anotacoes.md",
"content": "novo conteΓΊdo a ser adicionado",
"removeText": "trecho antigo"
}π Usage Examples
Semantic Search
{
"projectName": "my-project",
"query": "How did we resolve the authentication issue?",
"limit": 5,
"similarityThreshold": 0.7
}Context Intelligence
{
"taskDescription": "Implement JWT authentication",
"projectName": "my-project",
"currentContext": "Working on the backend API",
"maxSuggestions": 5
}Memory Analysis
{
"projectName": "my-project",
"analysisType": "all",
"includeMetrics": true
}π§ Memory Management
Memory Consolidation
Similar memories are automatically identified and merged to maintain a coherent memory bank:
- Vector similarity check when new memories are added
- Semantic similarity threshold (configurable)
- Content merging preserves unique information
- References updated to point to consolidated memory
Memory Pruning
When memory limits are reached:
- Importance score calculation based on:
- Access frequency
- Recency of access
- Centrality in reference graph
- Custom importance flags
- Least important memories are pruned
- Core memories are always preserved
π License
MIT License - See LICENSE file for details
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago