Ingesting Data into the Knowledge Base

In this tutorial, you'll learn how to send data to the SnackPrompt AI Engine Knowledge Base.

What is an Elemental?

An elemental is the basic unit of data in SnackPrompt. It can be:

  • A table with columns and items

  • A document with sections

  • A file with structured content

When you send an elemental, the API:

  1. Processes the content

  2. Generates embeddings (vector representations)

  3. Stores in the Knowledge Base

  4. Makes the data searchable

Prerequisites

  • A valid tenant_id

  • The elemental_id of the data you want to ingest (obtained from the SnackPrompt platform)

Step 1: Send an Elemental

To ingest an elemental, make a POST request:

Parameters

Parameter
Type
Required
Description

elemental_id

string

Yes

ID of the elemental to ingest

trace_id

string

No

ID for tracking (useful for debugging)

Step 2: Understand the Response

Ingestion is processed in background. You'll receive an immediate confirmation:

Status code: 202 Accepted

This means the request was accepted and is being processed. Ingestion may take a few seconds to minutes, depending on the data size.

Step 3: Verify Data Was Ingested

To confirm your data is available, make a simple search:

If it returns results, your data was successfully ingested!

How to Remove Data

Remove by Elemental ID

To remove all data from a specific elemental:

Response:

Remove by Filters

To remove data using more specific filters:

Important: The tenant_id is required for filter-based deletion operations.

What Happens During Ingestion?

When you send an elemental, the API executes the following steps:

Stored Metadata

During ingestion, the following metadata is stored with each chunk:

Field
Description

tenant_id

Tenant ID (for isolation)

user_id

User ID

snack_elemental_id

Source elemental ID

snack_column_id

Column ID (if applicable)

snack_item_id

Specific item ID

source

Source type (elemental, document, file)

type_name

Elemental type (Table, Document, etc.)

category_name

Elemental category

original_text

Original chunk content

tag_ids

Associated tag IDs

tag_names

Associated tag names

Tag Inheritance

Tags are inherited in cascade:

The final item will have the merge of all tags (no duplicates).

Next Steps

Now that your data is in the Knowledge Base:

  1. Semantic Search - Learn how to search your data

  2. Chat with your Data - Chat with your data using AI

  3. Filter by Tags - Use tags to filter results


Estimated time: 10 minutes ✅

Last updated

Was this helpful?