Haystack AlloyDB 集成实战:基于 Google Cloud AlloyDB 与 pgvector 的向量检索、关键词检索与文档存储全指南
2026/9/13 4:02:39 网站建设 项目流程

Haystack AlloyDB 集成实战:基于 Google Cloud AlloyDB 与 pgvector 的向量检索、关键词检索与文档存储全指南

【免费下载链接】haystackOpen-source AI orchestration framework for building context-engineered, production-ready LLM applications. Design modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation. Built for scalable agents, RAG, multimodal applications, semantic search, and conversational systems.项目地址: https://gitcode.com/GitHub_Trending/ha/haystack

本篇技术指南围绕 Haystack 的alloydb-haystack集成展开,系统讲解AlloyDBDocumentStoreAlloyDBEmbeddingRetrieverAlloyDBKeywordRetriever三个核心组件的初始化参数、运行接口与序列化方法,并结合仓库源码与配套文档给出可复制、可运行的实战方案。读完本文,你将掌握如何在 Haystack 中连接 Google Cloud AlloyDB(PostgreSQL 兼容托管数据库),通过 pgvector 完成向量相似度检索、通过 PostgreSQL 全文检索完成关键词检索,并正确配置元数据过滤、搜索策略与连接认证。

集成概览:为什么选择 AlloyDB 作为 Haystack 的文档存储

AlloyDB 是 Google Cloud 上完全托管的、兼容 PostgreSQL 的数据库服务。Haystack 的alloydb-haystack集成(API 参考见 docs-website/reference/integrations-api/alloydb.md)基于 pgvector 扩展 实现向量相似度检索,同时原生支持关键词检索与元数据过滤。该集成由三个相互协作的组件构成:

组件所属模块职责
AlloyDBDocumentStorehaystack_integrations.document_stores.alloydb承载文档读写、过滤、删除与元数据统计,是检索的基础
AlloyDBEmbeddingRetrieverhaystack_integrations.components.retrievers.alloydb.embedding_retriever依据查询向量做 embedding 相似度检索
AlloyDBKeywordRetrieverhaystack_integrations.components.retrievers.alloydb.keyword_retriever依据关键词做 PostgreSQL 全文检索

一个突出的设计亮点是连接安全性:连接通过 AlloyDB Python Connector 建立,自动提供 TLS 加密与基于 IAM 的授权,无需手动管理 SSL 证书、防火墙规则或 IP 白名单。此外,连接采用懒建立机制——首次使用时才真正建立连接,且存放 Haystack 文档的表若不存在会被自动创建。

安装与前置准备

安装集成包并完成 AlloyDB 实例的初始化(快速上手可参照 AlloyDB 官方 quickstart):

pip install alloydb-haystack

配套文档还使用sentence-transformers-haystack中的 Embedder 计算向量,如需运行相关示例可一并安装:

pip install sentence-transformers-haystack

认证方式与环境变量

AlloyDBDocumentStore使用 Haystack 的Secret机制(完整说明见 docs-website/docs/concepts/secret-management.mdx)读取连接凭据,默认从三个环境变量取值:

环境变量含义说明
ALLOYDB_INSTANCE_URIAlloyDB 实例 URI格式为projects/PROJECT/locations/REGION/clusters/CLUSTER/instances/INSTANCE
ALLOYDB_USER数据库用户使用 IAM 数据库认证时,填写去掉.gserviceaccount.com后缀的服务账号邮箱,或完整的 IAM 用户邮箱
ALLOYDB_PASSWORD数据库密码enable_iam_auth=True时无需提供
export ALLOYDB_INSTANCE_URI="projects/MY_PROJECT/locations/MY_REGION/clusters/MY_CLUSTER/instances/MY_INSTANCE" export ALLOYDB_USER="my-db-user" export ALLOYDB_PASSWORD="my-db-password"

采用环境变量的好处在于:当 Pipeline 被序列化为 YAML 时,只保存环境变量的名称而不会泄露真实凭据,这与Secret.from_env_var的序列化语义一致(参考 secret-management.mdx 中的 YAML 示例)。若希望改用 IAM 认证而非密码,可将enable_iam_auth=True,并为 IAM 主体授予 AlloyDB Client 角色、创建对应的 IAM 数据库用户。

AlloyDBDocumentStore:核心文档存储

AlloyDBDocumentStore继承自 Haystack 的DocumentStore基类(Bases: DocumentStore),是集成的数据底座。

快速上手示例

import os from haystack_integrations.document_stores.alloydb import AlloyDBDocumentStore # 需要设置的环境变量: # ALLOYDB_INSTANCE_URI = "projects/MY_PROJECT/locations/MY_REGION/clusters/MY_CLUSTER/instances/MY_INSTANCE" # ALLOYDB_USER = "my-db-user" # ALLOYDB_PASSWORD = "my-db-password" document_store = AlloyDBDocumentStore( db="my-database", embedding_dimension=768, recreate_table=True, )

init完整签名与参数解析

__init__( *, instance_uri: Secret = Secret.from_env_var("ALLOYDB_INSTANCE_URI"), user: Secret = Secret.from_env_var("ALLOYDB_USER"), password: Secret = Secret.from_env_var("ALLOYDB_PASSWORD", strict=False), db: str = "postgres", enable_iam_auth: bool = False, ip_type: Literal["PRIVATE", "PUBLIC", "PSC"] = "PRIVATE", create_extension: bool = True, schema_name: str = "public", table_name: str = "haystack_documents", language: str = "english", embedding_dimension: int = 768, vector_function: Literal[ "cosine_similarity", "inner_product", "l2_distance" ] = "cosine_similarity", recreate_table: bool = False, search_strategy: Literal[ "exact_nearest_neighbor", "hnsw" ] = "exact_nearest_neighbor", hnsw_recreate_index_if_exists: bool = False, hnsw_index_creation_kwargs: dict[str, int] | None = None, hnsw_index_name: str = "haystack_hnsw_index", hnsw_ef_search: int | None = None, keyword_index_name: str = "haystack_keyword_index" ) -> None

各参数含义如下:

  • instance_uriSecret):AlloyDB 实例 URI,格式projects/PROJECT/locations/REGION/clusters/CLUSTER/instances/INSTANCE,默认读取ALLOYDB_INSTANCE_URI环境变量。
  • userSecret):数据库用户,默认读取ALLOYDB_USER;IAM 认证下使用服务账号邮箱(省略.gserviceaccount.com后缀)或完整 IAM 用户邮箱。
  • passwordSecret):数据库密码,默认读取ALLOYDB_PASSWORDenable_iam_auth=True时忽略。
  • dbstr):要连接的数据库名,默认"postgres"
  • enable_iam_authbool):是否使用 IAM 数据库认证替代密码。为Truepassword被忽略,IAM 主体需被授予 AlloyDB Client 角色并已创建 IAM 数据库用户。
  • ip_typeLiteral["PRIVATE", "PUBLIC", "PSC"]):连接使用的 IP 类型。"PRIVATE"(默认)走私有 VPC IP;"PUBLIC"走公网 IP;"PSC"走 Private Service Connect。
  • create_extensionbool):是否在缺失时自动创建 pgvector 扩展,默认True。创建扩展可能需要超级用户权限;设为False时必须保证扩展已安装,否则会报错。
  • schema_namestr):建表所在 schema,默认"public",该 schema 必须已存在。
  • table_namestr):存放 Haystack 文档的表名,默认"haystack_documents"
  • languagestr):关键词检索时解析查询与文档内容所用的语言,默认"english"。可用 SQL 查看数据库支持的语言列表:SELECT cfgname FROM pg_ts_config;
  • embedding_dimensionint):embedding 的维度。
  • vector_functionLiteral["cosine_similarity", "inner_product", "l2_distance"]):向量相似度函数。"cosine_similarity""inner_product"为相似度语义,得分越高越相似;"l2_distance"返回向量间的直线距离,得分越小越相似。使用"hnsw"搜索策略时会据此创建索引,后续查询需保持同一向量函数才能利用该索引。
  • recreate_tablebool):表已存在时是否重建。
  • search_strategyLiteral["exact_nearest_neighbor", "hnsw"]):向量检索策略。"exact_nearest_neighbor"(默认)召回完全准确,但文档量大时较慢;"hnsw"为近似最近邻检索,以少量精度换速度,推荐用于大规模文档。
  • hnsw_recreate_index_if_existsbool):HNSW 索引已存在时是否重建,仅search_strategy="hnsw"时生效。
  • hnsw_index_creation_kwargsdict[str, int] | None):HNSW 索引创建时的额外参数,仅"hnsw"策略生效,合法键为mef_construction(详见 pgvector 文档)。
  • hnsw_index_namestr):HNSW 索引名,默认"haystack_hnsw_index"
  • hnsw_ef_searchint | None):查询时的ef_search参数,仅"hnsw"策略生效(详见 pgvector 文档)。
  • keyword_index_namestr):关键词 GIN 索引名,默认"haystack_keyword_index"

文档写入与基本统计

配合DocumentDuplicatePolicy可完成写入与计数:

from haystack import Document document_store = AlloyDBDocumentStore( db="my-database", embedding_dimension=768, vector_function="cosine_similarity", recreate_table=True, ) document_store.write_documents( [ Document(content="This is first", embedding=[0.1] * 768), Document(content="This is second", embedding=[0.3] * 768), ], ) print(document_store.count_documents())
  • write_documents(documents, policy=DuplicatePolicy.FAIL):写入文档,返回写入数量。policy支持DuplicatePolicy枚举(定义于 haystack/document_stores/types/policy.py),取值为NONESKIPOVERWRITEFAIL。若文档 id 已存在且策略为FAIL(或未指定),抛出DuplicateDocumentErrordocuments含非Document对象时抛ValueError;其他写入失败抛DocumentStoreError
  • count_documents():返回存储中的文档总数。

检索策略:精确最近邻与 HNSW

AlloyDBDocumentStore为 embedding 检索提供两种策略:

  • "exact_nearest_neighbor"(默认):完美召回(perfect recall),文档量大时可能较慢。
  • "hnsw":近似最近邻,牺牲少量精度换取速度,推荐用于大规模文档。

使用"hnsw"时,索引依据你选择的vector_function创建,因此后续查询应持续使用同一向量相似度函数,否则无法利用索引加速。索引创建可通过hnsw_index_creation_kwargsmef_construction)与hnsw_ef_search调优。

元数据过滤(重点约束)

AlloyDBDocumentStore完整支持比较运算符==!=>>=<<=innot inlikenot like,以及逻辑运算符ANDOR。其中like/not like是相对于标准 Haystack 过滤语法的 PostgreSQL 专属扩展,对应 SQL 的LIKE/NOT LIKE模式匹配。

核心限制NOT逻辑运算符不被支持。不过每个比较运算符都有对应的否定形式(==/!=in/not inlike/not like),因此任何可用NOT表达的单条件过滤都可以改写为反转后的比较运算符;若要否定嵌套的AND/OR组,可应用德摩根定律,例如NOT (A AND B)改写为(NOT A) OR (NOT B),其中每个NOT A/NOT B用反转后的比较表达。完整过滤语法规范参见 docs-website/docs/concepts/metadata-filtering.mdx。

文档删除、更新与过滤查询

  • filter_documents(filters=None):返回匹配过滤条件的文档列表。filters非字典时抛TypeError,语法非法时抛ValueError
  • delete_documents(document_ids):按 id 列表删除文档。
  • delete_all_documents():清空所有文档。
  • delete_by_filter(filters):删除匹配过滤条件的所有文档,返回删除数量。
  • update_by_filter(filters, meta):更新匹配过滤条件文档的元数据(meta为要更新的元数据字段字典),返回更新数量。
  • count_documents_by_filter(filters):返回匹配过滤条件的文档数。
  • count_unique_metadata_by_filter(filters, metadata_fields):返回指定元数据字段的唯一值计数(字段名可带或不带"meta."前缀),仅统计匹配过滤条件的文档。

元数据字段分析

由于元数据存储在 JSONB 字段中,以下方法通过分析实际数据推断类型:

  • get_metadata_fields_info():返回各元数据字段及其推断类型,形如{'category': {'type': 'text'}, 'priority': {'type': 'integer'}}
  • get_metadata_field_min_max(field):返回某字段的最小/最大值。数值字段(integer、real)返回数值 min/max;文本等非数值字段按"C"排序规则返回字典序 min/max;字段无值或存储为空时返回{"min": None, "max": None}
  • get_metadata_field_unique_values(metadata_field, search_term=None, from_=0, size=10, filters=None):返回某字段的唯一值列表与总数。search_term可按不区分大小写的子串匹配过滤值;from_/size用于分页;filters用于限制考察的文档集合。

序列化与生命周期

  • to_dict():将组件序列化为字典。
  • from_dict(data):从字典反序列化出AlloyDBDocumentStore实例。
  • close():释放底层关联的同步资源。
  • delete_table():删除存储 Haystack 文档的表,表所在 schema 与表名由初始化时的schema_nametable_name决定。

AlloyDBEmbeddingRetriever:基于向量相似度的检索

AlloyDBEmbeddingRetriever依据查询向量与文档向量的相似度,从AlloyDBDocumentStore中取回最相关的文档。它必须连接到AlloyDBDocumentStore,并且依赖查询与文档 embedding 的可用性:建议在索引 Pipeline 中加入 Document Embedder、在查询 Pipeline 中加入 Text Embedder(例如SentenceTransformersDocumentEmbedder/SentenceTransformersTextEmbedder)。

init签名

__init__( *, document_store: AlloyDBDocumentStore, filters: dict[str, Any] | None = None, top_k: int = 10, vector_function: ( Literal["cosine_similarity", "inner_product", "l2_distance"] | None ) = None, filter_policy: str | FilterPolicy = FilterPolicy.REPLACE ) -> None
  • document_storeAlloyDBDocumentStore):必填,作为检索后端的文档存储实例。若不是AlloyDBDocumentStore实例,初始化抛ValueError
  • filtersdict[str, Any] | None):应用于检索结果的过滤条件。
  • top_kint):最大返回文档数,默认10
  • vector_function:本次检索使用的相似度函数,会覆盖AlloyDBDocumentStore中设置的vector_function"cosine_similarity""inner_product"得分越高越相似;"l2_distance"返回向量间直线距离,得分越小越相似。重要:使用"hnsw"搜索策略时,须与创建 HNSW 索引时所用的向量函数保持一致。未指定时使用AlloyDBDocumentStorevector_function
  • filter_policystr | FilterPolicy):查询时过滤条件的合并策略。FilterPolicy.REPLACE(默认)用运行时 filters 替换初始化 filters;FilterPolicy.MERGE将二者合并。

关于FilterPolicy的底层实现:该枚举定义于 haystack/document_stores/types/filter_policy.py,取值为REPLACE = "replace"MERGE = "merge",并提供from_str将字符串安全转换为枚举(未知值抛ValueError)。按apply_filter_policy的语义(同文件 L288-L308):REPLACE下运行时 filters 完全替换初始化 filters;MERGE下运行时 filters 与初始化 filters 合并,键冲突时运行时值覆盖初始化值。

run 签名与返回

run( query_embedding: list[float], filters: dict[str, Any] | None = None, top_k: int | None = None, vector_function: ( Literal["cosine_similarity", "inner_product", "l2_distance"] | None ) = None, ) -> dict[str, list[Document]]
  • query_embeddinglist[float]):查询的向量表示,必填。
  • filtersdict[str, Any] | None):运行时过滤条件,与初始化 filters 的组合方式由filter_policy决定。
  • top_kint | None):最大返回文档数,覆盖初始化时的top_k
  • vector_function:覆盖初始化时设置的相似度函数。

返回dict[str, list[Document]],即包含键"documents"、值为检索所得Document列表的字典。

独立使用

仅需AlloyDBDocumentStore与已索引的文档:

from haystack_integrations.document_stores.alloydb import AlloyDBDocumentStore from haystack_integrations.components.retrievers.alloydb import ( AlloyDBEmbeddingRetriever, ) document_store = AlloyDBDocumentStore() retriever = AlloyDBEmbeddingRetriever(document_store=document_store) # 使用假向量保持示例简洁 retriever.run(query_embedding=[0.1] * 768)

注意:直接构造AlloyDBDocumentStore()时,embedding_dimension使用默认值768,向量维度需与之匹配。

在 Pipeline 中使用(语义搜索)

from haystack import Document, Pipeline from haystack.document_stores.types import DuplicatePolicy from haystack_integrations.components.embedders.sentence_transformers import ( SentenceTransformersTextEmbedder, SentenceTransformersDocumentEmbedder, ) from haystack_integrations.document_stores.alloydb import AlloyDBDocumentStore from haystack_integrations.components.retrievers.alloydb import ( AlloyDBEmbeddingRetriever, ) document_store = AlloyDBDocumentStore( embedding_dimension=768, vector_function="cosine_similarity", recreate_table=True, ) documents = [ Document(content="There are over 7,000 languages spoken around the world today."), Document( content="Elephants have been observed to behave in a way that indicates a high level of self-awareness, such as recognizing themselves in mirrors.", ), Document( content="In certain parts of the world, like the Maldives, Puerto Rico, and San Diego, you can witness the phenomenon of bioluminescent waves.", ), ] document_embedder = SentenceTransformersDocumentEmbedder() documents_with_embeddings = document_embedder.run(documents) document_store.write_documents( documents_with_embeddings.get("documents"), policy=DuplicatePolicy.OVERWRITE, ) query_pipeline = Pipeline() query_pipeline.add_component("text_embedder", SentenceTransformersTextEmbedder()) query_pipeline.add_component( "retriever", AlloyDBEmbeddingRetriever(document_store=document_store), ) query_pipeline.connect("text_embedder.embedding", "retriever.query_embedding") query = "How many languages are there?" result = query_pipeline.run({"text_embedder": {"text": query}}) print(result["retriever"]["documents"][0])

该示例展示了标准流程:用SentenceTransformersDocumentEmbedder为文档生成向量并写入存储(策略OVERWRITE),再构建查询 Pipeline,将text_embedder.embedding连接到retriever.query_embedding,最终通过result["retriever"]["documents"]取回结果。

序列化与资源释放

  • to_dict():序列化为字典。
  • from_dict(data):从字典反序列化出AlloyDBEmbeddingRetriever
  • close():释放底层 Document Store 的同步资源。

AlloyDBKeywordRetriever:基于 PostgreSQL 全文检索

AlloyDBKeywordRetriever通过 PostgreSQL 全文检索(to_tsvector/plainto_tsquery)查找文档,并使用ts_rank_cd排序。排序考量查询词在文档中出现的频率、词项之间的紧密程度以及出现位置的文档权重(详见 PostgreSQL 文档的 ranking 部分)。它同样必须连接到AlloyDBDocumentStore

需要特别留意:与ElasticsearchBM25Retriever等组件不同,该检索器默认不做模糊搜索,查询词需要仔细构造,否则可能得到零结果。关键词检索使用的解析语言由AlloyDBDocumentStorelanguage参数决定(默认"english"),可通过SELECT cfgname FROM pg_ts_config;查询数据库支持的语言。

init签名

__init__( *, document_store: AlloyDBDocumentStore, filters: dict[str, Any] | None = None, top_k: int = 10, filter_policy: str | FilterPolicy = FilterPolicy.REPLACE ) -> None
  • document_storeAlloyDBDocumentStore):必填,非该类型实例时抛ValueError
  • filtersdict[str, Any] | None):应用于检索结果的过滤条件。
  • top_kint):最大返回文档数,默认10
  • filter_policystr | FilterPolicy):与AlloyDBEmbeddingRetriever语义一致——FilterPolicy.REPLACE(默认)用运行时 filters 替换初始化 filters;FilterPolicy.MERGE合并二者。

run 签名与返回

run( query: str, filters: dict[str, Any] | None = None, top_k: int | None = None ) -> dict[str, list[Document]]
  • querystr):要搜索的关键词查询,必填。
  • filtersdict[str, Any] | None):运行时过滤条件,组合方式由filter_policy决定。
  • top_kint | None):最大返回文档数,覆盖初始化时的top_k

返回dict[str, list[Document]],键为"documents"

独立使用

from haystack_integrations.document_stores.alloydb import AlloyDBDocumentStore from haystack_integrations.components.retrievers.alloydb import ( AlloyDBKeywordRetriever, ) document_store = AlloyDBDocumentStore() retriever = AlloyDBKeywordRetriever(document_store=document_store) retriever.run(query="my nice query")

在 RAG Pipeline 中使用

以下示例运行前提:设置OPENAI_API_KEY环境变量,以及ALLOYDB_INSTANCE_URIALLOYDB_USERALLOYDB_PASSWORD三个连接变量。

from haystack import Document, Pipeline from haystack.components.builders.answer_builder import AnswerBuilder from haystack.components.builders.chat_prompt_builder import ChatPromptBuilder from haystack.components.generators.chat import OpenAIChatGenerator from haystack.dataclasses import ChatMessage from haystack.document_stores.types import DuplicatePolicy from haystack_integrations.document_stores.alloydb import AlloyDBDocumentStore from haystack_integrations.components.retrievers.alloydb import ( AlloyDBKeywordRetriever, ) ## 创建 RAG 查询 Pipeline prompt_template = [ ChatMessage.from_system("You are a helpful assistant."), ChatMessage.from_user( "Given these documents, answer the question.\nDocuments:\n" "{% for doc in documents %}{{ doc.content }}{% endfor %}\n" "Question: {{question}}\nAnswer:", ), ] document_store = AlloyDBDocumentStore( language="english", # 该参数影响关键词检索时的文本解析 recreate_table=True, ) documents = [ Document(content="There are over 7,000 languages spoken around the world today."), Document( content="Elephants have been observed to behave in a way that indicates a high level of self-awareness, such as recognizing themselves in mirrors.", ), Document( content="In certain parts of the world, like the Maldives, Puerto Rico, and San Diego, you can witness the phenomenon of bioluminescent waves.", ), ] document_store.write_documents(documents=documents, policy=DuplicatePolicy.SKIP) retriever = AlloyDBKeywordRetriever(document_store=document_store) rag_pipeline = Pipeline() rag_pipeline.add_component(name="retriever", instance=retriever) rag_pipeline.add_component( instance=ChatPromptBuilder( template=prompt_template, required_variables={"question", "documents"}, ), name="prompt_builder", ) rag_pipeline.add_component(instance=OpenAIChatGenerator(), name="llm") rag_pipeline.add_component(instance=AnswerBuilder(), name="answer_builder") rag_pipeline.connect("retriever", "prompt_builder.documents") rag_pipeline.connect("prompt_builder.prompt", "llm.messages") rag_pipeline.connect("llm.replies", "answer_builder.replies") rag_pipeline.connect("retriever", "answer_builder.documents") question = "languages spoken around the world today" result = rag_pipeline.run( { "retriever": {"query": question}, "prompt_builder": {"question": question}, "answer_builder": {"query": question}, }, ) print(result["answer_builder"])

该 RAG Pipeline 的拓扑为:retrieverprompt_builder(同时提供documentsanswer_builder)→llmanswer_builder。写入文档时使用DuplicatePolicy.SKIP以避免重复 id 冲突。注意查询词应与文档内容用词保持一致(全文检索不做模糊匹配)。

序列化与资源释放

  • to_dict():序列化为字典。
  • from_dict(data):从字典反序列化出AlloyDBKeywordRetriever
  • close():释放底层 Document Store 的同步资源。

设计要点与踩坑清单

综合本集成三个组件的 API 与配套文档,以下要点值得在工程实践中重点关注:

  1. 连接安全且懒加载:AlloyDB Python Connector 提供 TLS 加密与 IAM 授权;连接在首次使用时建立,表不存在时自动创建。若手动管理扩展,需保证 pgvector 已安装(create_extension=False时)。
  2. 向量函数一致性vector_function同时存在于 Document Store 与两个 Retriever 的初始化/运行参数中,后者的值会覆盖前者。使用 HNSW 策略时,查询必须与建索引时的向量函数保持一致,否则索引无法生效。
  3. NOT运算符不可用:用!=not innot like等反转比较表达否定;嵌套组否定按德摩根定律改写。like/not like是 PostgreSQL 专属扩展。
  4. filter_policy 语义FilterPolicy.REPLACEFilterPolicy.MERGE的定义可在 filter_policy.py 中确认,字符串"replace"/"merge"亦可直接传入。
  5. 关键词检索不做模糊匹配:查询词需与文档措辞匹配,必要时结合语言配置(language)与pg_ts_config列表调整。
  6. 重复写入策略DuplicatePolicy支持NONE/SKIP/OVERWRITE/FAIL(见 policy.py),默认FAIL会在 id 冲突时报DuplicateDocumentError

延伸阅读

  • 集成完整 API 参考:docs-website/reference/integrations-api/alloydb.md
  • Document Store 使用指南:docs-website/docs/document-stores/alloydbdocumentstore.mdx
  • Embedding 检索器指南:docs-website/docs/pipeline-components/retrievers/alloydbembeddingretriever.mdx
  • 关键词检索器指南:docs-website/docs/pipeline-components/retrievers/alloydbkeywordretriever.mdx
  • Secret 管理机制:docs-website/docs/concepts/secret-management.mdx
  • 过滤策略与重复策略源码:haystack/document_stores/types/filter_policy.py、haystack/document_stores/types/policy.py
  • 文档存储选型参考:docs-website/docs/concepts/document-store/choosing-a-document-store.mdx

【免费下载链接】haystackOpen-source AI orchestration framework for building context-engineered, production-ready LLM applications. Design modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation. Built for scalable agents, RAG, multimodal applications, semantic search, and conversational systems.项目地址: https://gitcode.com/GitHub_Trending/ha/haystack

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询