Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | # composio-openai-agents |
| 2 | |
| 3 | Adapts Composio tools to the [OpenAI Agents](https://github.com/openai/openai-agents-python) framework's native tool format, so your agents can take action across 1000+ apps. |
| 4 | |
| 5 | ## Installation |
| 6 | |
| 7 | ```bash |
| 8 | pip install composio composio-openai-agents openai-agents |
| 9 | ``` |
| 10 | |
| 11 | Set `COMPOSIO_API_KEY` (from the [dashboard](https://dashboard.composio.dev/settings)) and `OPENAI_API_KEY` in your environment. |
| 12 | |
| 13 | ## Quickstart |
| 14 | |
| 15 | ```python |
| 16 | from composio import Composio |
| 17 | from composio_openai_agents import OpenAIAgentsProvider |
| 18 | from agents import Agent, Runner |
| 19 | |
| 20 | composio = Composio(provider=OpenAIAgentsProvider()) |
| 21 | |
| 22 | # Each session is scoped to one of your users |
| 23 | session = composio.create(user_id="user_123") |
| 24 | tools = session.tools() |
| 25 | |
| 26 | agent = Agent( |
| 27 | name="Personal Assistant", |
| 28 | instructions="You are a helpful assistant. Use Composio tools to take action.", |
| 29 | tools=tools, |
| 30 | ) |
| 31 | |
| 32 | result = Runner.run_sync(starting_agent=agent, input="Summarize my emails from today") |
| 33 | print(result.final_output) |
| 34 | ``` |
| 35 | |
| 36 | By default a session gets meta tools that discover, authenticate, and execute app tools at runtime. For multi-turn use, store `session.session_id` and reuse it with `composio.use(session_id)` instead of calling `create()` again. |
| 37 | |
| 38 | ## Links |
| 39 | |
| 40 | - [Quickstart](https://docs.composio.dev/docs/quickstart) |
| 41 | - [Composio documentation](https://docs.composio.dev) |