✓ Verified 🌐 Web Scrapers ✓ Enhanced Data

Ragie Rag

Execute Retrieval-Augmented Generation (RAG) using Ragie.ai.

Rating
4.7 (309 reviews)
Downloads
1,430 downloads
Version
1.0.0

Overview

Execute Retrieval-Augmented Generation (RAG) using Ragie.ai.

Complete Documentation

View Source →

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

  • Never answer without retrieval.
  • Never hallucinate information not present in retrieved chunks.
  • Always cite the document_name when referencing specific facts.
  • If retrieval returns zero relevant chunks, explicitly say:
> "I don't have that information in the current knowledge base."
  • 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:
  • Execute ingestion:
bash
python `skills/scripts/ingest.py` --file <path> --name "<document_name>"
OR
bash
python `skills/scripts/ingest.py` --url "<url>" --name "<document_name>"
  • Capture returned document_id.
  • Poll document status:
bash
python `skills/scripts/manage.py` status --id <document_id>
Repeat until status == ready.
  • Proceed to Retrieval (Case C).

Case B — User Requests Document Management

List documents

bash
python `skills/scripts/manage.py` list

Check document status

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

Delete a document

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

Return structured results to the user.


Case C — Retrieval (Grounded Question Answering)

Execute:

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

Optional flags:

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

Retrieval Output Format

Expected output:

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


Grounded Prompt Construction

After retrieval:

  • Extract all chunk text.
  • Concatenate with separators.
  • Construct this prompt:
text
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}
  • Generate final answer.
  • 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:
text
I don't have that information in the current knowledge base.


API Reference

Base URL:

text
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

  • If user uploads content → ingest → wait until ready → retrieve.
  • If user asks question → retrieve immediately.
  • If zero chunks → state knowledge gap.
  • Always use reranking unless explicitly disabled.
  • 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.

Installation

Terminal bash

openclaw install ragie-rag
    
Copied!

💻Code Examples

--rerank

---rerank.txt
Optional flags:
- `--partition <name>`
- `--filter '{"key":"value"}'`

---

# Retrieval Output Format

Expected output:

]

.txt
---

# Grounded Prompt Construction

After retrieval:

1. Extract all chunk `text`.
2. Concatenate with separators.
3. Construct this prompt:

{original user question}

original-user-question.txt
4. Generate final answer.
5. 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.

i-dont-have-that-information-in-the-current-knowledge-base.txt
---

# API Reference

Base URL:
example.sh
python `skills/scripts/retrieve.py` \
  --query "<user_question>" \
  --top-k 6 \
  --rerank
example.json
[
  {
    "text": "...",
    "score": 0.87,
    "document_name": "Policy Handbook",
    "document_id": "doc_abc123"
  }
]
example.txt
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}

Tags

#search_and-research

Quick Info

Category Web Scrapers
Model Claude 3.5
Complexity One-Click
Author hatim-be
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install ragie-rag