OpenAI Agents SDK: Clearly BEATS CrewAI & LangGraph?

Mervin PraisonAbout 3 min readMar 25, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Responses API (replaces Chat Completions API)
  • Built-in Tools: Web Search, File Search, Computer Use
  • Agents SDK (replaces Swarm Agents)
  • Observability Tools
  • Vector Store (for File Search)
  • Agentic RAG (Retrieval Augmented Generation)

1. Responses API

  • Main Point: The Responses API is a new API from OpenAI that replaces the Chat Completions API.
  • Details:
    • It's designed to "superpower agentic behavior."
    • The core function is client.responses.create.
    • It takes parameters like model (model name) and messages (the question/prompt).
  • Example: The video demonstrates creating a simple chatbot using the Responses API.
    • Code snippet:
      response = client.responses.create(
          model="gpt-3.5-turbo",
          messages=[{"role": "user", "content": "Write a meal plan for a week"}]
      )
      print(response.choices[0].message.content)
      
  • UI Integration: The video shows how to integrate the Responses API with Gradio to create a simple chatbot UI with minimal code.
    • Gradio code snippet:
      import gradio as gr
      def respond(message, history):
          response = client.responses.create(
              model="gpt-3.5-turbo",
              messages=[{"role": "user", "content": message}]
          )
          return response.choices[0].message.content
      demo = gr.ChatInterface(respond)
      demo.launch()
      

2. Built-in Tools

  • Main Point: OpenAI provides built-in tools that can be used with the Responses API to enhance agent capabilities.
  • Types of Tools:
    • Web Search: Allows the agent to search the web for information.
      • Code: tools=[{"type": "web_search_preview"}]
      • Example: Asking the agent "Tell me about Mvin Praisen" uses web search to retrieve information.
    • File Search: Allows the agent to search files stored in a vector store.
      • Process:
        1. Create a vector store on platform.openai.com.
        2. Upload files to the vector store.
        3. Get the vector store ID.
        4. Use the file_search tool with the vector store ID.
      • Code: tools=[{"type": "file_search", "vector_store_id": "your_vector_store_id"}]
      • Example: Uploading a paper about Graph RAG and asking "Tell me about Graph RAG" uses file search to retrieve information from the paper.
    • Computer Use: Allows the agent to interact with a computer environment (e.g., a browser).
      • Code: tools=[{"type": "computer_use_preview", "width": 640, "height": 480, "environment": "browser"}]
      • Process:
        1. The agent generates a tool call with an ID, action, and other details.
        2. The data needs to be parsed.
        3. Playwright is used to execute the function.
        4. A screenshot is captured after execution.
        5. The process is repeated until the task is complete.
  • Agentic RAG: The file search example demonstrates agentic RAG, where the agent decomposes the query into multiple sub-queries to improve search results.
    • Example sub-queries: "graph rag", "what is graph rag", "graph rag details", "graph rag summary".

3. Agents SDK

  • Main Point: The Agents SDK is a new SDK from OpenAI that replaces Swarm Agents and provides a framework for building agents.
  • Details:
    • It's considered production-ready.
    • The video suggests it could surpass LangGraph and other agentic frameworks.
  • Code:
    from agents import agent, runner
    agent_name = "Assistant"
    agent_instructions = "Create a meal plan for a week"
    runner.run_sync(agent_name, agent_instructions)
    
  • Comparison to Praise Agents: The video notes that the Agents SDK follows a similar format to Praise Agents.

4. Observability Tools

  • Main Point: OpenAI provides observability tools to monitor agent activity.
  • Details:
    • Available on platform.openai.com under "Traces."
    • Allows you to see the workflow of agents, including inputs, outputs, and intermediate steps.
    • Provides clarity on what each agent is doing behind the scenes.
  • Example: The video shows traces for tasks like "create a meal plan for a week" and "triage agent with god rail responses handoff post salesforce."

5. Conclusion

  • The video highlights the new tools and features from OpenAI for building agents, including the Responses API, built-in tools, Agents SDK, and observability tools.
  • The Agents SDK is positioned as a potentially superior alternative to existing agentic frameworks like LangGraph.
  • The presenter expresses excitement about these new features and their potential impact on the development of AI agents.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.