Project overview
txtai is a Python framework for semantic search, large language model orchestration and language model workflows. Its core is an embeddings database that combines sparse and dense vector indexes, graph networks and relational databases to support retrieval and provide knowledge for language model applications.
The project requires Python 3.11 or later and uses Hugging Face Transformers, Sentence Transformers and FastAPI. It is licensed under Apache-2.0.
Use cases
- Search by meaning: find semantically related content even when a query uses different words from the source.
- Build knowledge-base question answering: retrieve relevant material before passing it to a large language model to help answer questions.
- Search multiple content types: create vector representations of text, documents, audio, images and video for indexing and retrieval.
- Connect content processing tasks: combine question answering, labeling, transcription, translation and summarization into workflows.
- Build agents: connect retrieval, model pipelines, workflows and other agents to handle tasks.
What it does and problems it solves
txtai provides semantic search to help find relevant material that keyword matching can miss. Its embeddings database also supports SQL queries, topic modeling and graph analysis, allowing different ways to retrieve and explore data.
For knowledge-base question answering, it supports retrieval augmented generation (RAG): retrieving reference material and using it as context for answers. This can reduce the risk of unsupported model output, but does not guarantee correct answers.
It can also connect multiple model processing stages, reducing the work of organizing retrieval, summarization, translation and similar tasks separately. The project provides Web and MCP APIs, language bindings for JavaScript, Java, Rust and Go, and support for running locally or scaling through container orchestration.
How to use
1. After installation, read `examples/01_Introducing_txtai.ipynb` in the original repository to learn the basic search functionality. Access the examples through the original repository below this page.
2. Following the README's minimal example, run `import txtai` in Python, then run `embeddings = txtai.Embeddings()` to create an object for indexing and searching.
3. Run `embeddings.index(["Correct", "Not what we hoped"])` to add two sample texts to the index.
4. Run `embeddings.search("positive", 1)` to retrieve one result based on the meaning of “positive.” The README illustrates results as a text identifier and similarity score; actual results depend on execution.
5. To work with your own material, consult `examples/rag_quickstart.py`, `examples/workflow_quickstart.py` or `examples/agent_quickstart.py` in the original repository, depending on your goal. Models can be loaded using a Hugging Face Hub model path or a local directory; default models are loaded when no path is specified. Consult the corresponding examples and documentation for configuration details.
Installation
1. Prepare Python 3.11 or later. The README does not provide instructions for installing Python itself; consult the installation documentation available through the original repository for environment requirements.
2. Use a Python virtual environment as recommended by the README to keep this project's dependencies separate from other projects. The supplied material does not include commands to create and activate that environment; follow the relevant documentation through the repository's installation instructions.
3. Open a terminal in the prepared Python environment and run `pip install txtai`.
4. For optional dependencies, environment-specific prerequisites, installation from source, conda, minimal installation or containers, access the detailed installation documentation through the original repository below this page. The supplied README does not include complete commands for these methods, so the basic installation steps should not be assumed to cover them.
This page provides access to the repository, not a verified runnable package.
Source and usage notes
- Original repository: https://github.com/neuml/txtai
- Source revision: 738aac498ccbba7c4bff51886e660edd5241d04e
This listing links to the upstream repository. It does not provide a verified download package, and the complete workflow has not been independently validated.
This description was organized and translated with AI from public upstream material. Refer to the original repository for capabilities, setup requirements, costs, and license terms.