Ask Oracle - Advisors¶
Ask Oracle is the conversational layer of every Agentic App: one persistent input bar at the top of the page where users can ask anything at any time. Answers come from the app's specialist agents and can include rich widgets, actions and communications as well as text.
Who answers? Two modes¶
Assign an agent team to the Ask Oracle static slot (stored as queryAgent). Every question goes to it.
- You control routing, prompt, tone and response style.
- Best when you want one consistent voice, or when one team owns the whole domain.
Leave the slot empty. The Agentic App Orchestrator compares each question's intent with every panel agent's description and capabilities, then routes the question to the best match.
- Different questions can go to different specialists, like an expert panel available around the clock.
- Best when the app has several specialist panel agents.
Request flow¶
sequenceDiagram
autonumber
actor U as User
participant App as Ask Oracle bar
participant O as Orchestrator
participant A as Selected agent workflow
U->>App: Types a question
App->>O: Request with $OraMessageHint = "Query"
O->>A: Route (queryAgent, or best description match, or section scope)
A->>A: Switch on hint → Query LLM/Agent node<br/>($inputMessage, $chatHistory, …)
A-->>App: Text + optional oraInfoDisplay / oraInsight / oraComms
App-->>U: New section at top of page
- The user submits a question; it becomes the input message.
- The framework sets the hint to
Query. - The orchestrator routes the question. In a single-agent app this step is trivial.
- The chosen agent's workflow branches on the hint and runs its Query node.
- The response appears as a new section at the top of the page.
Placement and pinning
A new answer replaces the previous Ask Oracle section unless the user has pinned it. Pinned sections stay, and new answers appear above them. This stops the page from growing without limit while keeping what the user chose to keep. The chat panel also remembers prompts, uploaded files, generated artifacts, sources and suggested actions for the session.
What to pass into the Query node¶
Context is not passed automatically. Wire it into the Query node's prompt yourself.
| Variable | Required? | Why |
|---|---|---|
$context.$system.$inputMessage |
Required | The user's question |
$context.$system.$chatHistory |
Required | Previous turns. Without it, follow-up questions fail. |
$context.$app.$OraUserContext |
Optional | User identity, for personalized or user-scoped answers |
$context.$app.$OraAppContext |
Optional | The entity the app is scoped to (from the URL or navigation) |
$context.$app.$OraAttachments |
Optional | Files the user uploaded (needs the MultiFileProcessor tool) |
$context.$app.$OraAgentList |
Optional | The app's other agents, useful for a dedicated Query agent |
Why $chatHistory matters¶
Each question is a separate, stateless LLM call. Consider:
- "Show me the top talent we're at risk of losing."
- "And what about next quarter?"
Without $chatHistory, the second question has no subject and gets a generic or off-target answer. With it, the model knows the conversation is about retention risk.
You are the Talent Retention Advisor.
Conversation so far:
{{$context.$system.$chatHistory}}
New question from the user:
{{$context.$system.$inputMessage}}
The current user is {{$context.$app.$OraUserContext}}.
Answer concisely using the retention data available to you. If the question is a
follow-up, use the conversation to resolve pronouns, time references and implied subjects.
When comparing trends, include a chartWidget; for prioritized lists, a messageListWidget.
Routing depends on descriptions¶
In orchestrator mode, the team description decides which agent answers. Use specific verbs, nouns and dimensions.
One-question routing test
Ask the app a question that clearly belongs to one agent. If the wrong agent answers, rewrite the description, not the prompt, and ask the same question again. If the right agent now answers, routing was the cause.
Response composition¶
A Query response can combine:
| Output | Tag | Purpose |
|---|---|---|
| Information display | <oraInfoDisplay> |
A widget alongside the text. Detail goes in the widget; the text sums up the insight. |
| Actionable insight | <oraInsight> |
Something the user can act on |
| Communication | <oraComms> |
A suggested email or text |
The Query prompt decides whether these appear, and the App Experience section sets which ones are allowed.
Two steps for widgets in answers
- Select the widget type under Select the widgets you want to use in the node's App Experience section.
- Tell the Query prompt to use it.
If either step is missing, the widget never appears.
Section focus scoping¶
| Where the user is | Ask Oracle talks to |
|---|---|
| Main app page | The queryAgent, or orchestrator dispatch across all agents |
| Section Focus View | Only the agents behind that section |
The framework handles scoping for you. You only need each panel agent's workflow to handle the Query hint.
Tone and summary behavior¶
- Tone is set in the Query prompt, e.g. "concise and analytical" or "friendly and conversational". A Compliance agent shouldn't sound like a Talent agent.
- Summary-first or direct answer. Quick lookups ("who owns Deal X?") work best as direct answers. Analytical questions ("how did Region 2 do this quarter?") benefit from a one-line summary above the display. Add or omit a summary instruction in the prompt.
Configure in the Builder UI¶
- In the Builder canvas, click the Ask Oracle static container.
- Click Assign Custom Agent (or + Add Agent) and choose the agent team.
- Save. This sets
queryAgent.
The assigned agent must have Expose to Agentic Apps turned on and a Query branch in its workflow that passes $inputMessage and $chatHistory.
Starter queries¶
In Builder View, select Ask Oracle settings. Under Custom Query Agent Code, configure Starter Queries using Static or Dynamic, Suggestions seed the input; selecting one does not submit it or change query routing.
Static starter questions¶
Add categories under Starter Queries, then add questions inside each category. The documented limits are 6 categories and 10 questions per category. Questions are filtered as the user types.
Dynamic starter queries¶
Under Starter Queries, select Dynamic and select the workflow that supplies suggestions. This replaces the static list. The workflow receives InitSampleQueries at initial app load and on context changes. The popup shows loading while waiting. Return strict JSON:
{
"recommended": {
"displayName": "Recommended",
"samples": [
"Show me the highest-risk accounts",
"Which renewals need attention?"
]
},
"followUps": {
"displayName": "Follow-ups",
"samples": [
"What should I handle first today?"
]
}
}
Each top-level key is a category ID, in above example followUps and recommended are category IDs; samples contains strings. Return only JSON, without Markdown fences, widgets, actions, or communications. Return {} when no suggestions are useful. Use $OraAppContext and $OraUserContext when suggestions depend on the current scope or user, and retrieve evidence first when questions depend on live records. A deterministic Code or Return handler can produce this JSON from retrieved data or approved static rules. One non-empty category produces a list; multiple categories add tabs.
Ask Oracle Query Value Filters¶
Query value filters let users look up values while composing an Ask Oracle question. When at least one filter is configured, the input displays Type # to lookup common values. A dedicated workflow supplies the options for the selected category and search text.
Configure a filter¶
Add a filter with a stable unique Category ID, a user-facing Display Name, and one configured Workflow. App Builder generates the filter row ID. With filters configured, typing # at the beginning of a query or after a space opens the category picker.
Workflow request and response¶
Route $context.$app.$OraMessageHint = QueryFilterValues to a lookup handler. Read $context.$app.$OraQueryFilter for the selected category and picker search text:
The app calls the workflow when the value picker opens and when its search text changes. The first lookup uses an empty search string; return useful initial options. Use categoryId to choose the data source or field when one workflow serves several filters, and apply searchString as a prefix filter where possible. Keep option names concise. The string-array response contract is:
Return only the JSON array; each string becomes a picker option. Return [] when no values match. Keep this branch separate from the normal Query answer handler and the InitSampleQueries starter-question handler.
Category: {{ $context.$app.$OraQueryFilter.categoryId }}
Search text: {{ $context.$app.$OraQueryFilter.searchString }}
Look up authorized values for this category matching the search text.
Return only a JSON array of matching strings, or [] when none match.
Values with metadata¶
Use strings when the visible name is all the query workflow needs. To pass a stable record ID or additional machine-readable context with a selection, return an object with name and metadata. Strings and objects can be mixed in one response:
name must be a string. metadata must be a JSON object and can contain nested objects and arrays. For example, it can carry a supplier ID plus related record identifiers without adding them to the visible name.
When the user selects the object above, the submitted query preserves the category, name, and metadata:
For a plain string selection, the submitted tag contains the category and name only:
The Ask Oracle workflow and model receive the metadata. It is hidden from the input, chat transcript, outcome history, and other user-facing query text. Do not include secrets or information the receiving workflow and model should not access.
What users see after choosing a value¶
Ask Oracle inserts the selection as a highlighted tag in the input. The tag displays only the selected string or object name, without the category name or metadata. For example, the metadata-bearing selection above appears as Acme Parts within the user's question.
- Clicking or keyboard-activating the tag reopens its value picker so the user can change the selection.
- Deleting part of a tag removes the whole tag, preventing a partially broken lookup.
- A selection with metadata looks the same as a plain string selection; the extra context travels with the submitted query.
Starter-question placeholders¶
Use #{categoryId} in static questions or dynamic samples to insert a lookup placeholder. Registered categories show the filter display name and become editable tags when selected. Unknown categories stay plain text. Clicking or keyboard-activating a tag opens its picker; deleting part of a tag removes the whole tag.
Test the lookup experience¶
Preview static or dynamic starters, context refresh, empty and filtered lookups, tag editing, and a question containing a registered placeholder. In Workflow Builder, use QueryFilterValues run mode and supply Category ID and Search String. Test InitSampleQueries separately from Query; its output is a suggestion list, not an answer.
Test both string-only and metadata-bearing options. Confirm that each tag shows only the selected name, that it can be reopened or removed as a whole, and that the receiving query workflow gets the expected metadata without displaying it in user-facing query text.
Pitfalls¶
| Symptom | Fix |
|---|---|
| Follow-ups get generic answers | Wire $context.$system.$chatHistory into the Query node |
| Wrong agent answers | Make the team description more specific, then re-test the same question |
| Agent missing from the Ask Oracle picker | Turn on Expose to Agentic Apps |
| Text only, no widgets | Select the widgets and ask for them in the prompt |
| Answer ignores the user or the scoped entity | Pass $OraUserContext / $OraAppContext |
| Two answers overwrite each other | This is expected. Pin sections to keep them. |
| Simple questions are slow | Remove unnecessary LLM/tool calls from the Query branch; stay well under 60 s |