txtai

neumlApache-2.0活跃维护

一站式语义搜索与 LLM 编排框架,把向量检索、RAG 和智能体工作流整合在一起,用 Python 就能搭建基于语言模型的应用。

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

v9.14.0发布于 2026-10-06 12:49 UTC13,270star +175 / 7 天989fork同步于 2026-11-10 17:27 UTC

怎么上手

由 README 提炼,执行前请确认
pip install txtai
硬件要求按 README 说明

README 未说明显存或 GPU 型号要求,仅说明可本地运行、按需安装额外依赖并横向扩展。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一站式 AI 框架,用嵌入数据库统一做语义搜索、LLM 编排与模型工作流

一站式语义搜索与 LLM 编排框架,把向量检索、RAG 和智能体工作流整合在一起,用 Python 就能搭建基于语言模型的应用。

核心能力

  • 用向量索引、图网络与关系库组成嵌入数据库
  • 支持文本、文档、音频、图像、视频多模态索引
  • 内置 LLM 提示、问答、标注、转录、翻译、摘要流水线
  • 用工作流串联多个流水线并聚合业务逻辑
  • 提供 Web 与 MCP API 及多语言客户端绑定

容易踩的坑

需 Python 3.11+,建议使用虚拟环境;模型默认从 Hugging Face Hub 加载,首次运行需联网下载;完整功能需按文档另装可选依赖。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v9.14.0
  1. v9.14.0最新正式版2026-10-06 · 2026-10-06 12:49 UTC

    This release adds new ANN backends for RaBitQ and Zvec Sparse, native support for ONNX vectors along with a bonanza of improvements and bug fixes

    See below for full details on the new features, improvements and bug fixes.

    New Features

    • Add ONNX vectors backend (#1211, #1212) @joseph-bergin
    • Add RaBitQ as an ANN backend (#1244, #1251) @pma1999
    • Add Zvec Sparse ANN (#1280, #1307) @Ni0ri
    • Require Python 3.11 (#1273)

    Improvements

    • Update vectors package to standardize fallback logic (#1221)
    • Support pooling_mode with models trained with recent Sentence Transformers (#1292)
    • Refactor ANN unit tests (#1305)
    • Support trust_remote_code in associated AutoModels (#1342)

    Bug Fixes

    • Latest version of LiteLLM is broken with Python 3.10+ (#1193)
    • Fix bash tool hanging on commands that read stdin (#1209, #1210) @pacocartones
    • fix(api): parse the graph query parameter as a bool (#1213) @serhiizghama
    • Load the Milvus collection when opening a saved index (#1214) @morgan-coded
    • Ignore padding rows in LateEncoder scores (#1215) @morgan-coded
    • Resolve label filters by label id (#1216) @morgan-coded
    • Improve late pooling configuration errors (#1217) @morgan-coded
    • Keep count() accurate after repeated deletes in GGML and IVFSparse (#1218) @morgan-coded
    • Delete every index entry for an id in Terms (#1219) @morgan-coded
    • fix(vectors): remove the sparse spool file when checkpointing is disabled (#1220) @serhiizghama
    • Keep the archive working directory alive when saving a loaded index (#1222) @morgan-coded
    • Key the vectors model cache by configuration (#1223) @morgan-coded
    • Save empty keyword and content indexes without errors (#1224) @morgan-coded
    • fix(workflow): add request timeout to ServiceTask (#1225, #1226) @pacocartones
    • Select the top documents in LateEncoder by the document axis (#1227) @morgan-coded
    • Fix ANN delete on quantized Torch stores and tiny GGML indexes (#1228) @morgan-coded
    • Fix Transform.stream() yielding a None text value into the encoder (#1231) @AmirF194
    • fix(ann): honor quantize: false in the Faiss and SQLite backends (#1234) @serhiizghama
    • Fix quantize: false silently enabling Q8_0 quantization in the GGML backend (#1235, #1236) @AmirF194
    • Fix Cluster combining avg() as an unweighted mean of shard averages (#1237) @AmirF194
    • fix(database): don't drop rows when sorting or grouping by a JSON field (#1238) @serhiizghama
    • Latest version of Transformers has breaking change for Text to Audio pipeline (#1239)
    • Save IVFSparse indexes after deleting with NumPy ids (#1241) @morgan-coded
    • Set the HNSW delete counter when loading an index (#1242) @morgan-coded
    • Keep community nodes that match none of the topic terms (#1243) @linhongyu510
    • fix(api): forward zero weights and url-encode parameters in Cluster search (#1245) @serhiizghama
    • Honor the nfeatures setting in IVFSparse (#1246, #1250) @liugj0710
    • Keep deleted keyword results excluded after common-term scoring (#1247, #1248) @LimbC-C
    • Keep SQLite ANN data when saving a modified index to a new path (#1249) @Irahan2
    • Fix DuckDB.formatargs dropping repeated named bind parameters (#1252, #1253) @AmirF194
    • Preserve local filenames in RetrieveTask (#1255, #1256) @dingpuyu
    • Support explicit LIKE escapes in wildcard term queries (#1258, #1259) @LimbC-C
    • Preserve falsy TemplateTask rule matches (#1261, #1262) @HuaTNA
    • Label QA spans without the answer with the CLS token (#1263, #1264) @huiq777
    • Fix training with pandas DataFrames (#1265, #1266) @huiq777
    • Preserve reusable RagTask inputs (#1267, #1268) @HuaTNA
    • Pack rows into chunks up to and including maxlength (#1269, #1270) @huiq777
    • Reject iterator inputs for multi-action tasks without buffering (#1271, #1272) @LimbC-C
    • Preserve keyword document ID types across save/load (#1274, #1275) @HuaTNA
    • Fall back to root tokenizers for ONNX and LiteRT
  2. v9.13.02026-08-27 · 2026-08-27 13:16 UTC
    查看更新说明

    This release adds LEMUR learned multi-vector retrieval, expands late-interaction retrieval capabilities, and includes improvements to MUVERA and pooling along with a number of bug fixes.

    See below for full details on the new features, improvements and bug fixes.

    New Features

    • Add LEMUR: Learned Multi-Vector Retrieval (#1024, #1164, #1169, #1170, #1171, #1172, #1190, #1194, #1196) @morgan-coded
    • Add configurable mean centering to late pooling (#1168) @morgan-coded
    • Add max pooling (#1185, #1186) @Aryan-Pardeshi

    Improvements

    • Convert MUVERA algorithm from NumPy to Torch (#1167, #1178) @Aryan-Pardeshi
    • Refactor late encoding logic to cleanup logic paths (#1180)
    • Add safeopen validation to retrieve task output (#1181)
    • Clamp default Faiss nprobe to nlist (#1203, #1206) @morgan-coded

    Bug Fixes

    • fix: create default agent tools on first use (#1174, #1175) @LHMQ878
    • Latest version of docling causing Windows build errors (#1176)
    • fix(muvera): consume true token rows instead of batch-padded ones (#1177) @Anai-Guo
    • Fix OpenAI chat message selection (#1182, #1183) @FU-max-boop
    • PoolingFactory.method raises KeyError on a pooling config without pooling_mode_mean_tokens (#1187) @Aryan-Pardeshi
    • fix: rank CrossEncoder by a fixed label, not top-1 position (#1189, #1195) @St4r4x
    • Fix KeyError resolving a pooling method from a partial config (#1192) @arose26
    • Fix WordVectors.index() silently dropping the checkpoint argument (#1197, #1198) @AmirF194
    • fix(ann): exclude deleted rows from quantized numpy search results (#1201) @serhiizghama
    • fix(scoring): keep count() accurate when an id is deleted more than once (#1202) @sainikhiljuluri
    • Fix safetensors numpy/torch submodule imports (#1204, #1205) @Evhye38496
    • Index zero and False values in the tabular pipeline (#1207) @devYRPauli
  3. v9.12.02026-07-30 · 2026-07-30 19:43 UTC
    查看更新说明

    This release adds support for new ANN backends along with a bonanza of bug fixes from 7 new contributors!

    See below for full details on the new features, improvements and bug fixes.

    New Features

    • Feature request: Support zvec as vector backend (#1040, #1130) @morgan-coded
    • Add milvus-lite embedded dense ANN backend (#1149) @morgan-coded
    • Allow disabling API routes (#1165)

    Improvements

    • Add tokenbatch size to HFTrainer pipeline (#1133)
    • Only resolve transform functions when env variable set (#1155)
    • Ensure explain / batchexplain don't return numpy values (#1157)
    • Set minimum milvus-lite version (#1162) @morgan-coded
    • Add safeopen option for retrieve task (#1166)

    Bug Fixes

    • Raise SQLError on unterminated bracket, function and similar clauses (#1125) @Sanjays2402
    • Torch 2.13 introduced build errors (#1134)
    • Fix FileTask/UrlTask crash on non-string elements (#1135) @chuenchen309
    • Fix Graph.filter() crash on ids that don't exist in the graph (#1137) @chuenchen309
    • fix: Task.filteredrun crashes/corrupts output for single-action tasks with merge disabled (#1138) @chuenchen309
    • Fix Aggregate IndexError on a SQL query that matched nothing across shards (#1139) @chuenchen309
    • Fix HTMLToMarkdown crash on a meta description tag with no content attribute (#1140) @chuenchen309
    • Fix TemplateTask.match KeyError when a rule key is missing from element (#1141) @chuenchen309
    • Fix Terms KeyError on a query with no similar() clause (#1142) @chuenchen309
    • Fix Terms.search AttributeError on an empty terms index (#1143) @chuenchen309
    • Fix msgpack Accept header crashing streaming API endpoints (#1144) @chuenchen309
    • Fix console printing a traceback for a query with no results (#1145) @chuenchen309
    • Fix Cluster.shard TypeError on tuple documents and empty-string ids (#1146) @chuenchen309
    • Raise SQLError on empty select expressions and a dangling AS (#1147) @chuenchen309
    • Fix LIMIT bind-parameter crashing content SQL search (#1148) @chuenchen309
    • The authorization header doesn't work on Swagger UI (#1150, #1151) @link89
    • Fix Segmentation dropping paragraph/section splits on CRLF line endings (#1152) @lntutor
    • Validate resolver target classes (#1153)
    • Fix IVFSparse returning unsorted sparse ANN search results (#1154) @winklemad
    • Fix build error with Milvus on Windows (#1156)
    • HNSW search crashes with RuntimeError when limit exceeds indexed element count (#1158) @AmirF194
    • Fix HNSW search RuntimeError when limit exceeds indexed element count (#1159) @AmirF194
    • Fix Scoring.delete() crashing on ids that were never indexed (#1163) @AmirF194
  4. v9.11.02026-07-01 · 2026-07-01 15:07 UTC
    查看更新说明

    This release adds support for the turbovec ANN backend and LiteParse text extraction

    See below for full details on the new features, improvements and bug fixes.

    New Features

    • Add turbovec an ANN backend (#1109)
    • Add text extraction with LiteParse (#1118)

    Improvements

    • Migrate from ggml-py to ggml-python (#1105)
    • Revert noisy logging workaround when fixed upstream (#1106)
    • Add reindex parameter for API (#1111)
    • Use gliner fork to relax transformers version caps (#1112)
    • Remove find from the default list of bash tools (#1113)
    • Support multiple Dense layers for Late Interaction Pooling (#1117)
    • Limit tabular pipeline to local CSV files (#1119)
    • Update commonprefix to commonpath (#1120)

    Bug Fixes

    • fix(tokenizer): respect lowercase=False in ngramtokenize (#1114, thank you @JSap0914)
    • FastAPI 0.137+ modified how routers work (#1115)
  5. v9.10.02026-06-04 · 2026-06-04 10:22 UTC
    查看更新说明

    This release adds LiteRT vector support and Knowledge Distillation training

    See below for full details on the new features, improvements and bug fixes.

    New Features

    • Add support for LiteRT vectors (#1097)
    • Add URLRetrieve pipeline (#1100)
    • Add a Knowledge Distillation Trainer (#1103)
    • Add a Progressive Distillation Example Notebook (#1104)

    Improvements

    • Reduce noisy logging messages with Transformers v5 (#1102)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    txtai is an all-in-one AI framework for semantic search, LLM orchestration and language model workflows.

    architecture architecture

    The key component of txtai is an embeddings database, which is a union of vector indexes (sparse and dense), graph networks and relational databases.

    This foundation enables vector search and/or serves as a powerful knowledge source for large language model (LLM) applications.

    Build autonomous agents, retrieval augmented generation (RAG) processes, multi-model workflows and more.

    Summary of txtai features:

    • 🔎 Vector search with SQL, object storage, topic modeling, graph analysis and multimodal indexing
    • 📄 Create embeddings for text, documents, audio, images and video
    • 💡 Pipelines powered by language models that run LLM prompts, question-answering, labeling, transcription, translation, summarization and more
    • ↪️️ Workflows to join pipelines together and aggregate business logic. txtai processes can be simple microservices or multi-model workflows.
    • 🤖 Agents that intelligently connect embeddings, pipelines, workflows and other agents together to autonomously solve complex problems
    • ⚙️ Web and Model Context Protocol (MCP) APIs. Bindings available for JavaScript, Java, Rust and Go.
    • 🔋 Batteries included with defaults to get up and running fast
    • ☁️ Run local or scale out with container orchestration

    txtai is built with Python 3.11+, Hugging Face Transformers, Sentence Transformers and FastAPI. txtai is open-source under an Apache 2.0 license.

    [!NOTE]

    NeuML is the company behind txtai and we provide AI consulting services around our stack. Schedule a meeting or send a message to learn more.

    We're also building an easy and secure way to run hosted txtai applications with txtai.cloud.

    Why txtai?

    why why

    New vector databases, LLM frameworks and everything in between are sprouting up daily. Why build with txtai?

    • Up and running in minutes with pip or Docker
    # Get started in a couple lines
    import txtai
    
    embeddings = txtai.Embeddings()
    embeddings.index(["Correct", "Not what we hoped"])
    embeddings.search("positive", 1)
    #[(0, 0.29862046241760254)]
    
    • Built-in API makes it easy to develop applications using your programming language of choice
    # app.yml
    embeddings:
        path: sentence-transformers/all-MiniLM-L6-v2
    
    CONFIG=app.yml uvicorn "txtai.api:app"
    curl -X GET "http://localhost:8000/search?query=positive"
    
    • Run local - no need to ship data off to disparate remote services
    • Work with micromodels all the way up to large language models (LLMs)
    • Low footprint - install additional dependencies and scale up when needed
    • Learn by example - notebooks cover all available functionality

    Use Cases

    The following sections introduce common txtai use cases. A comprehensive set of over 70 example notebooks and applications are also available.

    Semantic Search

    Build semantic/similarity/vector/neural search applications.

    demo

    Traditional search systems use keywords to find data. Semantic search has an understanding of natural language and identifies results that have the same meaning, not necessarily the same keywords.

    search search

    Get started with the following examples.

    NotebookDescription
    Introducing txtai ▶️Overview of the functionality provided by txtaiOpen In Colab
    Similarity search with imagesEmbed images and text into the same space for searchOpen In Colab
    Build a QA databaseQuestion matching with semantic searchOpen In Colab
    Semantic GraphsExplore topics, data connectivity and run network analysisOpen In Colab

    LLM Orchestration

    Autonomous agents, retrieval augmented generation (RAG), chat with your data, pipelines and workflows that interface with large language models (LLMs).

    llm

    See below to learn more.

    NotebookDescription
    Prompt templates and task chainsBuild model prompts and connect tasks together with workflowsOpen In Colab
    Integrate LLM frameworksIntegrate llama.cpp, LiteLLM and custom generation frameworksOpen In Colab
    Build knowledge graphs with LLMsBuild knowledge graphs with LLM-driven entity extractionOpen In Colab
    Parsing the stars with txtaiExplore an astronomical knowledge graph of known stars, planets, galaxiesOpen In Colab
    Agents

    Agents connect embeddings, pipelines, workflows and other agents together to autonomously solve complex problems.

    agent

    txtai agents are built on top of the smolagents framework. This supports all LLMs txtai supports (Hugging Face, llama.cpp, OpenAI / Claude / AWS Bedrock via LiteLLM). Agent prompting with agents.md and skill.md are also supported.

    Check out this Agent Quickstart Example. Additional examples are listed below.

    NotebookDescription
    Granting autonomy to agentsAgents that iteratively solve problems as they see fitOpen In Colab
    TxtAI got skillsIntegrate skill.md files with your agentOpen In Colab
    Agent Tools ▶️Learn about the txtai agent toolkitOpen In Colab
    Analyzing LinkedIn Company Posts with Graphs and AgentsExploring how to improve social media engagement with AIOpen In Colab
    Retrieval augmented generation

    Retrieval augmented generation (RAG) reduces the risk of LLM hallucinations by constraining the output with a knowledge base as context. RAG is commonly used to "chat with your data".

    rag rag

    Check out this RAG Quickstart Example. Additional examples are listed below.

    NotebookDescription
    Build RAG pipelines with txtai ▶️Guide on retrieval augmented generation including how to create citationsOpen In Colab
    RAG is more than Vector SearchContext retrieval via Web, SQL and other sourcesOpen In Colab
    GraphRAG with Wikipedia and GPT OSSDeep graph search powered RAGOpen In Colab
    Speech to Speech RAG ▶️Full cycle speech to speech workflow with RAGOpen In Colab

    Language Model Workflows

    Language model workflows, also known as semantic workflows, connect language models together to build intelligent applications.

    flows flows

    While LLMs are powerful, there are plenty of smaller, more specialized models that work better and faster for specific tasks. This includes models for extractive question-answering, automatic summarization, text-to-speech, transcription and translation.

    Check out this Workflow Quickstart Example. Additional examples are listed below.

    NotebookDescription
    Run pipeline workflows ▶️Simple yet powerful constructs to efficiently process dataOpen In Colab
    Building abstractive text summariesRun abstractive text summarizationOpen In Colab
    Transcribe audio to textConvert audio files to textOpen In Colab
    Translate text between languagesStreamline machine translation and language detectionOpen In Colab

    Installation

    install install

    The easiest way to install is via pip and PyPI

    pip install txtai
    

    Python 3.11+ is supported. Using a Python virtual environment is recommended.

    See the detailed install instructions for more information covering optional dependencies, environment specific prerequisites, installing from source, conda support, lightweight minimal installation and how to run with containers.

    Model guide

    models

    See the table below for the current recommended models. These models all allow commercial use and offer a blend of speed and performance.

    ComponentModel(s)
    Embeddingsall-MiniLM-L6-v2
    Image CaptionsBLIP
    Labels - Zero ShotDeBERTa v3 Zeroshot
    Labels - FixedFine-tune with training pipeline
    Large Language Model (LLM)Gemma 4 31B
    SummarizationDistilBART
    Text-to-SpeechESPnet JETS
    TranscriptionWhisper
    TranslationOPUS Model Series

    Models can be loaded as either a path from the Hugging Face Hub or a local directory. Model paths are optional, defaults are loaded when not specified. For tasks with no recommended model, txtai uses the default models as shown in the Hugging Face Tasks guide.

    See the following links to learn more.

    Powered by txtai

    The following applications are powered by txtai.

    apps

    ApplicationDescription
    ragRetrieval Augmented Generation (RAG) application
    ncoderOpen-Source AI coding agent
    paperaiAI for medical and scientific papers
    annotateaiAutomatically annotate papers with LLMs

    In addition to this list, there are also many other open-source projects, published research and closed proprietary/commercial projects that have built on txtai in production.

    Further Reading

    further further

    Documentation

    Full documentation on txtai including configuration settings for embeddings, pipelines, workflows, API and a FAQ with common questions/issues is available.

    Contributing

    For those who would like to contribute to txtai, please see this guide.