Oracle Select AI profiles already give you a powerful way to connect natural language requests to the right AI provider, model, credentials, schema metadata, vector index, and runtime configuration. With the ‘role’ and ‘additional_instructions’ profile attributes, you can take that one step further: you can define reusable guidance directly in the AI profile.
Think of these attributes as profile-level guidance that works like a system prompt added to each Oracle Select AI augmented prompt. Instead of repeating the same business rules, date handling guidance, formatting preferences, domain context, or response constraints in every request, you define them once in the profile. Oracle Select AI applies that guidance whenever that profile is used.
The important design point is that profiles are purpose-built. The guidance you put in a SQL-focused profile is applied to generate, run, show, explain, or narrate SQL. The guidance you put in a RAG-focused profile is applied to retrieve and synthesize trusted content. When you use profiles with the Oracle Select AI Agent Framework, the agent profile typically remains minimal and identifies the LLM configuration for agent reasoning, while the agent object defines the agent role. However, if the profile is used in multiple agents, common information can be maintained in the profile itself.
This approach makes Oracle Select AI experiences more consistent across natural language to SQL, retrieval augmented generation, and agentic workflows on Oracle AI Database and Oracle Autonomous AI Database.
Profile-level instructions simplify prompting
Natural language interfaces are most useful when they understand more than words. They need context. But the right context depends on the type of request.
For an NL2SQL request, a question like: What were our top delayed routes last week?
can mean different things depending on the business. Does “last week” mean the previous calendar week or the last seven days? Does a delayed flight mean any late arrival, or only arrivals more than 15 minutes after schedule? Should cancelled flights be excluded? Should results be grouped by airport pair, route, region, or operating carrier?
Those rules belong naturally in an NL2SQL profile because they guide how Oracle Select AI interprets business language, chooses database objects, and generates SQL.
For a RAG request, a question like: Summarize our customer service policy for delayed flights.
needs a different kind of guidance. Should the answer use only retrieved policy documents? Should it avoid making statements that are not present in retrieved content? Should it distinguish between domestic and international rules? Should it respond in a concise customer-support style?
Those rules belong naturally in a RAG profile because they guide how Oracle Select AI grounds answers in retrieved documents and frames the response.
For an agent team, an agent may use a SQL tool backed by an NL2SQL profile and a RAG tool backed by a RAG profile. The agent also needs its own role, and that role typically belongs in the agent object, but can be augmented by the AI profile as well.
Profile-level instructions are powerful, but they work best when you place the guidance at the right layer: NL2SQL guidance in an NL2SQL profile, RAG guidance in a RAG profile, and agent persona or orchestration guidance in the agent and task definitions.
Using ‘role’ and ‘additional_instructions’ attributes
The ‘role’ attribute specifies the assistant persona or behavior that Oracle Select AI applies to requests that use the AI profile. You can use it to describe the profile-specific assistant, such as an airline analytics SQL assistant or an airline policy retrieval assistant.
The ‘additional_instructions’ attribute specifies persistent guidance that Oracle Select AI applies to requests that use the AI profile. You can use it for reusable context such as business definitions, date handling rules, formatting requirements, response constraints, or RAG grounding requirements.
When a request uses the profile, Oracle Select AI includes the configured role and instructions in the augmented prompt before sending it to the LLM. You do not need to repeat the same guidance in every chat, runsql, showsql, explainsql, or narrate request.
When used with AI agents, a SQL tool can use an NL2SQL profile that contains SQL-specific role and instruction guidance. A RAG tool can use a separate RAG profile that contains retrieval-specific role and instruction guidance. The agent itself should obtain its persona and responsibilities from the agent role parameter and its task instructions, while the agent profile can stay focused on the LLM configuration.
Example: Build airline operations experiences with purpose-built profiles
Suppose you want business analysts and operations teams to ask questions about flight performance, route revenue, passenger demand, and customer policies using natural language. A clean implementation uses separate profiles for separate jobs:
- An NL2SQL profile for flight operations metrics and route analytics that uses database table data.
- A RAG profile for customer service, operations, and policy documents.
- A minimal agent LLM profile for agent reasoning, with the agent role defined on the agent object, but if the AI profile is shared across agents, common details could be provided in the profile.
This gives each capability the right context.
Create the NL2SQL profile
Start with an NL2SQL profile for airline operations data. This profile includes database objects and SQL-specific business rules.
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'AIRLINE_NL2SQL_AI',
attributes => q'~
{
"provider": "oci",
"credential_name": "OCI_AI_CRED",
"model": "meta.llama-3.3-70b-instruct",
"object_list": [{"owner": "AIRLINE", "name": "FLIGHT_OPERATIONS"},
{"owner": "AIRLINE", "name": "BOOKINGS"},
{"owner": "AIRLINE","name": "ROUTE_REVENUE"}],
"role": "You are an Oracle airline analytics SQL assistant. You help analysts answer questions about flight operations, route performance, bookings, revenue, and passenger demand using the database objects available through this Oracle Select AI profile.",
"additional_instructions": "Use the current database date when interpreting relative dates such as today, yesterday, this week, last week, this month, and last month. Treat a delayed flight as a flight with arrival_delay_minutes greater than 15. Exclude cancelled flights unless the request explicitly asks about cancellations. For route analysis, group routes by origin_airport_code and destination_airport_code. When generating SQL, prefer clear column aliases that business analysts can understand. Keep answers focused on operational metrics available from the configured database objects."
}
~'
);
END;
After the profile is created, set it as the active profile for SQL-oriented questions:
EXEC DBMS_CLOUD_AI.SET_PROFILE('AIRLINE_NL2SQL_AI');
You can verify the configured role with a simple chat request:
SELECT AI CHAT 'who are you?'
Example response:
RESPONSE
------------------------------------------------------------
I am an Oracle airline analytics SQL assistant. I can help you
analyze flight operations, route performance, bookings, revenue,
and passenger demand using the database objects available through
this profile.
You can use these attributes with:
- DBMS_CLOUD_AI.CREATE_PROFILE – Set persistent attributes in your AI profile
- DBMS_CLOUD_AI.SET_ATTRIBUTE – Change attribute of an existing profile
- DBMS_CLOUD_AI.GENERATE – Dynamically override attribute values for an individual Oracle Select AI request
Use DBMS_CLOUD_AI.GENERATE when you need a dynamic, call-level override. This is especially useful for application development because one base profile can remain stable while an individual request supplies temporary role or instruction guidance for a specific scenario.
Use the NL2SQL profile for SQL actions
Now ask a business question without repeating the delay, date, cancellation, or route grouping rules:
SELECT AI RUNSQL What were the top 5 delayed routes last week?
Because the NL2SQL profile already contains the reusable SQL instructions, Oracle Select AI has the context it needs to interpret “delayed,” “route,” and “last week” consistently. The generated SQL can use the current database date for the relative date range, exclude cancelled flights, apply the standard delay definition, and group the results by origin and destination airport code.
A result might look like this:
ORIGIN_AIRPORT_CODE DESTINATION_AIRPORT_CODE DELAYED_FLIGHTS
------------------- ------------------------ ---------------
SFO LAX 128
JFK MIA 117
ORD DFW 103
SEA DEN 96
ATL BOS 91
You can also inspect how Oracle Select AI explains the query:
SELECT AI EXPLAINSQL What were the top 5 delayed routes last week?
That explanation can reflect the NL2SQL profile guidance, including the rule that a delayed flight means arrival_delay_minutes > 15 and that routes are grouped by origin and destination airport code.
Override role and instructions for a single GENERATE call
Persistent profile attributes are best for guidance that should apply to every request using the profile. Sometimes an application needs to adjust assistant behavior for one request without changing the saved AI profile. The attributes parameter of DBMS_CLOUD_AI.GENERATE provides that call-level override.
In the following example, the application uses the AIRLINE_NL2SQL_AI profile for its provider, model, credential, and object list, but overrides the role and additional_instructions attributes for a single executive-reporting request:
SELECT DBMS_CLOUD_AI.GENERATE(
prompt => 'What were the top 5 delayed routes last week?',
profile_name => 'AIRLINE_NL2SQL_AI',
action => 'runsql',
attributes => q'~
{
"role": "You are an Oracle airline executive reporting SQL assistant. Prioritize concise operational summaries for airline executives.",
"additional_instructions": "For this request, treat last week as the previous Monday through Sunday based on the current database date. Return only the top 5 routes. Include delayed flight counts and average delay minutes. Use the profile’s delayed-flight definition. Keep column aliases short and executive-friendly."
}
~'
) AS response
FROM dual;
This invocation does not modify AIRLINE_NL2SQL_AI. It temporarily changes how Oracle Select AI frames and constrains the current request, then the profile returns to its normal behavior for the next call.
This approach is useful when an application needs scenario-specific behavior, per-session personalization, user-selected response styles, experimentation with prompt guidance, or temporary constraints without creating another permanent profile or changing a shared profile used by other people and applications.
Create a RAG profile
A RAG profile is configured for retrieval augmented generation to produce grounded responses. In this example, the RAG profile points to a vector index over approved airline policy, operations, and customer service documents.
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'AIRLINE_POLICY_RAG_AI',
attributes => q'~
{
"provider": "oci",
"credential_name": "OCI_AI_CRED",
"model": "meta.llama-3.3-70b-instruct",
"vector_index_name": "AIRLINE_POLICY_INDEX",
"oci_compartment_id": "ocid1.compartment.oc1..example",
"max_tokens": 3000,
"role": "You are an Oracle airline policy retrieval assistant. You help operations and support teams answer questions using retrieved airline policy, operations, and customer service content.",
"additional_instructions": "Answer using retrieved content from approved airline policy, operations, and customer service documents. Do not invent policy details that are not present in the retrieved content. Distinguish domestic and international policy when the retrieved content makes that distinction. Keep responses concise and suitable for operations or customer support teams. Include source references when available."
}
~'
);
END;
Then create the vector index used by the RAG profile:
BEGIN
DBMS_CLOUD_AI.CREATE_VECTOR_INDEX(
index_name => 'AIRLINE_POLICY_INDEX',
attributes => q'~
{
"vector_db_provider": "oracle",
"location": "https://objectstorage.example.com/n/namespace/b/bucket/o/airline_policy_docs/",
"object_storage_credential_name": "OCI_OBJECT_STORE_CRED",
"profile_name": "AIRLINE_POLICY_RAG_AI",
"chunk_overlap": 128,
"chunk_size": 1024
}
~'
);
END;
Use the RAG profile for grounded answers
Set the RAG profile for retrieval-grounded answers from your approved content:
EXEC DBMS_CLOUD_AI.SET_PROFILE('AIRLINE_POLICY_RAG_AI');
Now a support analyst can ask a policy question without repeating common instructions:
SELECT AI NARRATE Summarize the customer service policy for passengers affected by delayed flights.
Because the RAG profile includes retrieval-specific instructions, a response might look like this:
Passengers affected by delayed flights may be eligible for service
recovery options based on delay duration, route type, ticket class,
and applicable regional policy. The applicable customer service
policy distinguishes between operational delays, weather-related
delays, and delays caused by air traffic restrictions.
Sources:
- Customer Service Policy: Delayed Flight Handling
- Operations Playbook: Delay Classification
The analyst did not need to say “distinguish domestic and international policy when the retrieved content makes that distinction” or “keep responses concise and suitable for operations or customer support teams.”
Use profiles with agent teams
Agent teams introduce another layer. In the Oracle Select AI Agent Framework, an agent has its own role parameter. That is the place to define the agent-specific persona and the job it performs. However, keep agent persona and orchestration guidance in the agent role and task instructions. Use AI profile ‘role’ and ‘additional_instructions’ for the profile-specific behavior behind each tool, or for shared LLM-level guidance that applies across agents.
A typical airline operations agent team might use:
- AIRLINE_AGENT_LLM as the minimal LLM profile for agent reasoning.
- AIRLINE_NL2SQL_AI as the profile behind the SQL tool.
- AIRLINE_POLICY_RAG_AI as the profile behind the RAG tool.
- An agent role that describes the agent as an airline operations coordinator.
Create the minimal agent LLM profile
The agent LLM profile below does not carry the full airline operations role. That role belongs to the agent object. This keeps the profile reusable for agent reasoning while avoiding conflicts with agent-specific role instructions.
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'AIRLINE_AGENT_LLM',
attributes => q'~
{
"provider": "oci",
"credential_name": "OCI_AI_CRED",
"model": "meta.llama-3.3-70b-instruct",
"temperature": 0.2
}
~'
);
END;
Create SQL and RAG tools with separate profiles
The SQL tool uses the NL2SQL profile. The RAG tool uses the RAG profile. The tools do not share one profile.
BEGIN
DBMS_CLOUD_AI_AGENT.CREATE_TOOL(
tool_name => 'AIRLINE_SQL_TOOL',
attributes => '{
"tool_type": "SQL",
"tool_params": {"profile_name": "AIRLINE_NL2SQL_AI"}
}'
);
END;
BEGIN
DBMS_CLOUD_AI_AGENT.CREATE_TOOL(
tool_name => 'AIRLINE_RAG_TOOL',
attributes => '{
"tool_type": "RAG",
"tool_params": {"profile_name": "AIRLINE_POLICY_RAG_AI"}
}'
);
END;
Create the agent, task, and team
Now define the agent role on the agent object and define orchestration guidance in the task. This is where the agent-specific behavior belongs.
BEGIN
DBMS_CLOUD_AI_AGENT.CREATE_AGENT(
agent_name => 'AIRLINE_OPS_AGENT',
attributes => q'~
{
"profile_name": "AIRLINE_AGENT_LLM",
"role": "You are an airline operations coordinator. Use the available tools to answer operational questions, combine metrics and policy context when needed, and explain assumptions clearly."
}
~'
);
END;
BEGIN
DBMS_CLOUD_AI_AGENT.CREATE_TASK(
task_name => 'INVESTIGATE_DELAY_TASK',
attributes => q'~
{
"instruction": "Investigate the user's airline operations question: {query}. Use AIRLINE_SQL_TOOL for flight performance metrics and AIRLINE_RAG_TOOL for policy or operations-document context. Keep the final response concise and call out any SQL metric definitions or policy sources used.",
"tools": ["AIRLINE_SQL_TOOL", "AIRLINE_RAG_TOOL"],
"enable_human_tool": "true"
}
~'
);
END;
BEGIN
DBMS_CLOUD_AI_AGENT.CREATE_TEAM(
team_name => 'AIRLINE_OPS_TEAM',
attributes => '{
"agents": [
{"name": "AIRLINE_OPS_AGENT", "task": "INVESTIGATE_DELAY_TASK"}
],
"process": "sequential"
}'
);
END;
Then set and run the team:
EXEC DBMS_CLOUD_AI_AGENT.SET_TEAM('AIRLINE_OPS_TEAM');
SELECT AI AGENT Investigate why delayed flights increased last week and summarize the likely causes.
In this pattern, the agent can use the SQL tool for performance metrics and the RAG tool for policy or operational context. Each tool gets the right profile-level instructions for its job. The agent role and task instruction coordinate the workflow without requiring one profile to serve as both the NL2SQL profile and the RAG profile.
A cleaner experience for analysts, developers, and agents
Purpose-built profiles create a cleaner experience because each profile carries the right kind of durable context.
An analyst working with airline operations data can use the NL2SQL profile for SQL-oriented requests:
EXEC DBMS_CLOUD_AI.SET_PROFILE('AIRLINE_NL2SQL_AI');
SELECT AI SHOWSQL Show monthly revenue by route for the current quarter.
SELECT AI RUNSQL Which routes had the highest load factor yesterday?
A support analyst working with policy content can use the RAG profile for retrieval-grounded answers:
EXEC DBMS_CLOUD_AI.SET_PROFILE('AIRLINE_POLICY_RAG_AI');
SELECT AI NARRATE What does our policy say about customer notifications for delayed flights?
An application or agent team can use the SQL and RAG profiles behind individual tools, while the agent profile and agent role drive the agentic workflow. This keeps the design modular and easier to govern.
For developers, this reduces prompt duplication across applications. You can define SQL-specific behavior in the NL2SQL profile, retrieval-specific behavior in the RAG profile, and agent-specific behavior in the agent role and task instructions.
For administrators, this gives you a more centralized way to guide behavior. Instead of relying on every application, analyst, or agent workflow to include the right prompt instructions, you can place durable guidance in the profile or agent layer where it belongs.
Good candidates for additional_instructions
The best additional_instructions are durable rules that should apply across many requests that use the same profile. The right instructions depend on the profile type.
For NL2SQL profiles, good candidates include:
- Date rules: “Use the current database date for relative date requests.”
- Business definitions: “A delayed flight means arrival delay greater than 15 minutes.”
- Metric rules: “Revenue means net ticket revenue excluding taxes and fees.”
- Filtering rules: “Exclude test accounts and inactive customers unless requested.”
- Formatting rules: “Use concise business-friendly column aliases.”
- Schema guidance: “Use route-level grouping by origin_airport_code and destination_airport_code.”
For RAG profiles, good candidates include:
- Grounding rules: “Base all answers on only retrieved approved content.”
- Policy constraints: “Do not invent policy details that are not present in retrieved content.”
- Response style: “Keep answers concise and suitable for customer support teams.”
For agent teams, put agent persona, task planning, and orchestration rules in the agent role and task instructions. Use the profile instructions behind each tool for the tool-specific behavior.
These instructions should be specific enough to guide the model, but not so broad that they conflict with normal usage. A good practice is to start with the rules your analysts and application teams already apply manually, then encode the most common and reusable ones in the appropriate profile or agent definition.
Good candidates for role
The role attribute works best when it describes the job of the specific profile. For an NL2SQL profile, that role should usually describe a SQL-oriented assistant. For a RAG profile, that role should usually describe a retrieval-grounded assistant. For an agent, use the role parameter on the agent object to describe the agent persona and responsibilities.
For an NL2SQL profile:
"role": "You are an Oracle finance reporting SQL assistant. You help analysts answer questions about revenue, expenses, margin, forecasts, and budget variance using approved finance reporting tables."
For a RAG profile:
"role": "You are an Oracle HR policy retrieval assistant. You help HR teams answer workforce policy questions using retrieved, approved HR policy content."
For an agent object:
"role": "You are a supply chain operations coordinator. Use available tools to investigate inventory, supplier, purchase order, fulfillment, and demand issues, then summarize findings and recommended next actions."
A strong role names the domain, describes the job, and anchors responses to the data, documents, tools, or workflow available to that profile or agent.
From prompt engineering to context engineering
The ‘role’ and ‘additional_instructions’ attributes move common prompt guidance into the AI profile, where it can be reused consistently. That is especially valuable when you are building governed AI experiences for teams, departments, applications, and agentic workflows. It’s worth nothing that these attributes are not a security boundary. They guide model behavior, but access control still comes from database privileges, object lists, profile configuration, and the surrounding application or agent design.
Profile engineering does not mean one profile for everything. It means defining the right context in the right place. Use an NL2SQL profile for SQL generation and SQL-related actions. Use a RAG profile for retrieval-grounded answers. Use a minimal LLM profile for agent reasoning and define the agent persona with the agent role parameter in the Oracle Select AI Agent Framework. Add shared guidance to the agent AI profile only when it applies consistently across the agents that use that profile.
You can also combine persistent profile guidance with call-level overrides. Store durable defaults in the profile, then use the DBMS_CLOUD_AI.GENERATE attributes parameter when an application needs a temporary role or additional_instructions override for one request.
Instead of treating every natural language request as a blank slate, you can specify common, persistent context before the request is processed. The result is a more predictable assistant experience, cleaner prompts, and stronger alignment with your business definitions.
Oracle Select AI already connects natural language to SQL, retrieval augmented generation, AI agents, and more across Oracle AI Database and Oracle Autonomous AI Database. With profile-level role and instruction attributes, you can make each experience more domain-aware from the start.
The next time you find yourself adding the same guidance to prompt after prompt, consider if it belongs in an Oracle Select AI profile. Your prompts get shorter. Your answers become more consistent. Your AI experience can be easier to scale.
Resources
For more information, see:
- Select AI Attributes documentation
- Select AI documentation
- DBMS_CLOUD_AI Package
