vector-db-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vector DB Search

向量数据库搜索

Semantic (meaning-based) search against the ChromaDB vector store. Use for Phase 2 of the 3-phase search protocol -- after the RLM Summary Ledger (Phase 1) returns insufficient results.
基于语义(即基于含义)的ChromaDB向量存储搜索。 用于三步搜索协议的第二阶段——当RLM摘要分类账(第一阶段)返回的结果不足时使用。

Scripts

脚本

ScriptRole
scripts/query.py
Semantic search -- CLI entry point
scripts/operations.py
Core Parent-Child retrieval library
scripts/vector_config.py
Profile config helper (
vector_profiles.json
)
scripts/vector_consistency_check.py
Integrity validation
Write operations (ingest, cleanup) are handled by dedicated agents:
vdb-ingest
,
vdb-cleanup
.
脚本作用
scripts/query.py
语义搜索——CLI入口点
scripts/operations.py
核心父子检索库
scripts/vector_config.py
配置文件辅助工具(
vector_profiles.json
scripts/vector_consistency_check.py
完整性验证
写入操作(如数据导入、清理)由专用Agent处理:
vdb-ingest
vdb-cleanup

When to Use

使用场景

  • Phase 1 (RLM Summary Ledger) returned no match or insufficient detail
  • User asks "how does X work?" / "find code that does Y"
  • You need specific snippets, not just file-level summaries
  • 第一阶段(RLM摘要分类账)未找到匹配结果或细节不足
  • 用户询问"X是如何工作的?" / "查找实现Y功能的代码"
  • 需要特定代码片段,而非仅文件级摘要

Execution Protocol

执行流程

1. Verify ChromaDB is running

1. 验证ChromaDB是否运行

bash
curl -sf http://127.0.0.1:8110/api/v1/heartbeat
If connection refused: run
vector-db-launch
skill (
plugins/vector-db/skills/vector-db-launch/SKILL.md
). For first-time setup: run
vector-db-init
skill (
plugins/vector-db/skills/vector-db-init/scripts/init.py
).
bash
curl -sf http://127.0.0.1:8110/api/v1/heartbeat
如果连接被拒绝:运行
vector-db-launch
Skill(
plugins/vector-db/skills/vector-db-launch/SKILL.md
)。 首次设置:运行
vector-db-init
Skill(
plugins/vector-db/skills/vector-db-init/scripts/init.py
)。

2. Select Profile and Search

2. 选择配置文件并搜索

Profiles are project-defined in
vector_profiles.json
(see
vector-db-init
skill). Any number can exist. Discover what's available:
bash
cat .agent/learning/vector_profiles.json
Common default is
knowledge
-- your project may define more (e.g. separate profiles for code vs docs). When topic is ambiguous, search all profiles.
bash
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py \
  "your natural language question" --profile knowledge --limit 5
Results include ranked parent chunks with RLM Super-RAG context pre-injected.
配置文件在
vector_profiles.json
中由项目定义(请查看
vector-db-init
Skill),可存在任意数量。查看可用配置文件:
bash
cat .agent/learning/vector_profiles.json
常见默认配置文件为
knowledge
——你的项目可能定义了更多(例如,代码和文档使用单独的配置文件)。当主题不明确时,搜索所有配置文件。
bash
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py \
  "your natural language question" --profile knowledge --limit 5
结果包含已注入RLM Super-RAG上下文的排序父块。

Architectural Constraints (Electric Fence)

架构约束(安全边界)

NEVER -- direct database reads

禁止——直接读取数据库

Do not
cat
,
strings
, or
sqlite3
the
.vector_data/
directory. Binary blobs will corrupt your context window and the retrieval pipeline.
Do not
cat
,
strings
, or
sqlite3
the
.vector_data/
directory. Binary blobs will corrupt your context window and the retrieval pipeline.

ALWAYS -- use the API

必须——使用API

All access goes through
query.py
. No exceptions.
All access goes through
query.py
. No exceptions.

Source Transparency Declaration (L5 Pattern)

源透明声明(L5模式)

When search returns empty results, explicitly state:
> Not Found in Vector Store
> Searched profile: [profile_name] for "[query]"
> Profile covers: [scope]
> Not searched: [out-of-scope areas]
当搜索返回空结果时,需明确声明:
> Not Found in Vector Store
> Searched profile: [profile_name] for "[query]"
> Profile covers: [scope]
> Not searched: [out-of-scope areas]