The Full Journey
A production RAG application connects several Gloo AI features into one path. The diagram below shows it end to end: you set up your content and keep adding to it, Gloo answers questions against it, and you keep it current over time. Each stage maps to a step in this series or a focused tutorial.Pipeline at a Glance
1
Publisher setup (Studio)
Create the publisher that owns your content: covered below.
2
Ingest content with metadata
Upload files and enrich them: covered below, with a deep dive in Upload
Files to Data Engine.
3
Verify indexing
Poll item status until your content is searchable: covered below.
4
Semantic search
Query your content. Deep dive: Building Custom Search.
5
Grounded completions with sources
Answer questions from your content with citations. Deep dive:
Grounded Completions, which sets
rag_publisher to your publisher name.6
Content lifecycle
Update, bulk-edit, and delete content: Part
2.
7
Verification, errors & resilience
Error handling and retry patterns: Part
3.
Prerequisites
Before starting, you need:- A Gloo AI Studio account
- API key - Set the
GLOO_API_KEYenvironment variable to your key from the API Keys page. Keep it on your server and out of source control; see API Key Security
Step 1: Create Your Publisher
Content in the Data Engine belongs to a publisher. Create one in Gloo AI Studio:- In Gloo AI Studio, click your user account in the bottom-left corner and select Manage Organizations
- Select the organization you want to add the publisher to, then click View Publishers
- Click Create Publisher and give the new publisher a name
- Note two values for this publisher. Each parameter in this series takes a different one:
- Publisher ID (a UUID): the ingestion endpoints take it as the
publisher_idfield - Publisher name: the grounded endpoints take it as the
rag_publisherparameter
- Publisher ID (a UUID): the ingestion endpoints take it as the
Keep both values handy. The
Grounded Completions guide documents
rag_publisher as your publisher name, which you can read from the same
Publishers page.Step 2: Upload Content with a Producer ID
Upload a file to POST/ingestion/v2/files. The producer_id query parameter attaches your own stable identifier to the item. This is what makes the pipeline manageable later: re-running the upload detects a duplicate instead of creating a copy, and in Part 2 you’ll update, bulk-edit, and delete these same items.
This series uses a short Markdown article as its sample content: grab building-stronger-communities.md from the cookbook repository and save it next to your script. (Any Markdown, text, PDF, or Word file of your own works too. Just adjust the filename.) Then upload it:
Content not on local disk? See Preparing Content for
Ingestion for the source-agnostic pattern:
pulling from a CMS, API, database, file library, or feed, and how to
structure content before it reaches this upload step.
What You’ll See
Step 3: Enrich with Metadata
Attach descriptive metadata with PATCH/engine/v2/item. Titles and authors appear in search results and source citations, and tags let you organize and bulk-manage content in Part 2.
Metadata can be set as soon as the item ID exists. You don’t need to wait for
ingestion to finish. You can also target a single item by
producer_id
instead of item_id.Step 4: Verify Indexing
Ingestion is asynchronous: the upload response means your file is queued, not searchable. Poll GET/engine/v2/items/{item_id} until status reaches COMPLETED, typically a few minutes for a small file. While processing you’ll see intermediate states such as CHUNKING (see How Chunking Works for what happens during this stage).
What You’ll See
For a fresh upload (about 6 minutes for the sample file):COMPLETED immediately. The response also returns the title, author, and tags from Step 3: proof they’re attached to the indexed item.
Run the Complete Example
The cookbook contains the full pipeline (upload, metadata, and polling with error handling) as one runnable program in all six languages. From the cookbook repository, install dependencies, copy.env.example to .env and add your credentials, then run it:
Working Code Sample
View Complete Code
Clone or browse the complete working examples for all 6 languages (JavaScript,
TypeScript, Python, PHP, Go, Java) with setup instructions and the sample
content file.
Troubleshooting
Error: 401 Unauthorized
Your API key is missing or invalid. Verify theGLOO_API_KEY environment variable is set correctly. See the Authentication Tutorial.
Error: 400 publisher_not_found
Thepublisher_id doesn’t exist or isn’t accessible with your credentials. Copy the Publisher ID (a UUID) from Studio > Data Engine > Publishers.
Error: 400 too_many_files
producer_id applies to a single file. When uploading multiple files in one request, omit it.
Polling times out
Larger files take longer to process. Increase the timeout, or check Studio > Ingestion Analytics to see whether the publisher is still processing.Next Steps
Your pipeline now has indexed, metadata-rich content. Wire it into retrieval:- Building Custom Search: query this content semantically with the Search API
- Grounded Completions: answer questions from this content with source citations (set
rag_publisherto your publisher name, not the Publisher ID) - Part 2: Content Lifecycle: update, bulk-edit, and delete the items you created here
- Part 3: Verification, Error Handling & Resilience: production-grade retry and verification patterns

