File size: 2,065 Bytes
3194d90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6914b27
3194d90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e842f9c
3194d90
 
 
59ac7da
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
license: apache-2.0
---

# TxtAI Applications

This repository hosts a series of example TxtAI applications. Applications are YAML configuration files that automatically build and export a ready-to-use web API.

## Install

Run the following to get started

```
pip install txtai[api]
```

## Applications

List of applications.

- [RAG](./rag.yml): Retrieval Augmented Generation (RAG) with the following configuration.
  - Text Extraction with [Docling](https://github.com/docling-project/docling), Chunking, and Indexing of documents. Supports PDF, DOCX, Web, XLSX files and more.
  - Vector database with embeddings generation
  - [gpt-oss-20B](https://huggingface.co/unsloth/gpt-oss-20b-GGUF) LLM
  - [RAG pipeline](https://neuml.github.io/txtai/pipeline/text/rag/) that joins vector search with the LLM
- [Translation](./translate.yml): Translates input text to the target language of choice. Automatically detects input language and selects best translation model.

## Start an application

Pick a file, download it and run the following.

```
CONFIG=rag.yml uvicorn "txtai.api:app"
```

## Sample actions

### Index the TxtAI website

```
# Pick any PDF, XLSX, DOCX etc
curl -X POST "http://localhost:8000/workflow" -H  "Content-Type: application/json" -d '{"name":"index","elements":["https://github.com/neuml/txtai"]}'
```

### Run a RAG search

```
curl -N "http://localhost:8000/rag?query=List+txtai+strengths&maxlength=2048&stripthink=True&stream=True"
```

<img src="./stream.gif">

Use the language or library of choice to interact with the API. TxtAI also provides a series of client libraries for [JavaScript](https://github.com/neuml/txtai.js), [Java](https://github.com/neuml/txtai.java), [Rust](https://github.com/neuml/txtai.rs) and [Go](https://github.com/neuml/txtai.go).

## Run with Docker

If you don't want to install TxtAI, these applications can instead be run with TxtAI's Docker Image.

```
docker run -it -p 8000:8000 -v /tmp/config:/config -e CONFIG=rag.yml --entrypoint uvicorn neuml/txtai-gpu --host 0.0.0.0 txtai.api:app
```