AI / Core OpenAI Codex Application Fundamentals Interview Questions
What is the OpenAI Agents SDK and what are its four core primitives?
The OpenAI Agents SDK (launched March 2025, evolved from the experimental Swarm project) is an open-source, lightweight framework for building multi-step agentic workflows on top of the Responses API and other providers. It is available for Python (openai-agents) and TypeScript.
| Primitive | Purpose | Key behaviour |
|---|---|---|
| Agents | AI models equipped with instructions and tools | Execute tasks, call tools, produce outputs |
| Handoffs | Delegation mechanism between specialised agents | One agent passes control to another better suited for a sub-task |
| Guardrails | Input/output validation layer | Validate, filter, or block inputs/outputs before/after model calls |
| Tracing | Built-in observability for agent runs | Logs all steps, tool calls, and decisions for debugging and evals |
from agents import Agent, Runner # Define an agent coding_agent = Agent( name="CodingAgent", instructions="You are an expert Python developer. Write clean, tested code.", tools=[web_search_tool, code_interpreter_tool], model="gpt-5.5", ) # Run the agent import asyncio result = asyncio.run(Runner.run( coding_agent, "Write a Python function that parses JWT tokens and validates expiry.", )) print(result.final_output)
Provider agnostic: despite being OpenAI's SDK, it works with 100+ other LLMs via the Chat Completions API - including models from Anthropic, Mistral, and others via LiteLLM. This prevents vendor lock-in.
When to use Responses API vs Agents SDK: use the Responses API when a single model call with tools and your own application logic is sufficient. Use the Agents SDK when your application owns orchestration, tool execution, approvals, and state management across a multi-agent system.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
