Package: txtai
All-in-one embeddings databasetxtai is an all-in-one embeddings database for semantic search, LLM orchestration and language model workflows.Embeddings databases are a union of vector indexes (sparse and dense), graph networks and relational databases. This enables vector search with SQL, topic modeling, retrieval augmented generation and more.Embeddings databases can stand on their own and/or serve as a powerful knowledge source for large language model (LLM) prompts.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.⚙️ Build with Python or YAML. API bindings available forJavaScript,Java,RustandGo.☁️ Run local or scale out with container orchestrationtxtai is built with Python 3.8+,Hugging Face Transformers,Sentence TransformersandFastAPI. txtai is open-source under an Apache 2.0 license.Interested in an easy and secure way to run hosted txtai applications? Then join thetxtai.cloudpreview to learn more.Why txtai?New vector databases, LLM frameworks and everything in between are sprouting up daily. Why build with txtai?Up and running in minutes withpiporDocker# Get started in a couple linesimporttxtaiembeddings=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.ymlembeddings:path:sentence-transformers/all-MiniLM-L6-v2CONFIG=app.ymluvicorn"txtai.api:app"curl-XGET"http://localhost:8000/search?query=positive"Run local - no need to ship data off to disparate remote servicesWork with micromodels all the way up to large language models (LLMs)Low footprint - install additional dependencies and scale up when neededLearn by example- notebooks cover all available functionalityUse CasesThe following sections introduce common txtai use cases. A comprehensive set of over 50example notebooks and applicationsare also available.Semantic SearchBuild semantic/similarity/vector/neural search applications.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.Get started with the following examples.NotebookDescriptionIntroducing txtai▶️Overview of the functionality provided by txtaiSimilarity search with imagesEmbed images and text into the same space for searchBuild a QA databaseQuestion matching with semantic searchSemantic GraphsExplore topics, data connectivity and run network analysisLLM OrchestrationLLM chains, retrieval augmented generation (RAG), chat with your data, pipelines and workflows that interface with large language models (LLMs).ChainsIntegrate LLM chains (known as workflows in txtai), multiple LLM agents and self-critique.See below to learn more.NotebookDescriptionPrompt templates and task chainsBuild model prompts and connect tasks together with workflowsIntegrate LLM frameworksIntegrate llama.cpp, LiteLLM and custom generation frameworksBuild knowledge graphs with LLMsBuild knowledge graphs with LLM-driven entity extractionRetrieval augmented generationRetrieval 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".A novel feature of txtai is that it can provide both an answer and source citation.NotebookDescriptionBuild RAG pipelines with txtaiGuide on retrieval augmented generation including how to create citationsGenerate knowledge with Semantic Graphs and RAGKnowledge exploration and discovery with Semantic Graphs and RAGAdvanced RAG with graph path traversalGraph path traversal to collect complex sets of data for advanced RAGLanguage Model WorkflowsLanguage model workflows, also known as semantic workflows, connect language models together to build intelligent applications.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.NotebookDescriptionRun pipeline workflows▶️Simple yet powerful constructs to efficiently process dataBuilding abstractive text summariesRun abstractive text summarizationTranscribe audio to textConvert audio files to textTranslate text between languagesStreamline machine translation and language detectionInstallationThe easiest way to install is via pip and PyPIpip install txtaiPython 3.8+ is supported. Using a Pythonvirtual environmentis recommended.See the detailedinstall instructionsfor more information coveringoptional dependencies,environment specific prerequisites,installing from source,conda supportand how torun with containers.Model guideSee 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-v2Image CaptionsBLIPLabels - Zero ShotBART-Large-MNLILabels - FixedFine-tune withtraining pipelineLarge Language Model (LLM)Mistral 7B OpenOrcaSummarizationDistilBARTText-to-SpeechESPnet JETSTranscriptionWhisperTranslationOPUS Model SeriesModels 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.Hugging Face TasksHugging Face Model HubMTEB LeaderboardOpen LLM LeaderboardPowered by txtaiThe following applications are powered by txtai.ApplicationDescriptiontxtchatRetrieval Augmented Generation (RAG) powered searchpaperaiSemantic search and workflows for medical/scientific paperscodequestionSemantic search for developerstldrstorySemantic search for headlines and story textIn addition to this list, there are also many otheropen-source projects,published researchand closed proprietary/commercial projects that have built on txtai in production.Further ReadingIntroducing txtai, the all-in-one embeddings databaseTutorial series on Hashnode|dev.toWhat's new in txtai 7.0|6.0|5.0|4.0Getting started with semantic search|workflowsRunning txtai at scaleDocumentationFull documentation on txtaiincluding configuration settings for embeddings, pipelines, workflows, API and a FAQ with common questions/issues is available.ContributingFor those who would like to contribute to txtai, please seethis guide.