← 返回
AI智能 Key 中文

Ragie.ai-RAG

Execute Retrieval-Augmented Generation (RAG) using Ragie.ai. Use this skill whenever the user wants to: - Search their knowledge base - Ask questions about u...
使用 Ragie.ai 执行检索增强生成 (RAG)。当用户想要以下操作时使用此技能:- 搜索知识库 - 询问关于...
hatim-be
AI智能 clawhub v1.0.2 1 版本 99901.4 Key: 需要
★ 0
Stars
📥 1,013
下载
💾 25
安装
1
版本
#latest

概述

Ragie.ai RAG Skill (OpenClaw Optimized)

This skill enables grounded question answering using Ragie.ai as a RAG backend.

Ragie handles:

  • Document chunking
  • Embedding
  • Vector indexing
  • Retrieval
  • Optional reranking

The agent handles:

  • Deciding when to ingest
  • Triggering retrieval
  • Constructing grounded prompts
  • Producing final answers

Core Principles

  1. Never answer without retrieval.
  2. Never hallucinate information not present in retrieved chunks.
  3. Always cite the document_name when referencing specific facts.
  4. If retrieval returns zero relevant chunks, explicitly say:

> "I don't have that information in the current knowledge base."

  1. Do not expose API keys or raw API payloads in final answers.

Deterministic Workflow

Case A — User Provides a File or URL

IF the user provides:

  • A file
  • A document path
  • A PDF/URL to ingest

THEN:

  1. Execute ingestion:

```bash

python skills/scripts/ingest.py --file --name ""

```

OR

```bash

python skills/scripts/ingest.py --url "" --name ""

```

  1. Capture returned document_id.
  1. Poll document status:

```bash

python skills/scripts/manage.py status --id

```

Repeat until status == ready.

  1. Proceed to Retrieval (Case C).

Case B — User Requests Document Management

List documents

python `skills/scripts/manage.py` list

Check document status

python `skills/scripts/manage.py` status --id <document_id>

Delete a document

python `skills/scripts/manage.py` delete --id <document_id>

Return structured results to the user.


Case C — Retrieval (Grounded Question Answering)

Execute:

python `skills/scripts/retrieve.py` \
  --query "<user_question>" \
  --top-k 6 \
  --rerank

Optional flags:

  • --partition
  • --filter '{"key":"value"}'

Retrieval Output Format

Expected output:

[
  {
    "text": "...",
    "score": 0.87,
    "document_name": "Policy Handbook",
    "document_id": "doc_abc123"
  }
]

Grounded Prompt Construction

After retrieval:

  1. Extract all chunk text.
  2. Concatenate with separators.
  3. Construct this prompt:
SYSTEM:
You are a helpful assistant.
Answer using ONLY the context provided below.
If the context does not contain the answer, say:
"I don't have that information in the current knowledge base."

CONTEXT:
[chunk 1 text]
---
[chunk 2 text]
---
...

USER QUESTION:
{original user question}
  1. Generate final answer.
  2. Cite document_name when referencing information.

Output Contract

The final response MUST:

  • Be grounded only in retrieved chunks
  • Cite document_name for factual claims
  • Avoid hallucinations
  • Avoid mentioning internal execution steps
  • Avoid exposing API keys or raw responses
  • Clearly state when information is missing

If no chunks are returned:

I don't have that information in the current knowledge base.

API Reference

Base URL:

https://api.ragie.ai
OperationMethodEndpoint
------------------------------------------------------
Ingest filePOST/documents
Ingest URLPOST/documents/url
Retrieve chunksPOST/retrievals
List documentsGET/documents
Get documentGET/documents/{id}
Delete documentDELETE/documents/{id}

Error Handling

HTTP CodeMeaningAction
---------------------------------------------------------------------
404Document not foundVerify document_id
422Invalid payloadValidate request schema
429Rate limitedRetry with backoff
5xxServer errorRetry or check Ragie status

If ingestion fails:

  • Report failure clearly.
  • Do not proceed to retrieval.

If retrieval fails:

  • Retry once.
  • If still failing, inform user.

Decision Rules Summary

  1. If user uploads content → ingest → wait until ready → retrieve.
  2. If user asks question → retrieve immediately.
  3. If zero chunks → state knowledge gap.
  4. Always use reranking unless explicitly disabled.
  5. Never answer without retrieval.

Advanced Usage

  • Use metadata filter to narrow retrieval scope.
  • Use partitions to separate tenant data.
  • Use recency_bias only when time relevance matters.
  • Adjust top_k depending on query complexity.

Security

  • API keys must be loaded from environment variables.
  • .env must not be committed.
  • Do not log sensitive headers.

Summary

This skill provides:

  • Deterministic ingestion
  • Deterministic retrieval
  • Strict grounded answering
  • Complete Ragie lifecycle management
  • Safe and hallucination-resistant RAG execution

End of Skill.

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 16:38 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,123
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,006
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 799,685