From rag-service
Edit the content of an existing chunk in the RAG knowledge base. Use when a chunk has a typo, outdated info, wrong tags, wrong visibility, or needs its title/question/answer rewritten — and you want the fix to take effect immediately. Requires admin scope. Prefer zeabur-rag-report for surfacing issues without write access.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rag-service:zeabur-rag-editThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Update the content of an existing chunk in place. Embedding is recomputed automatically when the searchable text changes, and the BM25 cache is cleared so the change is live on the next query.
Update the content of an existing chunk in place. Embedding is recomputed automatically when the searchable text changes, and the BM25 cache is cleared so the change is live on the next query.
Base URL: $ZEABUR_RAG_URL
Auth: Authorization: Bearer $RAG_API_KEY — admin scope required
| Situation | Use this skill |
|---|---|
| Fixing a typo or stale fact in an existing chunk | ✅ |
Adjusting tags or toggling visibility (public ↔ internal) | ✅ |
| Rewriting the answer because the procedure changed | ✅ |
| You don't have admin scope | ❌ Use zeabur-rag-report instead |
| The knowledge doesn't exist yet | ❌ Use zeabur-rag-learn instead |
PATCH /api/admin/chunks/:id — pass any subset of editable fields.
curl -s -X PATCH "$ZEABUR_RAG_URL/api/admin/chunks/<chunk_id>" \
-H "Authorization: Bearer $RAG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated title",
"answer": "Corrected content",
"text_content": "Updated title\nCorrected content"
}'
| Field | Type | Notes |
|---|---|---|
title | string | Display title |
question | string | Question form (mainly for forum chunks) |
answer | string | Main body |
tags | string[] | Replaces the existing tag array |
url | string | Source URL |
text_content | string | The text that gets embedded and BM25-indexed |
visibility | "public" | "internal" | Hard-filters search results |
status | "unverified" | "verified" | "rejected" | Lifecycle state |
If you update any of title / question / answer, you MUST also pass a new text_content. The server enforces this and returns 400 otherwise. The reason: embedding and BM25 index are built from text_content, not from the display fields — letting them drift apart silently corrupts search quality.
How to construct text_content:
| Source | Convention |
|---|---|
learned | ${title}\n${answer} |
forum (SUP-*) | Question: ${question}\n\nAnswer: ${answer} |
docs (DOC-*) | Use the exact body text that was originally indexed; if unsure, fetch the chunk first via GET /api/admin/chunks/:id and adapt |
When in doubt, read the existing text_content first, then rewrite it in the same shape.
text_contentPure metadata changes — tags, url, visibility, status — don't touch the embedding, so text_content is not required:
curl -s -X PATCH "$ZEABUR_RAG_URL/api/admin/chunks/SUP-1234" \
-H "Authorization: Bearer $RAG_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tags": ["billing", "stripe"], "visibility": "internal"}'
zeabur-rag-search or GET /api/admin/chunks?search=... to get its ID and current contents.GET /api/admin/chunks/:id returns the full record including text_content. Confirm you're editing what you think you're editing.text_content if any of title/question/answer are in the patch.{
"success": true,
"id": "SUP-1234",
"updated_fields": ["title", "answer", "text_content"],
"embedding_updated": true
}
embedding_updated: true means the chunk was re-embedded. Every edit is logged to rag_audit_log with action edit and a diff of old vs new values, and the BM25 cache is cleared so the next query sees the change.
| Status | Cause |
|---|---|
400 | Updated title/question/answer without providing text_content, or invalid visibility/status/tags |
401 / 403 | Missing/invalid key, or key lacks admin scope |
404 | Chunk ID does not exist |
500 | DB or embedding service error — safe to retry |
zeabur-rag-report instead of patching.public → internal immediately hides the chunk from public search. Confirm before doing this.npx claudepluginhub zeabur/rag-service --plugin rag-serviceCRUD operations on a gnosis-mcp knowledge base — add, delete, update, or inspect single documents. For bulk ingest or prune, use /gnosis:ingest instead.
Use when compiling raw sources into the wiki, querying the knowledge base, running health checks or lint on the wiki, evolving or improving wiki coverage, or when user says 'compile', 'update the wiki', 'query', 'lint', 'health check', 'evolve', 'what's missing', or 'suggest improvements'. Also triggers on questions that should be answered from the knowledge base.