txtai
Use txtai for semantic search, embeddings databases, RAG, LLM orchestration, agents, deterministic workflows, and API deployment.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- txtai
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use txtai for semantic search, embeddings databases, RAG, LLM orchestration, agents, deterministic workflows, and API deployment.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/installation-and-extras.md4.7 KB
- 参考文档references/repo-provenance.md2.2 KB
- 参考文档references/repo-routing-metadata.json480 B
- 参考文档references/troubleshooting.md4.1 KB
- 脚本scripts/check_txtai_environment.py3.9 KB
03 SKILL.md 正文
txtai
txtai is an all-in-one Python AI framework for semantic search, embeddings databases, retrieval augmented generation (RAG), LLM orchestration, agents, deterministic workflows, and FastAPI/OpenAI-compatible services.
Use this root skill to choose the right txtai sub-skill, install the correct optional extras, and run safe environment checks. Keep detailed workflows in the linked sub-skills and references.
Start Here
- Confirm the package import and version.
python - <<'PY' import importlib.metadata import txtai print(importlib.metadata.version("txtai")) print(txtai.Embeddings, txtai.Application, txtai.Workflow) PY - Read references/installation-and-extras.md before installing optional dependencies.
- Run
python scripts/check_txtai_environment.py --helpto inspect imports and optional capabilities without downloading models. - Read references/troubleshooting.md when imports, model backends, optional extras, config files, API startup, or offline runs fail.
- Read references/repo-provenance.md before deciding whether this skill is current for a source checkout.
Route By Task
| User task | Read |
|---|---|
| Build an embeddings index, semantic search, SQL search, hybrid sparse+dense search, graph search, object storage, subindexes, save/load, or index maintenance | sub-skills/embeddings-search/SKILL.md |
| Compose deterministic pipelines/workflows for extraction, chunking, summarization, translation, transcription, image/audio/data processing, YAML task chains, schedules, or lazy generator debugging | sub-skills/pipelines-and-workflows/SKILL.md |
Build RAG, direct LLM calls, txtai Agent tools, embeddings-backed tools, agent teams, prompt templates, or backend selection for hosted/local models |
sub-skills/agents-and-llm-orchestration/SKILL.md |
Configure Application, serve FastAPI/Uvicorn APIs, OpenAI-compatible endpoints, MCP, auth, custom endpoints, clustering, Docker/cloud/serverless, observability, or console usage |
sub-skills/api-and-deployment/SKILL.md |
Installation Choices
Install the smallest dependency set that matches the task:
pip install txtai
pip install "txtai[api]" # FastAPI, OpenAI-compatible API, MCP/service routes
pip install "txtai[agent]" # Agent support and smolagents integration
pip install "txtai[pipeline]" # broad pipeline extras; prefer narrower groups when possible
pip install "txtai[workflow]" # scheduling, file/data workflow extras
pip install "txtai[graph]" # graph/network search extras
pip install "txtai[database]" # DuckDB/SQLAlchemy database extras
Avoid txtai[all] unless the user explicitly needs nearly every optional subsystem. txtai optional groups can pull large ML, audio, image, database, API, cloud, or CUDA-adjacent packages. See references/installation-and-extras.md for the full group map.
Public API Anchors
txtai.Embeddings(config=None, models=None, **kwargs)builds and queries embeddings databases.txtai.Application(config, loaddata=True)loads YAML/dict application config for APIs, pipelines, workflows, agents, and embeddings.txtai.Workflow(tasks, batch=100, workers=None, name=None, stream=None)chains callable tasks and yields lazy generator output.txtai.LLM(path=None, method=None, **kwargs)runs local, hosted, or custom generation backends.txtai.RAG(similarity, path, ..., template=None, context=None, output="default", system=None, **kwargs)joins retrieval with generation.txtai.Agent(model=..., tools=[...], max_steps=...)requires the agent extra; without it, imports can resolve to a placeholder that raises when constructed.
Common Routing Pitfalls
- If a prompt asks for a chatbot that answers from documents, split the work: use
embeddings-searchto build the store, thenagents-and-llm-orchestrationforRAGtemplates and generation. - If a prompt asks for repeatable extraction/summarization/translation over many items, prefer
pipelines-and-workflows; use agents only when tool choice or multi-step reasoning is required. - If a prompt asks for a service endpoint, route to
api-and-deploymenteven when the underlying route calls embeddings, workflows, or RAG. - If a prompt names SQL,
similar(...), metadata filtering, graph traversal, or object retrieval, route toembeddings-searchfirst. - If a prompt names
CONFIG=app.yml,uvicorn,/v1/chat/completions,/mcp,TOKEN, Docker, cloud, or console commands, route toapi-and-deployment.
Validation Helpers
python scripts/check_txtai_environment.pychecks core imports, package version, optional modules, and top-level constructor signatures.python sub-skills/embeddings-search/scripts/semantic_search_smoke.py --run --sqlruns a no-download embeddings smoke check with external vectors.python sub-skills/pipelines-and-workflows/scripts/workflow_smoke.py --mode allruns no-download deterministic workflow checks.python sub-skills/agents-and-llm-orchestration/scripts/rag_config_template.py --checkvalidates generated RAG template placeholders without calling a model.python sub-skills/api-and-deployment/scripts/api_config_template.py --listlists safe API config templates without starting a server.
Self-Containment Rules
- Do not tell future users to open txtai source docs, examples, tests, Docker files, or notebooks from a checkout. Runtime guidance must come from this skill tree.
- If a task needs a reusable helper, use the bundled scripts above or create user project files from the references.
- Keep credentials, tokens, model cache paths, API keys, and local environment paths out of generated configs and answers.
- Treat model downloads, web tools, cloud APIs, GPU acceleration, audio/image system dependencies, and server startup as explicit user-environment decisions.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).