rag-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRAG Search
RAG Search
Semantic search using embeddings and vector storage. Search documents semantically using similarity matching.
使用嵌入模型与向量存储的语义搜索。通过相似度匹配对文档进行语义检索。
Setup
配置
No additional setup required. Uses in-memory vector storage with optional embedding providers.
无需额外配置。使用内存向量存储,支持可选的嵌入提供商。
Usage
使用方法
Index Documents
索引文档
bash
{baseDir}/rag-search.js --index --path ./docs --chunk-size 500bash
{baseDir}/rag-search.js --index --path ./docs --chunk-size 500Search Documents
搜索文档
bash
{baseDir}/rag-search.js --search "how to configure authentication"bash
{baseDir}/rag-search.js --search "how to configure authentication"Query with Filters
带筛选条件的查询
bash
{baseDir}/rag-search.js --search "deployment steps" --limit 5bash
{baseDir}/rag-search.js --search "deployment steps" --limit 5Options
选项
| Option | Description | Required |
|---|---|---|
| Index documents | No |
| Path to documents | For index |
| Chunk size for splitting | No |
| Search query | For search |
| Max results to return | No |
| List indexed documents | No |
| Clear index | No |
| 选项 | 描述 | 是否必填 |
|---|---|---|
| 为文档创建索引 | 否 |
| 文档路径 | 创建索引时必填 |
| 文档拆分的块大小 | 否 |
| 搜索查询语句 | 搜索时必填 |
| 返回的最大结果数 | 否 |
| 列出已索引的文档 | 否 |
| 清空索引 | 否 |
Supported Formats
支持的格式
- Plain text (.txt)
- Markdown (.md)
- JSON (.json)
- JavaScript/TypeScript (.js, .ts)
- Python (.py)
- HTML (.html)
- YAML (.yaml, .yml)
- 纯文本文件(.txt)
- Markdown文件(.md)
- JSON文件(.json)
- JavaScript/TypeScript文件(.js, .ts)
- Python文件(.py)
- HTML文件(.html)
- YAML文件(.yaml, .yml)
Embedding Providers
嵌入提供商
- OpenAI (default, requires API key)
- Cohere (requires API key)
- Local (TF-IDF based, no API key needed)
- OpenAI(默认,需要API密钥)
- Cohere(需要API密钥)
- Local(基于TF-IDF,无需API密钥)
Output Format
输出格式
json
{
"results": [
{
"file": "docs/config.md",
"chunk": "To configure authentication...",
"score": 0.92,
"line": 15
}
]
}json
{
"results": [
{
"file": "docs/config.md",
"chunk": "To configure authentication...",
"score": 0.92,
"line": 15
}
]
}When to Use
使用场景
- Semantic search across codebase
- Finding relevant documentation
- Knowledge base queries
- RAG applications
- 代码库的语义搜索
- 查找相关文档
- 知识库查询
- RAG应用