> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/textual/textual-install-administer/textual-architecture.md).

# Textual architecture

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

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FO1ehRHoGNYkGZOe6spA8%2FDiagram_TextualArchitectureWithLLM.png?alt=media&amp;token=f0a5357b-ff18-45df-b57f-60d25c76bb8a" 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 RoBERTa

A textual installation can have 1 or more RoBERTa containers.

The RoBERTa container hosts:

* Built-in Textual models&#x20;
* Models for custom entity types

It takes text from the worker or web server and returns any entities that it discovers.

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

### Textual machine learning

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

The machine learning container performs:

* PDF processing
* Optical character recognition (OCR)
* Signature processing
* Date synthesis
* Document conversion

Workloads in this container can be compute-intensive. We recommend that you run this container on a machine that has sufficient resources.

For workloads that include machine learning tasks, additional machine learning containers can increase the volume of data 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 uses the LLM service for:

* [LLM synthesis](/textual/textual-playground.md)
* [Textual Agent](/textual/textual-agent/textual-agent-about.md)
* [Agent-to-Agent API](/textual/textual-integrations/textual-a2a-agent.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
