vector

package
v0.0.0-...-1c978d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package vector 把向量知识库检索接成一种工具源(source type: vector), 与 http/mcp/rpc 并列——RAG 在本框架里就是 tools 层的一种工具,不是 独立组件。运行时消费检索结果;离线摄入(文档→切块→embedding)不归 框架管,由外部数据 pipeline 或知识库产品负责。

配置:

tools:
  - name: kb                     # source 名 = 检索能力的 namespace
    type: vector
    config:
      description: "产品文档知识库,含退货/物流政策"  # 决定大脑的调用意愿
      tool_name: search_kb       # 可省略,默认 search_knowledge_base
      top_k: 5
      max_doc_len: 800           # 单文档注入截断,<=0 不截
      backend: inmemory          # 缺省内置词法保底;真实向量库经 RegisterBackend
      backend_config: {...}      # 真实后端的连接配置
      docs: ["退货政策:7天无理由", ...]  # inmemory 后端的语料(demo/测试)

检索能力自带双形态:component/agent 的工具面引用它 = agentic RAG (大脑决定要不要查、查什么);graph skill 的前置步骤引用它 = 经典 RAG 管线(每轮必查、结果注入),不需要额外机制。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL