> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decimal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch Frameworks

> Move an agent to another framework and keep its prompt, skills and history: what comes with it, what you rewrite, and how to check the new version still works.

Moving an agent to a new framework usually means copying its prompt into new code, rewiring how it gets its skills, and losing the history you'd compare the new version against. With DecimalAI, the prompt, the skills and the history belong to the agent's name, not to your framework code, so the new framework reads the same ones on its first run.

What you still rewrite is the code that belongs to the framework: your tools, the model setup, and how the agent is run.

## What moves and what you rewrite

| Part of the agent | Where it lives | When you switch |
| - | - | - |
| **Prompt** | The agent's [Prompt page](https://docs.decimal.ai/guides/agent-setup-versions.md#the-prompt-page), as numbered versions | Moves. The new framework's `agent_config()` reads the same saved prompt |
| **Skills** | The agent's [skill list](https://docs.decimal.ai/guides/agent-setup-versions.md#the-skill-list), on its Overview, or `.agents/skills/` in your repo | Moves. The same skills reach the model in the new framework |
| **History** | Traces, config versions, evaluators and datasets, all [joined on the agent's name](https://docs.decimal.ai/guides/agents.md#what-an-agent-is) | Stays, as long as the new code passes the same name |
| **Your tools** | Your code, in the framework's own tool type | Rewrite the wrapper. The function inside it usually carries over unchanged |
| **The model and its settings** | Your code | Set them again in the new framework |
| **Conversation memory, handoffs, guardrails** | Your code and the framework | Rewrite them, as you would without DecimalAI |

Two frameworks are exceptions. CrewAI builds its prompt from the `role`, `goal` and `backstory` in your code, so a saved prompt reaches it only if you [read it yourself](https://docs.decimal.ai/sdk/python/frameworks/crewai.md#change-the-prompt-without-redeploying). LlamaIndex and AutoGen are traced only: DecimalAI can't hand either one a prompt or skills.

## Before you switch

**1. Put the prompt on DecimalAI**

A prompt that still lives in your code won't come with you. Open the agent's **Prompt** page, paste the prompt your code uses today, choose **Save draft**, then **Review & apply**. From then on, the `fallback=` in your code is only a backstop for when DecimalAI can't be reached.

**2. Keep the agent's name**

The new code passes the same name to `agent_config()`. That name is what keeps the history together. If the name describes the old framework, such as `langchain-react-bot`, [rename the agent](https://docs.decimal.ai/guides/agents.md#renaming-an-agent-without-losing-history) before you switch, not after.

**3. Record a baseline**

Score the old version now, so you have numbers to compare against. Attach [server evaluators](https://docs.decimal.ai/guides/evaluations.md#auto-scoring) to the agent: they score every trace it sends, whichever framework sent it. If the old version runs on OpenAI Agents or the Claude Agent SDK, also run [`decimalai.evaluate()`](https://docs.decimal.ai/sdk/python/evaluations#decimalai-evaluate) on a set of cases and keep the report.

**4. Check how your skills reach the model**

`agent_config()` delivers each skill's text, its `SKILL.md`. Files a skill bundles, such as `references/` and `scripts/`, reach the model only through a framework's [own skill loader](https://docs.decimal.ai/guides/native-skill-loaders.md), which reads them from `.agents/skills/`. If your skills depend on their files, pick a framework with a loader, and check that it can run scripts: [the eight loaders](https://docs.decimal.ai/guides/native-skill-loaders.md#the-eight-loaders) lists what each one runs them with.

## Change the code

With `agent_config()`, the switch changes the import, where the prompt and the `load_skill` tool go, and your tools. The agent's name, its prompt and its skills stay as they are. Here is the same agent on LangChain and on OpenAI Agents:

> [tab] Before: LangChain
>
> ```python theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
> from langchain.agents import create_agent
> from decimalai.langchain import agent_config
>
> support = agent_config(
>     "my-agent", fallback="You are a helpful assistant."
> )
> agent = create_agent(
>     "openai:gpt-5.4-mini", tools=[], middleware=[support.middleware]
> )
>
> question = (
>     "What command connects the browser CLI tool "
>     "to a browser already running on http://localhost:9222?"
> )
> result = agent.invoke(
>     {"messages": [{"role": "user", "content": question}]}
> )
> print(result["messages"][-1].text)
> ```

> [tab] After: OpenAI Agents
>
> ```python theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
> from agents import Agent, Runner
> from decimalai.openai_agents import agent_config
>
> support = agent_config(
>     "my-agent", fallback="You are a helpful assistant."
> )
> agent = Agent(
>     name=support.name,
>     instructions=support.instructions,
>     tools=[*support.tools],
> )
>
> question = (
>     "What command connects the browser CLI tool "
>     "to a browser already running on http://localhost:9222?"
> )
> print(Runner.run_sync(agent, question).final_output)
> ```

Where each framework takes the prompt and `load_skill`, and where to read how it takes your own tools:

| Framework | The prompt and `load_skill` | Your own tools |
| - | - | - |
| LangChain | `create_agent(..., middleware=[support.middleware])` | [LangChain](https://docs.decimal.ai/sdk/python/frameworks/langchain.md#your-own-tools) |
| OpenAI Agents | `Agent(instructions=support.instructions, tools=[*support.tools])` | [OpenAI Agents](https://docs.decimal.ai/sdk/python/frameworks/openai-agents.md#your-own-tools) |
| Claude Agent SDK | `support.run(question)`, then `run.query(options=...)` | [Claude Agent SDK](https://docs.decimal.ai/sdk/python/frameworks/claude-agent-sdk.md#your-own-tools), through an MCP server of your own |
| Pydantic AI | `Agent(..., capabilities=[support])` | [Pydantic AI](https://docs.decimal.ai/sdk/python/frameworks/pydantic-ai.md#your-own-tools) |
| Google ADK | `LlmAgent(instruction=support.instruction, tools=[*support.tools])` | [Google ADK](https://docs.decimal.ai/sdk/python/frameworks/adk.md#your-own-tools) |
| CrewAI | No `agent_config()`. Its own loader reads your skills: `Agent(skills=decimalai.crewai.skills(), ...)` | [CrewAI](https://docs.decimal.ai/sdk/python/frameworks/crewai.md#your-own-tools) |
| OpenAI SDK | `support.run(question)`, then `run.system` and `run.tools` in your own calls | [OpenAI SDK](https://docs.decimal.ai/sdk/python/frameworks/openai.md#your-own-tools) |
| Anthropic API | The same as the OpenAI SDK | [Anthropic API](https://docs.decimal.ai/sdk/python/frameworks/anthropic.md#your-own-tools) |
| Gemini API | The same as the OpenAI SDK | [Gemini API](https://docs.decimal.ai/sdk/python/frameworks/google-genai.md#your-own-tools) |

Each framework's page has the whole program, its install line, and how it continues a conversation.

> [!NOTE]
>
> Give each agent its skills one way. If the new framework has its own skill loader, point the loader at your skills or use `agent_config()`, not both: [doing both](https://docs.decimal.ai/sdk/python/frameworks/how-skills-reach-the-model.md#deliver-a-skill-one-way) puts each skill in front of the model twice.

### Skills as files: change one line

If your skills are files in `.agents/skills/`, read by a framework's own loader, the folder stays as it is. Only the line that points the loader at it changes: [Setup at a glance](https://docs.decimal.ai/guides/native-skill-loaders.md#setup-at-a-glance) has that line for each of the eight loaders. Claude Code, Cursor and other coding tools read the same folder, so the skills you try while you build are the ones your agent loads.

## Check that nothing broke

* **Skills still load.** Open a few of the new version's runs. Each run's **Recorded skills** shows which skills were offered, delivered and loaded ([what a run shows](https://docs.decimal.ai/guides/tracing.md#what-a-run-shows-about-skills)). A skill that loaded before and never loads now usually means the prompt or the `load_skill` tool didn't reach the model.
* **Scores held.** Compare your server evaluators' results on the agent's **Evals** tab from before and after the switch. If the new version runs on OpenAI Agents or the Claude Agent SDK, run `evaluate()` on the same cases and compare the two reports with `compare()`.
* **No tool went missing.** When the switch changes the tools, model or prompt that the new integration records, **More → Code changes** gets a new version that names what changed ([what happens then](https://docs.decimal.ai/guides/manifests.md#what-happens-when-a-manifest-changes)). A tool you forgot to port shows up as a change to the tool list. Some integrations record only the tools a run called, so treat it as a hint, not a full inventory: [what each one records](https://docs.decimal.ai/guides/manifests.md#how-auto-detection-works).

## Related

* [Use skills in your framework](https://docs.decimal.ai/sdk/python/frameworks.md): which way of adding a skill works on which framework
* [Native skill loaders](https://docs.decimal.ai/guides/native-skill-loaders.md): skills as files, for the eight frameworks that load them
* [Trust & Exit](https://docs.decimal.ai/guides/trust-and-exit.md): what you keep if you leave DecimalAI itself


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.