Overview
Architecture¶

- User messages OpenClaw on Telegram, WhatsApp, or CLI
- gemma4:e2b handles chat and may invoke the agentic-rag skill
- Skill runs
rag_query.sh→ LitServePOST /predicton port 8001 - CrewAI Researcher + Writer use Qdrant (and optional Firecrawl)
- Answer returns through OpenClaw to the channel
| Layer | Role |
|---|---|
| OpenClaw | Channels, sessions, tools, skills, daemon |
| gemma4:e2b | Fast local chat + tool planning (~7GB) |
| agentic-rag skill | Calls your LitServe /predict endpoint |
| qwen-agentic-rag | Two-agent RAG API (same gemma4:e2b via .env) |
1. RAG API (terminal A)¶
cd guides/qwen-agentic-rag
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
ollama pull gemma4:e2b
cp ../openclaw-gemma-rag/env.rag.example .env # OLLAMA_MODEL=ollama/gemma4:e2b
python setup_vectordb.py # once
python server.py # default http://127.0.0.1:8001
2. OpenClaw + Gemma (terminal B)¶
cd guides/openclaw-gemma-rag && source ./use-node22.sh # Node 22+ required
ollama pull gemma4:e2b
npm install -g openclaw@latest
openclaw onboard --install-daemon
openclaw models set ollama/gemma4:e2b
Merge config/openclaw.snippet.json5 (in this guide folder) into ~/.openclaw/openclaw.json, then:
cd guides/openclaw-gemma-rag
chmod +x install-skill.sh skills/agentic-rag/scripts/*.sh
./install-skill.sh
openclaw gateway restart
3. Test¶
# RAG health
RAG_API_URL=http://127.0.0.1:8001 ./skills/agentic-rag/scripts/rag_health.sh
# OpenClaw agent (uses gemma; may call RAG skill for ML questions)
openclaw agent --message "What is cross-validation? Use the knowledge base if helpful." --thinking low
Project layout¶
| Path | Purpose |
|---|---|
skills/agentic-rag/SKILL.md |
OpenClaw skill instructions |
skills/agentic-rag/scripts/rag_query.sh |
POST query to LitServe |
install-skill.sh |
Copy skill into ~/.openclaw/workspace/skills/ |
use-node22.sh / .nvmrc |
Switch to Node 22+ for OpenClaw CLI |
env.rag.example |
Gemma .env for the RAG crew |
test-local.sh |
Smoke test: Ollama, RAG API, skill scripts |
assets/openclaw-gemma-rag-workflow.gif |
Animated architecture diagram |
assets/render_workflow_gif.py |
Regenerate GIF from HTML source |
config/openclaw.snippet.json5 |
Model + skill env sample config |
TUTORIAL.md |
Full setup (channels, security, troubleshooting) |