# About the Snowflake Native App

The Tonic Textual Snowflake Native App uses the same models and algorithms as the Tonic Textual API, but runs natively in Snowflake.

You use the app to redact or parse your text data directly within your Snowflake workflows. The text never leaves your data warehouse.

## App package containers

The app package runs natively in Snowflake, and leverages Snowpark Container Services.

It includes the following containers:

* Detection service, which detects the sensitive entity values.
* Redaction service, which replaces the sensitive entity values.

## Redaction workflow <a href="#app-workflow-redaction" id="app-workflow-redaction"></a>

For the redaction workflow, you use the app to detect and replace sensitive values in text.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2F2HtRkBUAZzN56efQVKd2%2FSnowflakeAppWorkflow.png?alt=media&#x26;token=5f56ac15-395a-4bd6-8e13-9454d045d330" alt=""><figcaption><p>Overview diagram of the redaction workflow in the Snowflake Native App for Textual</p></figcaption></figure>

1. You use `TEXTUAL_REDACT` to send the redaction request.\
   \
   When you call `TEXTUAL_REDACT`, it passes to the redaction service:
   * The text to redact
   * Optional configuration
2. The redaction service forwards the text to the detection service.
3. The detection service uses a series of NER models to identify and categorize sensitive words and phrases in the text.
4. The detection service returns its results to the redaction service.
5. The redaction service uses the results to replace the sensitive words and phrases with redacted or synthesized versions.
6. The redacted text is returned to the user.

## Parsing workflow <a href="#app-workflow-parsing" id="app-workflow-parsing"></a>

For the parsing workflow, you use the app to parse files that are in a Snowflake internal or external stage.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2Fik9EHJPQbjORYFFRIMrK%2FSnowflakeAppParseWorkflow.png?alt=media&#x26;token=dacf3ffc-31f3-4b1f-b06e-6191c226c15d" alt=""><figcaption><p>Overview diagram of the parse workflow in the Snowflake Native App for Textual</p></figcaption></figure>

1. You call `TEXTUAL_PARSE` to send the parse request. The request includes:
   * The fully qualified stage name where the files are located
   * The name of the file, or a variable that identifies the list of files
   * The MD5 sum of the file
2. The app uses a series of NER models to identify and categorize sensitive words and phrases in the text.
3. The app converts the content to a markdown format.
4. The markdown content is part of the JSON output that includes metadata about the parsed text. You can use the metadata to built RAG systems and LLM datasets.
5. The app stores the results of the parse request, including the output, in the `TEXTUAL_RESULTS` table.


---

# 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-integrations/snowflake-native-app-and-spcs/about-the-snowflake-native-app.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.
