Skip to main content

Overview

Our customers entrust us with their content, and in order to then gain a real business benefit from their content, they want to provide selective, context-aware access to it to their customers, depending on their needs. Search is how we help customers present their data, based on the context their customers provide, in the form of a query. That’s the beauty of AI-based, near-text, semantic search, and that’s why we use it at Gloo. For example, if one of our customers adds articles and podcasts about keeping a marriage strong, and during one of the podcast episodes, the discussion focuses on the guest’s top five rules for keeping a marriage healthy, we will likely want search queries that ask for “secrets to a happy marriage” to include in that particular podcast in the results. The word “secret” doesn’t necessarily have to be included in the content, and the word “rule” doesn’t have to be in the search query, but nevertheless, the results should include this podcast episode. Specifically, search allows you to query your ingested content, to see what you’re presenting to the world, through Gloo AI. Our API returns your content, broken up into snippets, showing what we provide to our internal chat-based tools, and what you can use in your own applications. Snippets are sections of a content item, e.g. podcast episode, article, book, that represent a large enough piece of meaningful information to be searchable, and understandable by our AI tools. These snippets also represent a recorded unit of searchable content within our backend systems.

RAG - Retrieval Augmented Generation

When constructing an AI application, it is sometimes useful to provide additional context to the AI model. Retrieval Augmented Generation allows you to insert these search results in the message to the model, and this can provide a more successful, context-aware interaction with your customers.

Making Requests

Prerequisites

Before making a request, you must know which publisher’s content you would like to query.
  1. Find Your Tenant (Publisher Name): First, navigate to the Organizations page in Studio and click “View Publishers”. Your Tenant is the name of the publisher you’re querying.
  2. Identify the Collection: A collection is where we keep the content for our customers. The only collection you’ll need to specify in requests is GlooProd. You must specify this in the collection field.
NOTE: You will only have access to your own publisher’s tenant through this endpoint. For multi-tenant collections such as GlooProd, a tenant must be specified; requests outside your tenant return a 403 “Forbidden” response.
Tenant names are normalized. Spaces and whitespace are stripped from the publisher name to form the tenant identifier. For example, Example Publisher name becomes ExamplePublisherName. Passing the raw publisher name with spaces can cause a 400 "invalid tenant" error.To get the exact tenant string, call GET /ai/v1/data/tenant/names and use the value returned. This is the recommended approach rather than constructing the tenant name yourself.

How many records can I retrieve?

We recommend anywhere from 10 to 100 results, though request time will rise non-linearly with larger result sets. The limit field is how you specify how many records to return.

How do I make a request?

Once you have your tenant name, you’re ready to query the search endpoint. You can get an API key from the API Keys page and send it directly as a Bearer token. Endpoint: POST /ai/v1/data/search

Example cURL Request

cURL
Example Response The result should look something like this:
JSON