特色栏目

ASP源码

PHP源码

.NET源码

JSP源码

游戏频道
专题合集
关闭菜单
首页> AI教程> RAGLite: 本地优先的 RAG 缓存与文档检索 - Openclaw Skills

RAGLite: 本地优先的 RAG 缓存与文档检索 - Openclaw Skills

时间:2026-03-20 19:30:01 作者:互联网

什么是 raglite?

RAGLite 是一个强大且本地优先的检索增强生成 (RAG) 缓存,旨在存储和管理模型未训练过的信息。通过利用 Openclaw Skills,它允许开发人员将敏感数据保留在自己的机器上,同时为本地和私有知识提供持久的存储空间。该技能专注于“嵌入前压缩”的方法,先将文档提取为人类可读的 Markdown,以确保更可靠的检索和更廉价的提示词消耗。

与依赖托管向量数据库不同,RAGLite 使用 Chroma 和 ripgrep 等成熟的开源工具。这种架构为私人笔记、医疗记录或内部运行手册提供了一个可审计且版本可控的系统。它专门构建为将源数据视为不可信,并在提取过程中加入了针对提示词注入的安全措施。

下载入口:https://github.com/openclaw/skills/tree/main/skills/virajsanghvi1/raglite

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install raglite

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 raglite。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Install

raglite 应用场景

raglite 工作原理
  1. 提取引擎(默认为 OpenClaw)将源文档处理为结构化 Markdown 以去除重复内容。
  2. 系统将提取后的内容索引到本地 Chroma 向量数据库中。
  3. Ripgrep 与向量数据库配合使用,以实现强大的混合检索(关键词 + 向量搜索)。
  4. 用户查询集合,RAGLite 从本地缓存中检索最相关的上下文,以辅助代理进行回答。

raglite 配置指南

要开始在 Openclaw Skills 设置中使用 RAGLite,请确保已安装 python3、pip 和 ripgrep (rg)。运行以下命令以创建本地虚拟环境并安装必要的软件包:

./scripts/install.sh

这会将 raglite-chromadb 软件包安装到技能本地目录中。

raglite 数据架构与分类体系

RAGLite 组织其工件以确保它们既可由机器读取又可由人工审计。数据结构定义如下:

组件 类型 描述
输出目录 文件系统路径 存储提取后的 Markdown 文件和本地 Chroma 数据库。
提取后的文档 Markdown 源材料的人类可读、压缩版本。
向量索引 Chroma DB 用于语义搜索查询的本地向量存储。
引擎 配置 指定处理引擎,默认为 OpenClaw。
name: raglite
version: 1.0.8
description: "Local-first RAG cache: distill docs into structured Markdown, then index/query with Chroma (vector) + ripgrep (keyword)."
metadata:
  {
    "openclaw": {
      "emoji": "??",
      "requires": { "bins": ["python3", "pip", "rg"] }
    }
  }

RAGLite — a local RAG cache (not a memory replacement)

RAGLite is a local-first RAG cache.

It does not replace model memory or chat context. It gives your agent a durable place to store and retrieve information the model wasn’t trained on — especially useful for local/private knowledge (school work, personal notes, medical records, internal runbooks).

Why it’s better than paid RAG / knowledge bases (for many use cases)

Security note (prompt injection)

RAGLite treats extracted document text as untrusted data. If you distill content from third parties (web pages, PDFs, vendor docs), assume it may contain prompt injection attempts.

RAGLite’s distillation prompts explicitly instruct the model to:

Open source + contributions

Hi — I’m Viraj. I built RAGLite to make local-first retrieval practical: distill first, index second, query forever.

If you hit an issue or want an enhancement:

Contributors are welcome — PRs encouraged; maintainers handle merges.

Default engine

This skill defaults to OpenClaw ?? for condensation unless you pass --engine explicitly.

Install

./scripts/install.sh

This creates a skill-local venv at skills/raglite/.venv and installs the PyPI package raglite-chromadb (CLI is still raglite).

Usage

# One-command pipeline: distill → index
./scripts/raglite.sh run /path/to/docs r
  --out ./raglite_out r
  --collection my-docs r
  --chroma-url http://127.0.0.1:8100 r
  --skip-existing r
  --skip-indexed r
  --nodes

# Then query
./scripts/raglite.sh query "how does X work?" r
  --out ./raglite_out r
  --collection my-docs r
  --chroma-url http://127.0.0.1:8100

Pitch

RAGLite is a local RAG cache for repeated lookups.

When you (or your agent) keep re-searching for the same non-training data — local notes, school work, medical records, internal docs — RAGLite gives you a private, auditable library:

  1. Distill to structured Markdown (compression-before-embeddings)
  2. Index locally into Chroma
  3. Query with hybrid retrieval (vector + keyword)

It doesn’t replace memory/context — it’s the place to store what you need again.

相关文章

热门文章

猜你喜欢

返回顶部