Skip to content

Mnemo AI

A local agentic AI assistant with MCP (Model Context Protocol) integration, RAG capabilities, and intelligent conversation management. Built on LangGraph with LangChain for multi-provider LLM support (Ollama, Amazon Bedrock, OpenAI, Anthropic, Amazon SageMaker AI, LiteLLM).

Demo

✨ Key Features

  • πŸ€– Multi-Model Support: Ollama (local), Amazon Bedrock, OpenAI, Anthropic (Claude), Amazon SageMaker AI, LiteLLM (100+ providers)
  • πŸ”§ MCP Tool System: Extensible tool architecture via Model Context Protocol
  • πŸ“š RAG (Retrieval-Augmented Generation): Automatic document indexing and semantic search (if enabled)
  • πŸ’¬ Advanced Chat Interface: Multiline input, command system, conversation save/load
  • 🧠 User Profile Learning: Automatic learning from interactions for personalized responses
  • 🧩 Episodic Memory: Learns from successful task completions and retrieves similar solutions
  • πŸ“– ACE Playbook: Learns strategies from successes AND failures via Agentic Context Engineering
  • πŸ” Web Search: Integrated Brave Search API (if available)
  • 🌐 Web Crawler: Extract and index content from web pages
  • πŸ–ΌοΈ Vision Support: Image analysis with vision models (if available)
  • πŸ“ File Operations: Read/write/edit with support for text, CSV, JSON, PDF, DOCX
  • ✏️ Precise File Editing: Safe string replacement with validation and uniqueness checking
  • πŸ”Ž Fast Search Tools: Glob pattern matching and ripgrep content search (10-100x faster)
  • πŸ“‹ Todo Tracking: Multi-step task management with real-time progress updates
  • ⚑ Bash Execution: Direct shell command execution with intelligent error handling
  • πŸ›‘οΈ Git Safety: Protection against dangerous git operations with smart warnings
  • πŸ“ Plan Mode: Implementation planning workflow for complex tasks
  • πŸ”„ Background Tasks: Run long operations in parallel without blocking

πŸ“– Project Structure

mnemoai/                      # repo root
β”œβ”€β”€ pyproject.toml                          # Packaging + `mnemoai` CLI entry point
β”œβ”€β”€ requirements.txt                        # Dependencies
β”œβ”€β”€ README.md                               # This file
β”œβ”€β”€ pytest.ini                              # Pytest configuration
β”œβ”€β”€ requirements-dev.txt                    # Dev/test dependencies
β”‚
β”œβ”€β”€ src/mnemoai/              # The single package (src layout)
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __main__.py                         # `python -m mnemoai`
β”‚   β”œβ”€β”€ main.py                             # Entry point (cli())
β”‚   β”‚
β”‚   β”œβ”€β”€ client/                             # Client layer
β”‚   β”‚   β”œβ”€β”€ client.py                       # LangGraphClient facade (lifecycle, MCP, query)
β”‚   β”‚   β”œβ”€β”€ mcp_tool_wrapper.py             # MCPβ†’LangChain adapter + MultiMCPClient (built-in + external servers)
β”‚   β”‚   β”œβ”€β”€ mcp_config.py                   # Loads external MCP servers from mcp.json
β”‚   β”‚   β”œβ”€β”€ agent/                          # Agent loop
β”‚   β”‚   β”‚   β”œβ”€β”€ agent.py                    # LangGraph StateGraph agent with streaming
β”‚   β”‚   β”‚   β”œβ”€β”€ router.py                   # Query classifier and routing
β”‚   β”‚   β”‚   β”œβ”€β”€ orchestrator.py             # Task decomposition and worker orchestration
β”‚   β”‚   β”‚   └── reasoning_utils.py          # Reasoning/thinking helpers for aux LLM calls
β”‚   β”‚   β”œβ”€β”€ ui/                             # User interface
β”‚   β”‚   β”‚   β”œβ”€β”€ chat_interface.py           # Chat loop
β”‚   β”‚   β”‚   └── spinner.py                  # Loading animations
β”‚   β”‚   β”œβ”€β”€ managers/                       # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ agent_conversation_manager.py  # Conversation state and token tracking
β”‚   β”‚   β”‚   └── user_profile_manager.py     # User profiling and learning
β”‚   β”‚   └── memory/                         # Memory systems
β”‚   β”‚       β”œβ”€β”€ episodic_memory.py          # Episodic memory manager
β”‚   β”‚       β”œβ”€β”€ memory_store.py             # Curated persistent memory (MEMORY.md) store
β”‚   β”‚       β”œβ”€β”€ reflector.py                # ACE Reflector - extracts strategies
β”‚   β”‚       β”œβ”€β”€ playbook_store.py           # ACE Playbook - stores learned strategies
β”‚   β”‚       β”œβ”€β”€ faiss_store.py              # FAISS episodic store
β”‚   β”‚       └── chroma_store.py             # ChromaDB episodic store
β”‚   β”‚
β”‚   β”œβ”€β”€ server/                             # MCP server layer
β”‚   β”‚   β”œβ”€β”€ server.py                       # FastMCP server (run as a subprocess)
β”‚   β”‚   β”œβ”€β”€ error_handler.py                # @tool_error_handler decorator (shared)
β”‚   β”‚   └── tools/                          # Tool implementations
β”‚   β”‚       β”œβ”€β”€ tools_manager.py            # Tool registration
β”‚   β”‚       β”œβ”€β”€ fs_read.py / fs_write.py / file_edit.py / file_search.py
β”‚   β”‚       β”œβ”€β”€ execute_bash.py / git_safety.py / todo_manager.py / plan_mode.py
β”‚   β”‚       β”œβ”€β”€ background_tasks.py / web_crawler.py / web_search.py
β”‚   β”‚       β”œβ”€β”€ describe_image.py / rag_tool.py / memory_tool.py
β”‚   β”‚       β”œβ”€β”€ rag/                        # RAG system (session, vector_store_controller, stores)
β”‚   β”‚       └── readers/                    # File readers (csv/json/pdf/docx/line/dir/search + chunking)
β”‚   β”‚
β”‚   β”œβ”€β”€ models/                             # Model layer
β”‚   β”‚   β”œβ”€β”€ provider_params.py              # Single source of truth: per-provider config keys
β”‚   β”‚   β”œβ”€β”€ mantle_factory.py               # Bedrock Mantle model factory (multi-protocol)
β”‚   β”‚   β”œβ”€β”€ controllers/                    # Provider-dispatching controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ base_model_controller.py    # Minimal shared base
β”‚   β”‚   β”‚   β”œβ”€β”€ llm_controller.py           # LLM initialization
β”‚   β”‚   β”‚   β”œβ”€β”€ vision_model_controller.py  # Vision model initialization
β”‚   β”‚   β”‚   └── embeddings_controller.py    # Embeddings initialization
β”‚   β”‚   └── chat_models/                    # Concrete LangChain ChatModel subclasses
β”‚   β”‚       β”œβ”€β”€ chat_ollama_wrapper.py      # Ollama model with penalty support
β”‚   β”‚       └── sagemaker_chat.py           # SageMaker ChatModel for LangChain
β”‚   β”‚
β”‚   └── utils/                              # Utilities
β”‚       β”œβ”€β”€ config.py                       # Config loader
β”‚       β”œβ”€β”€ configurator.py                 # First-run setup + /config & /model flows
β”‚       β”œβ”€β”€ paths.py                        # Central path helper (~/.mnemoai)
β”‚       β”œβ”€β”€ logger.py                       # Logging utilities
β”‚       β”œβ”€β”€ bm25.py                         # Lightweight BM25 (hybrid search)
β”‚       β”œβ”€β”€ config.yaml.example             # Config templates (also .bedrock / .bedrock.mantle)
β”‚       β”œβ”€β”€ mcp.json.example                # External MCP servers template
β”‚       └── formatting/                     # Text formatting (code/url/response)
β”‚
β”œβ”€β”€ tests/                                  # Test suite (pytest)
β”‚   β”œβ”€β”€ conftest.py                         # Puts src/ on sys.path
β”‚   β”œβ”€β”€ unit/                               # Fast, deterministic, no deps
β”‚   └── integration/                        # Live agent + Ollama + MCP
β”‚
β”œβ”€β”€ docs/                                   # ARCHITECTURE.md (detailed file map)
└── bash/                                   # Helper scripts
    β”œβ”€β”€ system-command-app/                 # `mnemoai` wrapper script
    β”œβ”€β”€ ollama-freeup-vram/                 # VRAM management
    └── ollama-env-mac/                     # Ollama config

Next steps

  • Getting Started β€” install and configure the assistant
  • Usage β€” commands, feature toggles, and day-to-day use
  • Configuration β€” full configuration reference