AO

aashidutt/openclaw_mem0_ollama

Developer tools
6 stars Quality 45 Trend 14

A coding assistant that — preferences, tools, project context, and coding style — without sending anything to the cloud.

Overview

A coding assistant that — preferences, tools, project context, and coding style — without sending anything to the cloud. 1. Mem0 searches Qdrant for the top-5 relevant memories 2. Memories are injected into the system prompt 3. qwen3:8b generates a response (aware of your style + project) 4. Smart filter asks: "is this worth remembering long-term?" 5. High-value facts are persisted in Qdrant for future sessions The smart filter prevents memory bloat by only storing what actually matters: After cloning, update the command path in skills/local-ai-assistant/SKILL.md to point to your actual run.sh location:

README

Local AI Coding Assistant

qwen3:8b (Ollama) + Mem0 OSS + Qdrant — fully local, no API keys

A coding assistant that remembers you across sessions — preferences, tools, project context, and coding style — without sending anything to the cloud.


Architecture

┌────────────────────────────────────────────────────────┐
│              LocalAssistant  (main.py)                 │
├──────────────────────┬─────────────────────────────────┤
│  SmartMemoryManager  │   Ollama  qwen3:8b              │
│  (memory_manager.py) │   chat inference                │
│                      │                                 │
│  ┌────────────────┐  │  ┌─────────────────────────┐   │
│  │  Mem0 OSS      │──│─▶│  System prompt with      │   │
│  │  + Qdrant      │  │  │  injected memories       │   │
│  │  (local)       │  │  └─────────────────────────┘   │
│  └────────────────┘  │                                 │
│  Smart filter:       │                                 │
│  only stores         │                                 │
│  high-value facts    │                                 │
└──────────────────────┴─────────────────────────────────┘

Per-message flow:

  1. Mem0 searches Qdrant for the top-5 relevant memories
  2. Memories are injected into the system prompt
  3. qwen3:8b generates a response (aware of your style + project)
  4. Smart filter asks: “is this worth remembering long-term?”
  5. High-value facts are persisted in Qdrant for future sessions

Prerequisites

Requirement Notes
Ollama Running locally
Docker For Qdrant
Python 3.11+
OpenClaw For skill invocation

Setup (one time)

1. Pull Ollama models:

ollama pull qwen3:8b
ollama pull nomic-embed-text

2. Start Qdrant:

docker run -d --name qdrant-local \
  -p 6333:6333 \
  -v $(pwd)/qdrant_storage:/qdrant/storage \
  qdrant/qdrant

3. Install Python deps:

pip install -r requirements.txt

Running

Web UI (recommended):

bash run_web.sh
# → Open http://127.0.0.1:8765

CLI:

bash run.sh "Write a Python function to validate an email address"
bash run.sh "I prefer TypeScript and always use zod for validation"

Via OpenClaw skill:

/local-ai-assistant Write a function to debounce API calls

Smart Memory Layer

The smart filter prevents memory bloat by only storing what actually matters:

Message Stored? Why
“I prefer TypeScript over JavaScript” ✅ Language preference
“I use pytest, never unittest” ✅ Tool preference
“My project is called Nebula — FastAPI service” ✅ Project context
“What does enumerate() do?” ❌ Transient question
“Thanks!” ❌ No lasting context

Files

local-ai-assistant/
├── SKILL.md              OpenClaw skill definition
├── requirements.txt      Python dependencies
├── README.md
├── run.sh                CLI launcher (used by SKILL.md)
├── run_web.sh            Web UI launcher
├── web_runs/             Per-run outputs (auto-created)
│   └── run_YYYYMMDD_*/
│       ├── response.md
│       ├── memories.json
│       └── tool_trace.json
└── src/
    ├── config.py         All settings (model, Mem0, prompts)
    ├── memory_manager.py Mem0 wrapper + smart filter
    ├── main.py           CLI entry point + output writer
    └── web_assistant.py  Local HTTP server + chat UI

Updating the SKILL.md path

After cloning, update the command path in skills/local-ai-assistant/SKILL.md to point to your actual run.sh location:

bash /your/actual/path/to/local-ai-assistant/run.sh ""
View the full README on GitHub

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add aashidutt/openclaw_mem0_ollama
New to MCP? Start with the mcpskill.org guide →