💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update documentation
davidmezzetti1d638e03446e
diff --git a/docs/embeddings/configuration.md b/docs/embeddings/configuration.mdindex 927c1c63..c4f114f4 100644--- a/docs/embeddings/configuration.md+++ b/docs/embeddings/configuration.md@@ -132,6 +132,18 @@ List of functions with user-defined SQL functions, only used when [content](#con[An example can be found here](../query#custom-sql-functions).+### query+```yaml+query:+ path: Sets the path for the query model. This can be any model on the+ [Hugging Face Model Hub](https://huggingface.co/models) or+ a local file path.+ prefix: text prefix to prepend to all inputs+ maxlength: maximum generated sequence length+```++Query translation model. Translates natural language queries to txtai compatible SQL statements.+### quantize```yamlquantize: boolean@@ -148,18 +160,6 @@ tokenize: booleanEnables string tokenization (defaults to false). This method applies tokenization rules that only work with English language text and may increase the quality ofEnglish language sentence embeddings in some situations.-### query-```yaml-query:- path: Sets the path for the query model. This can be any model on the- [Hugging Face Model Hub](https://huggingface.co/models) or- a local file path.- prefix: text prefix to prepend to all inputs- maxlength: maximum generated sequence length-```--Query translation model. Translates natural language queries to txtai compatible SQL statements.-## CloudThis section describes parameters used to sync compressed indexes with cloud storage. These parameters are only enabled if an embeddings index is stored as compressed. They are set via the [embeddings.load](../methods/#txtai.embeddings.base.Embeddings.load) and [embeddings.save](../methods/#txtai.embeddings.base.Embeddings.save) methods.diff --git a/docs/embeddings/query.md b/docs/embeddings/query.mdindex df06e226..56222e35 100644--- a/docs/embeddings/query.md+++ b/docs/embeddings/query.md@@ -135,6 +135,23 @@ limit 1""")```+## Query translation++Natural language queries with filters can be converted to txtai-compatible SQL statements with query translation. For example:++```python+embeddings.search("feel good story since yesterday")+```++can be converted to a SQL statement with a similar clause and date filter.++```sql+select id, text, score from txtai where similar('feel good story') and+entry >= date('now', '-1 day')+```++This requires setting a [query translation model](../configuration#query). The default query translation model is [t5-small-txtsql](https://huggingface.co/NeuML/t5-small-txtsql) but this can easily be finetuned to handle different use cases.+## Combined index architectureWhen content storage is enabled, txtai becomes a dual storage engine. Content is stored in an underlying database (currently supports SQLite) along with an Approximate Nearest Neighbor (ANN) index. These components combine to deliver similarity search alongside traditional structured search.diff --git a/docs/pipeline/text/entity.md b/docs/pipeline/text/entity.mdindex 96055362..a27553e9 100644--- a/docs/pipeline/text/entity.md+++ b/docs/pipeline/text/entity.md@@ -3,7 +3,7 @@-The entity extraction pipeline applies a token classifier to text and extracts entity/label combinations.+The Entity pipeline applies a token classifier to text and extracts entity/label combinations.## Examplediff --git a/docs/pipeline/text/sequences.md b/docs/pipeline/text/sequences.mdindex 6944ea0e..ad7f8cf7 100644--- a/docs/pipeline/text/sequences.md+++ b/docs/pipeline/text/sequences.md@@ -3,7 +3,7 @@-The sequences pipeline runs text through a sequence-sequence model and generates output text.+The Sequences pipeline runs text through a sequence-sequence model and generates output text.## Example@@ -14,7 +14,7 @@ from txtai.pipeline import Sequences# Create and run pipelinesequences = Sequences()-sequences("translate English to French: Hello, how are you?")+sequences("Hello, how are you?", "translate English to French: ")```## Configuration-driven example@@ -31,6 +31,7 @@ workflow:sequences:tasks:- action: sequences+ args: ["translate English to French: "]```### Run with Workflows@@ -40,7 +41,7 @@ from txtai.app import Application# Create and run pipeline with workflowapp = Application("config.yml")-list(app.workflow("sequences", ["translate English to French: Hello, how are you?"]))+list(app.workflow("sequences", ["Hello, how are you?"]))```### Run with API@@ -51,7 +52,7 @@ CONFIG=config.yml uvicorn "txtai.api:app" &curl \-X POST "http://localhost:8000/workflow" \-H "Content-Type: application/json" \- -d '{"name":"sequences", "elements": ["translate English to French: Hello, how are you?"]}'+ -d '{"name":"sequences", "elements": ["Hello, how are you?"]}'```## Methods