Ollama + OpenClaw Local Memory & Vector Search System for Openclaw

An offline-first, highly secure local memory and vector search system for AI agents powered by Ollama and OpenClaw.

paudyyin
v1.0.0
Jun 11, 2026
0
667
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ollama-openclaw-memory-guide

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ollama-openclaw-memory-guide using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Ollama + OpenClaw Local Memory & Vector Search System?

This integration guides developers through deploying a fully local, self-hosted memory and vector search system using Ollama and OpenClaw. Designed specifically for restricted environments such as corporate Windows machines where running system installers or accessing cloud APIs is restricted, this skill enables offline embeddings, conversation logging, semantic chunking, and user profiling.

By leveraging the portable version of Ollama and the nomic-embed-text model, developers can set up high-performance L1/L2/L3 memory extraction pipelines. This ensures that your AI agents maintain long-term contextual continuity and robust information retrieval capabilities without relying on external APIs, ensuring absolute privacy and data sovereignty.

Ollama + OpenClaw Local Memory & Vector Search System Use Cases

  • Deploying secure AI agents in corporate environments with strict restrictions on installing third-party MSI/EXE packages.
  • Operating AI memory systems completely offline to comply with rigorous privacy, security, and data protection policies.
  • Building multi-tiered context retrieval (L1/L2/L3) for persistent, agentic memory in Openclaw Skills.
  • Upgrading existing full-text search (FTS) pipelines to advanced semantic vector-based search using local models.

How Ollama + OpenClaw Local Memory & Vector Search System Works

  1. Portable Deployment: The portable version of Ollama is downloaded and extracted directly into the local tools directory without requiring administrator privileges.
  2. Local Embedding Service: Ollama initializes the local nomic-embed-text model to provide a robust 768-dimensional local vector embedding service.
  3. Memory Storage: The main memory plugin writes dialog histories, extracted chunks, and user profiling schemas locally using SQLite and structured files.
  4. Context Retrieval: The OpenClaw Gateway connects to the local Ollama endpoint via an OpenAI-compatible API to perform semantic vector lookups.
  5. Background Sync: Extraction pipelines run autonomously in the background, updating cognitive models, knowledge graphs, and active user profiles on specific conversation triggers.

Ollama + OpenClaw Local Memory & Vector Search System Setup

First, fetch the portable release of Ollama. We recommend downloading the ZIP directly or using a git-mirror:

# Download the portable ZIP into your temp folder
Invoke-WebRequest -Uri "https://www.modelscope.cn/models/ollama/ollama-windows/resolve/master/ollama-windows-amd64.zip" -OutFile "D:/temp/ollama-windows-amd64.zip"

Next, extract the binaries into the designated OpenClaw environment directories:

# Create the local directory structure
New-Item -ItemType Directory -Force -Path "$env:APPDATA/mx/openclaw-home/$env:USERNAME/.openclaw/tools/ollama"
New-Item -ItemType Directory -Force -Path "$env:APPDATA/mx/openclaw-home/$env:USERNAME/.openclaw/ollama-data/models"

# Extract the portable files
Expand-Archive -Path "D:/temp/ollama-windows-amd64.zip" -DestinationPath "$env:APPDATA/mx/openclaw-home/$env:USERNAME/.openclaw/tools/ollama" -Force

Configure your local models environment and run the background service:

$env:OLLAMA_MODELS = "$env:APPDATA/mx/openclaw-home/$env:USERNAME/.openclaw/ollama-data/models"
Set-Location "$env:APPDATA/mx/openclaw-home/$env:USERNAME/.openclaw/tools/ollama"
Start-Process -FilePath ".\\ollama.exe" -ArgumentList "serve" -WindowStyle Hidden

Pull the required vector embedding model:

.\\ollama.exe pull nomic-embed-text

Now, update your .openclaw/openclaw.json configuration file to point to your local Ollama instance and enable memory-tencentdb:

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "enabled": true,
        "provider": "openai",
        "model": "nomic-embed-text",
        "remote": {
          "baseUrl": "http://localhost:11434/v1",
          "apiKey": "ollama"
        }
      }
    }
  },
  "plugins": {
    "enabled": true,
    "allow": ["mx", "memory-tencentdb"],
    "load": {
      "paths": ["D:/Users/YOUR_USERNAME/AppData/Roaming/mx/openclaw-home/YOUR_USERNAME/.openclaw/plugins/memory-tencentdb"]
    },
    "slots": {
      "memory": "memory-tencentdb"
    }
  }
}

Finally, rebuild your vector index for existing archives:

pip install requests tqdm
python scripts/rebuild_vector_index.py --incremental

Ollama + OpenClaw Local Memory & Vector Search System Data Schema & Taxonomy

The local memory and vector search system organizes data in a clean directory hierarchy, caching vector embeddings alongside raw databases for optimized processing:

Location / File Path Data Format Description
.openclaw/tools/ollama/ Binary Portable Ollama engine binaries
.openclaw/ollama-data/models/ Model Blobs Local nomic-embed-text weights and configuration
workspace/memory/main.sqlite SQLite DB Core database housing full-text search and embedding_cache
memory/ontology/graph.jsonl JSONL Dynamic, incrementally built knowledge graphs and relational maps
memory-tdai/recall_checkpoint.json JSON Tracking checkpoint status for active L1/L2 extraction runs

Ollama + OpenClaw Local Memory & Vector Search System Advanced Features

  • Multi-Level Extraction (L0-L3): Progresses context logically from raw dialog logs (L0) to clean summaries (L1), semantic scenes (L2), and full user persona profiles (L3).
  • Automated Memory Rebuilding: Incremental processing script (rebuild_vector_index.py --incremental) optimizes execution time by scanning changes in your workspace and running only modified chunks.
  • Admin-Free Persistence: Integrates an lightweight startup automation mechanism via VBScript to seamlessly launch local engines on Windows logins without administrative elevation requirements.
  • Granular Keep-Alive Fine-Tuning: Configurable OLLAMA_KEEP_ALIVE variable allows developers to offload local neural models from memory during inactive periods, conserving host hardware resources.
  • Flexible API Interoperability: Utilizes fully OpenAI-compatible endpoints, unlocking instant integrations across alternative local agents in Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*