qmd-extended

$npx mdskill add aAAaqwq/AGI-Super-Team/qmd-extended

Manage QMD embeddings across Google, Ollama, and local backends.

  • Handles embedding generation, backend switching, and vector search troubleshooting.
  • Integrates with Google AI Studio, Ollama, and node-llama-cpp services.
  • Executes specific scripts for testing, switching, and re-indexing operations.
  • Delivers results via command-line execution and status reporting.

SKILL.md

.github/skills/qmd-extendedView on GitHub ↗
---
name: qmd-extended
description: Extended QMD knowledge base with multi-backend embedding (Google AI Studio / Ollama / local). Use when managing QMD embeddings, switching backends, testing embedding quality, re-indexing, or troubleshooting QMD vector search. Triggers on "qmd embed", "embedding backend", "切换embedding", "embedding测试", "re-embed", "知识库embedding", "qmd扩展". For general QMD queries and knowledge retrieval, use memory-router skill instead.
---

# QMD Extended — Multi-Backend Embedding Manager

## Architecture

QMD's `llm.js` is patched (v2) to support three embedding backends:

```
QMD_EMBED_BACKEND=google|ollama|local

google  → Google AI Studio gemini-embedding-001 (3072-dim, free)
ollama  → Mac Studio Ollama qwen3-embedding:8b (4096-dim, LAN)
local   → node-llama-cpp embeddinggemma-300M (768-dim, CPU)
```

Auto-detect priority: google → ollama → local

## Quick Commands

### Test current backend
```bash
bash ~/clawd/skills/qmd-extended/scripts/embed-test.sh        # test current
bash ~/clawd/skills/qmd-extended/scripts/embed-test.sh all     # test all backends
bash ~/clawd/skills/qmd-extended/scripts/embed-test.sh google "自定义文本"
```

### Switch backend
```bash
bash ~/clawd/skills/qmd-extended/scripts/embed-switch.sh google   # switch to Google
bash ~/clawd/skills/qmd-extended/scripts/embed-switch.sh ollama   # switch to Ollama
# ⚠️ After switching: qmd embed -f  (required — dimensions change)
```

### Check status
```bash
bash ~/clawd/skills/qmd-extended/scripts/embed-status.sh
```

## Environment Variables

| Var | Default | Purpose |
|-----|---------|---------|
| `QMD_EMBED_BACKEND` | auto | Force backend: `google`/`ollama`/`local` |
| `QMD_GOOGLE_EMBED_KEY` | via `pass` | Google API key (auto-read from pass store) |
| `QMD_GOOGLE_EMBED_MODEL` | `gemini-embedding-001` | Google model name |
| `QMD_OLLAMA_EMBED_URL` | — | Ollama host (e.g. `http://100.65.110.126:11434`) |
| `QMD_OLLAMA_EMBED_MODEL` | `qwen3-embedding:8b` | Ollama model name |

## Patch Location

```
/home/aa/.npm-global/lib/node_modules/@tobilu/qmd/dist/llm.js
Backup: llm.js.bak (original pre-patch)
```

⚠️ `npm update @tobilu/qmd` will overwrite the patch. Re-apply from backup or re-run the patch script.

## Backend Details

See `references/backends.md` for API docs, dimensions, rate limits, and comparison table.

## Re-Embedding Workflow

When switching backends or after fresh install:

```bash
# 1. Switch backend
export QMD_EMBED_BACKEND=google

# 2. Force re-embed all collections
qmd embed -f

# 3. Verify
qmd status
bash ~/clawd/skills/qmd-extended/scripts/embed-status.sh
```

## Troubleshooting

| Issue | Fix |
|-------|-----|
| `qmd embed` hangs at compile | First run builds node-llama-cpp. Wait ~10 min. Only affects `local` backend. |
| `Google embed error: 429` | Rate limit hit. Wait 60s or reduce batch size. |
| `Ollama embed: offline` | Mac Studio sleeping. Wake it or switch to `google`. |
| Dimension mismatch in search | Backend changed without re-embed. Run `qmd embed -f`. |
| `pass: api/google-ai-studio not found` | Set `QMD_GOOGLE_EMBED_KEY` env var directly instead. |

More from aAAaqwq/AGI-Super-Team

SkillDescription
a-fund-monitor监控 A 股基金实时估值与盘后净值,自动判断交易日并生成提醒或分析。
add-leadAdd company/person/relationship to CRM
ads-agentAI-агент для управления Facebook рекламой. Вызывай для анализа, оптимизации, создания кампаний и отчётов.
afrexai-compliance-auditRun internal compliance audits against major governance and security
afrexai-personal-financeComplete personal finance system — budgeting, debt payoff, investing, tax optimization, net worth tracking, and financial independence planning. Use when managing money, building wealth, paying off debt, planning retirement, or optimizing taxes. Zero dependencies.
after-salesUse when managing post-purchase experience, building customer loyalty, or increasing repeat purchases
agent-contactsAI agent contacts — add, list, remove MCP contacts. Use when someone gives an agent URL, or when you need to view/remove contacts.
agent-model-switcher批量查看和切换子 agent 的模型配置,用于统一调整多 agent 的 provider/model 设置。
agent-patternsFormat SPAWN REQUEST messages to launch parallel agents, generate structured agent status reports, and define communication protocols within the sprint system. Use when the user needs to coordinate multiple agents, format spawn requests, produce agent reports, or establish inter-agent communication patterns.
agent-task-confirmUse when confirming whether a dispatched agent task was actually received, activated, and progressing after sessions_send or other task handoff actions.