Skip to main content
TextKnowledgeBase 读取 本地 txt 文件,将其转换为向量嵌入并加载到向量数据库中。

用法

本示例使用本地 PgVector 数据库。确保其运行
knowledge_base.py
然后将 knowledge_base 与 Agent 一起使用:
agent.py

TextKnowledgeBase 也支持异步加载。

本示例使用本地 Qdrant 数据库。确保其运行
async_knowledge_base.py

参数

TextKnowledgeBaseAgentKnowledge 类的子类,可以访问相同的参数。

开发资源