LlamaIndex
public: 2025-04-19 See also the main item: /LLM. 类似/相关: haystack ref: LlamaIndex 原理与应用简介(不同场景下的架构逻辑) by bilibili 字节字节 LlamaIndex 的核心功能 # 知识库问答示例 总体流程: 载入数据,切分 构建 index ·持久化 index ·查询与生成 Data connectors:APIs,pdf,ppt,docx,markdown,image,audio,video,tables… Index:list,vector store,tree,keyword table,Pandas,SQL 存储,与各类向量数据库的对接。0.6 版本之后更加复杂,分成 doc,indexi 和 vector3 三块存储 Query:.各种对应 index 的查询与结果生成,主要分成 retrieve(召回)和 synthesize(整合生成)两部分 Query 结果中的 extra_info,支持引用展示 Post process:召回的“后处理”,例如关键词过滤,重排序等 定制化,包括 LLM,prompt,embedding,存储等 Optimizers,优化调用,节省 token 与 Query 相关的特性与场景 # Vector Index - 常用于 QA # Tree Index - 多个知识库的场景(自底向上用 Prompt & synthesis 的方法递归生成 parent nodes) # Keyword Table Index - 常用于问题比较短,有很多专有词的场景(Keywords 也是通过 prompt 生成) # DEFAULT_KEYWORD_EXTRACT_TEMPLATE_TMPL = ( "Some text is provided below. ...