Skip to content

[Bug] markdown文件与txt文件大部分时候都无法上传至知识库,报错not same nb of vectors as ids #7589

@jin6yang

Description

@jin6yang

What happened / 发生了什么

当markdown文件和txt尝试上传知识库时,报错,如下面日志所示。
推测原因:嵌入向量生成阶段出了问题。

Reproduce / 如何复现?

尝试拿长篇markdown文件和txt文件上传知识库

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot Desktop 4.23.1

OS

Windows

Logs / 报错日志

[2026-04-15 23:17:25.501] [Core] [DBUG] [faiss_impl.vec_db:84]: Generating embeddings for 2 contents...
[2026-04-15 23:17:25.818] [Core] [DBUG] [faiss_impl.vec_db:93]: Generated embeddings for 2 contents in 0.32 seconds.
[2026-04-15 23:17:25.820] [Core] [ERRO] [v4.23.1] [knowledge_base.kb_helper:352]: 上传文档失败: not same nb of vectors as ids
[2026-04-15 23:17:25.820] [Core] [ERRO] [v4.23.1] [routes.knowledge_base:190]: 上传文档 XXX.md 失败: not same nb of vectors as ids

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreThe bug / feature is about astrbot's core, backendbugSomething isn't workingfeature:knowledge-baseThe bug / feature is about knowledge base

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions