Create a Model Agnostic Agent with Claude
This step-by-step guide walks you through creating a model agnostic agent that uses Claude, with the Code tool for running Python and the Knowledge tool for searching files that users upload.
Overview
A model agnostic agent uses the generic agent workflow with the FoundationaLLMFunctionCallingWorkflow class from the foundationallm_agent_plugins package. The workflow lets the main model decide which tools to call, so the same agent design works with Claude, GPT models, and other completion models.
The agent you build here has:
- Code: writes and runs Python code in an isolated code session.
- Knowledge: answers questions from files uploaded to the conversation.
- Tool routing: the main model selects tools based on the user's question.
Prerequisites
- A Claude completion AI model. For Amazon Bedrock, the model must use a Bedrock API endpoint; for the Anthropic Messages API (Anthropic or Azure AI Foundry), an Anthropic API endpoint. See AI Models.
- The
GenericAgentWorkflowworkflow and thefoundationallm_agent_pluginsPython plugin package installed in your instance. - The FoundationaLLM platform prompts and platform tools installed (they provide the
Platform-Agent-*prompts and the Code and Knowledge tools in the Tool Library). - A code session provider for the Code tool. The tool's default provider is
AzureContainerAppsCustomContainer. - The Agents Contributor role on the instance.
Part 1: Set Claude Model Parameters
Set Claude-specific parameters on the AI model so the workflow and every tool that uses the model receive the same values.
Important: Claude Sonnet 5 changed an important default: adaptive thinking is on by default, and its default effort is high. Anthropic also states that
max_tokensis a hard limit across thinking and visible response text. If thinking output is not configured to be displayed, those tokens may be invisible to your application.
For Claude on a Bedrock endpoint:
In the sidebar, select Agents > Models and open your Claude model.
Under "What are the model parameters?", add a property:
Property Key:
additional_model_request_fieldsProperty Type: Object / Array
Property Value:
{ "thinking": { "type": "adaptive" }, "output_config": { "effort": "high" } }
Add another property: Property Key
max_tokens, Property Type Number, Property Value16000(or higher athigh,xhigh, ormaxeffort).Make sure
temperature,top_p, andtop_kare not set. Non-default sampling values return 400 on Claude Sonnet 5.Select Save Changes.
Rules to keep in mind:
effortmust sit inoutput_config, not insidethinking.- Do not use
"type": "enabled"withbudget_tokens; it returns 400 on Sonnet 5. - A top-level
thinkingproperty is ignored. - On Bedrock, use
max_tokens;max_new_tokensis not applied.
For Claude on an Anthropic endpoint, max_new_tokens is sent as max_tokens. See Claude and Claude on Amazon Bedrock for the full parameter tables.
Part 2: Create the Agent and Select the Workflow
- In the sidebar, select Agents > Agents, then select Create Agent.
- Open the Workflow tab.
- Under "What workflow should the agent use?", select
GenericAgentWorkflow. - Set the workflow fields:
| Field | Value |
|---|---|
| Workflow name | MAA-Workflow (or keep the default Agent-Workflow) |
| Workflow package name | foundationallm_agent_plugins |
| Workflow class name | FoundationaLLMFunctionCallingWorkflow |
| Workflow host | LangChain |
Select the workflow before you set Max rounds on Basic Settings, because selecting a workflow on a new agent resets the workflow properties.
Part 3: Basic Settings
On the Basic Settings tab:
| Field | Value |
|---|---|
| Agent Display Name | A user-friendly name, for example Claude Analysis Agent |
| Agent name | A unique name, for example claude-maa-agent (wait for ✔️) |
| Description | The purpose of the agent |
| Main model | Your Claude model |
| Max rounds | Optional. For example 5 to allow several tool-calling rounds. Leave 0 for a single round. |
| Enable tool escalation | Optional |
| What is the main workflow prompt? | Your agent's system prompt |
Example main workflow prompt:
You are an analysis assistant that answers questions about the user's files and data.
Use the available tools when you need to read uploaded files or run calculations.
Provide concise, accurate answers.
When you select the Claude model, its parameters (including additional_model_request_fields and max_tokens) are copied into Workflow main model parameters on the Workflow tab. Review that list and remove any temperature, top_p, or top_k entries. Parameters there apply to the workflow model only.
Part 4: Add the Workflow Prompts
The FoundationaLLMFunctionCallingWorkflow class requires a router prompt. The files and final prompts are optional but recommended for this agent.
On the Workflow tab, add each resource under Additional workflow resources:
- Select the add icon.
- Set Resource Type to Prompt.
- Type at least three characters to search, then select the prompt.
- Enter the Resource Role.
- Select Save.
| Resource Role | Prompt |
|---|---|
router_prompt |
Platform-Agent-Workflow-Router-Multi-Round if Max rounds is above 0, otherwise Platform-Agent-Workflow-Router |
files_prompt |
Platform-Agent-Workflow-Files |
final_prompt |
Platform-Agent-Workflow-Final |
The platform router prompts list the agent's tools automatically, so tool names don't need to match the prompt text. To customize the instructions, create your own prompts with the Agent Workflow category under Agents > Prompts and select those instead.
Part 5: Allow File Uploads
On the Portal Experience tab, set Would you like to allow the user to upload files? to Yes.
Part 6: Add the Code Tool
- Open the Tools tab and select Add Tool.
- In the Tool Library, expand the FoundationaLLM family, select Select next to Code, and select Add to Agent.
- In the Edit Agent Tool: Code dialog:
| Section | Setting | Value |
|---|---|---|
| Basics | Name | Code (default) |
| Resource References | Main Model | Your Claude model |
| Resource References | Main Prompt | Platform-Agent-Tool-Code-Main (default) |
| Resource References | Router Prompt | Platform-Agent-Tool-Code-Router (default) |
| Settings | Code Session Required | true (default) |
| Settings | Code Session Language | Python (default) |
| Settings | Code Session Provider | AzureContainerAppsCustomContainer (default) |
- Do not change the Temperature field under Main Model for Claude Sonnet 5. It shows
0.2, but a value is stored only when you change it. - Select Save changes.
Part 7: Add the Knowledge Tool
- Select Add Tool again.
- In the FoundationaLLM family, select Select next to Knowledge, and select Add to Agent.
- In the Edit Agent Tool: Knowledge dialog:
| Section | Setting | Value |
|---|---|---|
| Basics | Name | Knowledge (default) |
| Resource References | Main Model | Your Claude model |
| Resource References | Main Prompt | Platform-Agent-Tool-Knowledge-Main (default) |
| Resource References | Router Prompt | Platform-Agent-Tool-Knowledge-Router (default) |
| Resource References | Rewrite Prompt | Platform-Agent-Tool-Knowledge-Rewrite (default, optional) |
| Resource References | File Upload Data Pipeline | DefaultFileUpload (default) |
| Resource References | Conversation Knowledge Unit | Conversations (default) |
| Resource References | Agent Private Store Knowledge Unit | AgentPrivateStores (default) |
| Resource References | Knowledge Source | Agents (default) |
- Keep the default Settings (for example Vector Store Provider =
conversation). As with the Code tool, leave Temperature unchanged for Claude Sonnet 5. - Select Save changes.
The Tools available to the agent table now lists Code and Knowledge. For more on the tool editor, see Tools.
Part 8: Create the Agent
- Select Create Agent at the top right.
- If a required field is missing, the editor switches to the tab with the problem.
- When the message "Agent "[name]" was successfully created!" appears, the portal returns to the Agents page.
Testing Your Agent
- Open the User Portal and select your new agent.
- Test file upload and knowledge search:
- Upload a document (PDF, Word, and so on).
- Ask questions about its content.
- Test the Code tool:
- Ask for a calculation or data analysis.
- Ask for a chart or a generated file.
Troubleshooting
"No router prompt found in workflow configuration"
Add a workflow resource with the router_prompt role (Part 4).
Tools are never selected
- Confirm both tools appear in Tools available to the agent.
- Confirm the router prompt is attached with the role
router_prompt. - If Max rounds is above 0, use
Platform-Agent-Workflow-Router-Multi-Round.
File upload is not available in the User Portal
- Set Would you like to allow the user to upload files? to Yes on the Portal Experience tab.
- Confirm the Knowledge tool's File Upload Data Pipeline reference points to an existing pipeline (
DefaultFileUploadby default).
Code execution fails
- Check the code session provider configuration for your instance.
- Confirm Code Session Provider in the Code tool's Settings matches an available provider.
Completions return 400
- Remove
temperature,top_p, andtop_kfrom the AI model and from Workflow main model parameters. - Use adaptive thinking (
"type": "adaptive") withoutput_config.effort; do not sendbudget_tokens. - Confirm the model uses the intended endpoint provider (Bedrock or Anthropic). See AI Models.
Replies are truncated or look empty
- Thinking tokens count toward
max_tokenseven when the thinking text is not returned. - Raise
max_tokensor lowereffort.
Related Topics
- AI Models — Claude Sonnet 5 thinking, effort, and
max_tokens - Create a Model Agnostic Agent with GPT-4o
- Create a New Agent
- Tools
- Managing Prompts
- Agents & Workflows Reference