canonical: https://jentic.com/apis/googleapis.com/discoveryengine

# Google Discovery Engine API

Google Discovery Engine (the API behind Vertex AI Search and Vertex AI Conversation) lets developers build retrieval, search, and grounded conversational experiences over their own structured and unstructured data. The API exposes data stores, schemas, documents, completion configs, and grounding/check operations so teams can run semantic search, recommendations, and RAG-grounded chat against enterprise content. It supports custom model training, evaluation, and identity-mapped retrieval.

## For AI agents

Run semantic search, recommendations, and RAG-grounded conversations over your own data via Vertex AI Search.

## Scope

Does not host raw LLMs, train embedding models, or manage GPUs - use for managed retrieval, ranking, and grounding via Vertex AI Search only.

## Capabilities

- Run semantic search and autocomplete over a custom data store of documents
- Train and serve custom search ranking models on a data store
- Ground LLM responses against indexed content via the groundingConfig:check endpoint
- Map enterprise identities into a data store so search respects user-level ACLs
- Run and inspect search-quality evaluations to measure model performance
- Issue autocomplete suggestions and remove unwanted suggestions

## Use cases

### Enterprise Semantic Search

Build a private semantic search experience over indexed enterprise documents. The completionConfig:completeQuery endpoint provides autocomplete; the search endpoints (under data stores) return ranked results with snippets. Teams swap out keyword search for semantic ranking without managing embeddings or vector indexes themselves.

Example prompt: Call completeQuery on completionConfig 'projects/p/locations/global/dataStores/ds/completionConfig' with input 'reset pass' and return the top 5 suggestions.

### RAG Grounding Verification

When a downstream LLM produces an answer, call groundingConfig:check to verify the answer is supported by indexed content. The endpoint returns citations and a grounding score, which apps use to gate publishing or display source links beside the answer. Critical for compliance-sensitive deployments.

Example prompt: Call groundingConfig:check with answer text 'Pricing is $99 per seat per month' and grounding sources set to data store ds-pricing, then return the grounding score and citations.

### Custom Ranking Model Training

Train a custom search model on a data store via the trainCustomModel endpoint. The model learns from in-product engagement signals (clicks, dwell) and outranks the default for the customer's domain. Teams iterate by running listResults on evaluation jobs to measure NDCG and recall.

Example prompt: Trigger trainCustomModel on data store ds-products, then poll evaluation:listResults until the run is COMPLETED and return the NDCG@10 score.

### Agent-Driven Search-and-Verify

Through Jentic, an AI agent can search a private data store for relevant context, then call groundingConfig:check to verify its synthesised answer is supported before responding to the user. Credentials are scoped per agent run by your Jentic One instance.

Example prompt: Use Jentic to search 'search a Vertex AI data store', load the schema, execute the search for query 'refund policy' on ds-help, then call groundingConfig:check on the synthesised answer.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1beta/{+completionConfig}:completeQuery | Get autocomplete suggestions |
| POST | /v1beta/{+completionConfig}:removeSuggestion | Remove an autocomplete suggestion |
| POST | /v1beta/{+groundingConfig}:check | Check whether an answer is grounded against sources |
| POST | /v1beta/{+dataStore}:trainCustomModel | Train a custom ranking model on a data store |
| POST | /v1beta/{+evaluation}:listResults | List results of a search-quality evaluation |
| POST | /v1beta/{+identityMappingStore}:importIdentityMappings | Import enterprise identity mappings |

## Key resources

- **dataStores** — Index and manage document collections for search and recommendations
- **completionConfigs** — Configure and serve query autocomplete
- **groundingConfigs** — Verify LLM answers against indexed content
- **customModels** — Train custom ranking models on a data store
- **evaluations** — Run and inspect search-quality evaluations
- **identityMappingStores** — Map enterprise identities for ACL-aware retrieval

## Why Jentic

- **Setup:** Wiring the Discovery Engine API by hand means standing up Google OAuth2 with the right scopes, targeting discoveryengine.googleapis.com, and building the resource-path calls yourself for data stores, serving configs, and grounding. Through Jentic you install once, import the Discovery Engine API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** Discovery Engine puts the resource name in the URL path (/v1beta/{+dataStore}, /v1beta/{+servingConfig}), so a rule can pin your agent to one data store or serving config: it can complete queries and check grounding there and nothing else. You choose the operations it may call, so state-changing ones like trainCustomModel or importIdentityMappings are not included unless you add them.
- **Credential handling:** Your Google OAuth credential for Discovery Engine is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'ground a response with Vertex AI Search' or 'autocomplete a search query', and Jentic returns the matching Discovery Engine operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Vertex AI API** — Foundational LLMs, embeddings, and training infra that pairs with Discovery Engine retrieval
- **Dialogflow API** — Conversational orchestration that can be grounded with Discovery Engine
- **Custom Search API** — Lightweight site-search over public web content - different from private RAG

## FAQ

### What authentication does the Discovery Engine API use?

OAuth 2.0 with the cloud-platform scope. Through Jentic, OAuth tokens are scoped per agent run and stored encrypted in your Jentic One instance, so service-account JSON keys never enter the agent runtime.

### Can I ground LLM answers against my own documents with Discovery Engine?

Yes. The /v1beta/{groundingConfig}:check endpoint takes an answer plus grounding sources (data stores or chunks) and returns a grounding score plus citations. Use it to gate publishing of LLM-generated content.

### What are the rate limits for the Discovery Engine API?

Quotas are per project and depend on the operation: query and complete operations have higher per-second budgets than write or train operations. Check the Google Cloud Console under APIs and Services for the current quotas on your project.

### How do I run autocomplete on a data store through Jentic?

Search 'autocomplete a Vertex AI Search query', load the schema for /v1beta/{completionConfig}:completeQuery, then execute it with your completion config name and input string. Jentic returns the suggestion list.

### Does Discovery Engine support per-user ACLs?

Yes. Use identityMappingStore:importIdentityMappings to load enterprise identities, then queries scoped to a user respect document-level ACLs at search time. Useful for HR, legal, and finance content where access varies by role.

### Is the Discovery Engine API free?

No. Pricing is per query and per indexed document, with tiers for Search, Recommendations, and Conversation. Custom model training has separate compute charges. Check current pricing in the Google Cloud Console.

### Can I limit what my agent is allowed to do with the Discovery Engine API?

Yes. Because Discovery Engine puts the resource name in the URL path, such as {+dataStore} and {+servingConfig}, your self-hosted Jentic One instance lets you write rules that pin the agent to a single data store or serving config, so it can complete queries and run groundingConfig:check there and nothing else. You decide which operations the agent may call, so state-changing ones like trainCustomModel or importIdentityMappings stay out of reach unless you add them. The OAuth credential is held by your own instance and injected at execution time, so the agent only ever exercises the access you granted.
