# Move an agent from another framework

> Rebuilds an agent written with the OpenAI Agents SDK, LangGraph, CrewAI or your own code as a Mindset agent, kept as files in your repo.

Your coding agent reads the agent's code, maps each part to Mindset, and lists what won't come across before it builds anything. It then writes the agent as files in your repo and applies them, as [Keep your agents in your code](https://docs.mindset.ai/docs/keep-your-agents-in-your-code) describes. Mindset runs its own agent loop, so the agent is rebuilt on Mindset rather than run inside it.

## Ask your coding agent

```
Move our invoice exceptions agent, built with the OpenAI Agents SDK in services/invoices/, to Mindset. List everything that won't come across and wait for me, then keep it under agents/ and apply it to Sandbox.
```

Skill: [mindset-import-agent](https://docs.mindset.ai/skills/mindset-import-agent/SKILL.md)

## What maps to what

| In your code                                            | In Mindset                                                                                                                                                          |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| System prompt or instructions                           | The five [prompt fields](https://docs.mindset.ai/docs/build-an-agent), 2,000 characters each. A longer prompt is condensed, and your coding agent lists what it cut                        |
| The model                                               | The agent's model, from those your org has a provider key for                                                                                                       |
| A tool that calls an API                                | An HTTP API [connection](https://docs.mindset.ai/docs/connections-and-operations), with one operation per tool                                                                             |
| A tool that's an MCP server                             | An MCP server connection, each of its tools an operation                                                                                                            |
| A tool that computes, loops or reshapes data            | A [function](https://docs.mindset.ai/docs/functions)                                                                                                                                       |
| Handoffs and sub-agents                                 | Other agents on the lead agent's **Agents (A2A)** resources                                                                                                         |
| A graph with a fixed order, an interrupt or an approval | A [script](https://docs.mindset.ai/docs/scripts), for that stretch of the work only                                                                                                        |
| Retrieval over documents                                | A knowledge base connection, to a search server that speaks MCP. Mindset doesn't index documents itself, so a vector store inside your own process goes on the list |
| Guardrails                                              | Policy rules for tone and behavior. A rule that must hold every time becomes a script condition, a function, or an operation the agent doesn't hold                 |
| Evals                                                   | [Behavior tests](https://docs.mindset.ai/docs/test-before-it-goes-live) on the agent                                                                                                       |
| Tracing and logging                                     | Nothing to move. Mindset records every run                                                                                                                          |

## Where each framework keeps it

| Framework                       | What your coding agent reads                                                                                                                                                      |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OpenAI Agents SDK               | Each `Agent`'s `instructions`, `model`, `tools`, `handoffs` and guardrails                                                                                                        |
| LangGraph and LangChain         | The system prompt, the `@tool` functions, and the graph's nodes and edges. Each `interrupt()` marks a script                                                                      |
| Claude Agent SDK                | The system prompt, `CLAUDE.md`, skills, MCP servers and subagent definitions                                                                                                      |
| CrewAI                          | Each agent's `role`, `goal` and `backstory`. The role and goal become its purpose, and the backstory its background. Tasks and the crew's process show the handoffs and the order |
| Amazon Bedrock Agents           | The instruction, the action groups (their OpenAPI schema becomes the connection) and the knowledge bases                                                                          |
| Vercel AI SDK, or your own loop | The `system` text and the tools passed to the model call                                                                                                                          |

## What doesn't come across

- **Code inside a tool.** Logic that runs in your own process stays there, behind an API or a remote MCP server Mindset can call, unless a function can do the same job.
- **Local files and local MCP servers.** Mindset reaches systems only through connections, and only remote MCP servers can be connected.
- **An HTTP API that needs an OAuth sign-in.** It can't be connected yet. An MCP server with OAuth sign-in can.
- **Changes to the agent loop itself.** Behavior that depended on them becomes a script or a function, or goes on the list.
- **Past traces and memory.** They stay where they are. Mindset records from the first run.

## What you decide

- What to do about each item on the list of what won't come across, before anything is built.
- Which of the old agent's evals become behavior tests, so you can compare the two on the same questions.
- When the old agent stops. Run both side by side until the Mindset agent's tests pass.

**Skill for your coding agent:** [`mindset-import-agent/SKILL.md`](https://docs.mindset.ai/skills/mindset-import-agent/SKILL.md)

## Done when

- You've agreed the list of what didn't come across.
- The agent and its resources are files in your repo, applied to Sandbox.
- Its behavior tests pass on the questions the old agent's evals asked.
