# Textual architecture

The following diagram shows how data and requests flow within the Tonic Textual application:

<figure><img src="/files/mczh460vGjja5k8D7T9p" alt=""><figcaption><p>Textual architecture</p></figcaption></figure>

## Textual application database

The Textual application database is a PostgreSQL database that stores the dataset configuration.

If you do not configure an S3 bucket, then it also stores uploaded files and files that you use the SDK to redact.

## Textual datastore in Amazon S3

You can configure an S3 bucket to store uploaded files and individual files that you use the SDK to redact. For more information, go to [Setting the S3 bucket for file uploads and redactions](/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/textual-config-pipeline-upload.md).

If you do not configure an S3 bucket, then the files are stored in the Textual application database.

## Textual components

### Textual web server

Runs the Textual user interface.

### Textual worker

A textual instance can have multiple workers.

The worker orchestrates jobs. A job is a longer running task such as the redaction of a single file.

If you redact a large number of files, you might deploy additional workers and machine learning containers to increase the number of files that you can process concurrently.

### Textual machine learning

A textual installation can have 1 or more machine learning containers.

The machine learning container hosts the Textual models. It takes text from the worker or web server and returns any entities that it discovers.

Additional machine learning containers can increase the number of words per second that Textual can process.

## OCR service

The OCR service converts PDFs and images to text that Textual can then scan for sensitive values.

For more information, go to [Enabling PDF and image processing](/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/textual-config-pdf-image.md).

## LLM service

Textual only uses the LLM service for [LLM synthesis](/textual/textual-playground.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/textual/textual-install-administer/textual-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
