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).

β¨ 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