<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asad Hussain</title>
    <description>The latest articles on DEV Community by Asad Hussain (@snackoverflowwithasad).</description>
    <link>https://dev.to/snackoverflowwithasad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3603424%2F4e94f0b8-67c6-49eb-84a6-c449539dae71.jpg</url>
      <title>DEV Community: Asad Hussain</title>
      <link>https://dev.to/snackoverflowwithasad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/snackoverflowwithasad"/>
    <language>en</language>
    <item>
      <title>Introduction to OpenAI Agent SDK</title>
      <dc:creator>Asad Hussain</dc:creator>
      <pubDate>Sun, 26 Apr 2026 16:19:47 +0000</pubDate>
      <link>https://dev.to/snackoverflowwithasad/introduction-to-openai-agent-sdk-56ja</link>
      <guid>https://dev.to/snackoverflowwithasad/introduction-to-openai-agent-sdk-56ja</guid>
      <description>&lt;h2&gt;
  
  
  What is an AI Agent?
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;AI Agent&lt;/strong&gt; is a system that can think, decide, and perform actions on behalf of a user.&lt;/p&gt;

&lt;p&gt;Unlike a normal chatbot that only responds with text, an AI agent can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand a user’s request&lt;/li&gt;
&lt;li&gt;Decide what action is needed&lt;/li&gt;
&lt;li&gt;Use external tools (like APIs, databases, or functions)&lt;/li&gt;
&lt;li&gt;Return useful, real-world results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A chatbot talks.&lt;br&gt;
An AI Agent works.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A chatbot may tell you how to check GitHub followers&lt;/li&gt;
&lt;li&gt;An AI Agent can actually fetch the follower count for you automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes AI agents far more powerful for real applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the OpenAI Agent SDK?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;OpenAI Agent SDK&lt;/strong&gt; helps developers build AI agents easily using JavaScript or TypeScript.&lt;/p&gt;

&lt;p&gt;Instead of manually handling prompts, tool calling, and decision-making, the SDK provides a clean structure to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create agents&lt;/li&gt;
&lt;li&gt;Define tools&lt;/li&gt;
&lt;li&gt;Let agents use those tools automatically&lt;/li&gt;
&lt;li&gt;Run user queries through the agent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes development faster, cleaner, and easier to scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Does an AI Agent Work?
&lt;/h2&gt;

&lt;p&gt;The flow usually looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Query → Agent → Tool Selection → Tool Execution → Final Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example Flow
&lt;/h3&gt;

&lt;p&gt;Suppose the user says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey agent, my GitHub ID is Asad-bot07
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand that GitHub information is needed&lt;/li&gt;
&lt;li&gt;Decide to use a GitHub tool&lt;/li&gt;
&lt;li&gt;Call the GitHub API&lt;/li&gt;
&lt;li&gt;Fetch the follower count&lt;/li&gt;
&lt;li&gt;Return the final answer to the user&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is exactly what your project does.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Are Tools?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Tool&lt;/strong&gt; is a function the agent can use to perform actions.&lt;/p&gt;

&lt;p&gt;Tools help agents interact with the outside world.&lt;/p&gt;

&lt;p&gt;Examples of tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch weather data&lt;/li&gt;
&lt;li&gt;Search GitHub profiles&lt;/li&gt;
&lt;li&gt;Send emails&lt;/li&gt;
&lt;li&gt;Read databases&lt;/li&gt;
&lt;li&gt;Process payments&lt;/li&gt;
&lt;li&gt;Generate reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without tools, agents are limited to conversation.&lt;/p&gt;

&lt;p&gt;With tools, agents become useful assistants.&lt;/p&gt;




&lt;h2&gt;
  
  
  Project Example: GitHub Stats Agent
&lt;/h2&gt;

&lt;p&gt;In this example, we are building a simple AI agent that checks a GitHub user’s follower count.&lt;/p&gt;

&lt;p&gt;The user provides a GitHub username, and the agent automatically fetches the follower count using the GitHub API.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Before building your first AI agent using the OpenAI Agent SDK, you need to install the required packages and set up your environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Create a New Node.js Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;openai-agent-sdk
&lt;span class="nb"&gt;cd &lt;/span&gt;openai-agent-sdk
npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a fresh Node.js project with a default &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Install Required Dependencies
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @openai/agents axios zod dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What each package does:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@openai/agents&lt;/code&gt; → Used to create AI agents and tools&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;axios&lt;/code&gt; → Used for making API requests&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zod&lt;/code&gt; → Used for validating tool parameters&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dotenv&lt;/code&gt; → Used for securely loading environment variables&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 3: Create a &lt;code&gt;.env&lt;/code&gt; File
&lt;/h2&gt;

&lt;p&gt;Create a file named:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add your OpenAI API key inside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPENAI_API_KEY=your_openai_api_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps keep your API key secure and prevents exposing sensitive information directly in your code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Basic Project Structure
&lt;/h2&gt;

&lt;p&gt;Your project should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openai-agent-sdk/
│
├── node_modules/
├── .env
├── package.json
├── package-lock.json
└── index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your main agent code will be written inside &lt;code&gt;index.js&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code Breakdown
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Step 1: Import Required Packages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;tool&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@openai/agents&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;zod&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv/config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What these packages do:
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@openai/agents&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Used for creating agents and tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;axios&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Used to make API requests. Here, we use it to call the GitHub API.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;zod&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Used for validating tool parameters. It ensures the tool receives the correct input.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;dotenv&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Used for loading environment variables securely.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Creating a Tool
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getGitStats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;get git stats&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;returns the git following of the user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we define a tool called:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get git stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tool is responsible for fetching GitHub follower data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Defining Tool Parameters
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name of the user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The tool requires a &lt;code&gt;userName&lt;/code&gt; as input.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since we use Zod, the input is validated automatically. This prevents invalid tool usage.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Tool Execution Logic
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`https://api.github.com/users/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`The followers of &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; is : &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;followers&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where the actual work happens.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens here:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;A GitHub API URL is created&lt;/li&gt;
&lt;li&gt;Axios sends a request&lt;/li&gt;
&lt;li&gt;GitHub returns user data&lt;/li&gt;
&lt;li&gt;We extract the &lt;code&gt;followers&lt;/code&gt; value&lt;/li&gt;
&lt;li&gt;The tool returns the final response&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The followers of Asad-bot07 is : 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 5: Creating the Agent
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getGitAgent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;get git stats agent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;instructions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Youre an agent who takes the github username of an user and returns the git stats of the username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;getGitStats&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we create the actual AI agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  This agent knows:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Its role&lt;/li&gt;
&lt;li&gt;Its responsibility&lt;/li&gt;
&lt;li&gt;Which tools it can use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;tools&lt;/code&gt; array connects the tool to the agent. This means the agent can now use &lt;code&gt;getGitStats()&lt;/code&gt; automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Running the Agent
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hey agent, my github id is Asad-bot07&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getGitAgent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finalOutput&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sends the user query to the agent.&lt;/p&gt;

&lt;p&gt;The SDK handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding the request&lt;/li&gt;
&lt;li&gt;choosing the correct tool&lt;/li&gt;
&lt;li&gt;executing the tool&lt;/li&gt;
&lt;li&gt;generating the final answer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finalOutput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;prints the response.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Output
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Run Your Project
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will execute your AI agent and display the output in the terminal.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The followers of Asad-bot07 is : 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple, clean, and powerful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Use OpenAI Agent SDK?
&lt;/h2&gt;

&lt;p&gt;Because it helps you build real AI applications faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner code&lt;/li&gt;
&lt;li&gt;Automatic tool calling&lt;/li&gt;
&lt;li&gt;Better architecture&lt;/li&gt;
&lt;li&gt;Scalable projects&lt;/li&gt;
&lt;li&gt;Real-world integrations&lt;/li&gt;
&lt;li&gt;Production-ready systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of writing complex logic manually, the SDK handles most of it for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Use Cases
&lt;/h2&gt;

&lt;p&gt;You can build agents for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer support&lt;/li&gt;
&lt;li&gt;GitHub assistants&lt;/li&gt;
&lt;li&gt;Personal productivity apps&lt;/li&gt;
&lt;li&gt;Research assistants&lt;/li&gt;
&lt;li&gt;AI coding assistants&lt;/li&gt;
&lt;li&gt;Business automation&lt;/li&gt;
&lt;li&gt;Finance tracking&lt;/li&gt;
&lt;li&gt;CRM systems&lt;/li&gt;
&lt;li&gt;SaaS products&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is just the beginning.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;AI Agents are the future of software. They are not just chatbots—they are systems that can think, decide, and act. With the OpenAI Agent SDK, building these agents becomes much easier. In this project, we created a GitHub Stats Agent that fetches follower counts using tools and API calls. This is a simple example, but the same concept can be scaled into powerful production systems. Once you understand Agents + Tools + Execution Flow, you can build almost anything. And that is where the real power begins.&lt;/p&gt;




&lt;h2&gt;
  
  
  Next Step
&lt;/h2&gt;

&lt;p&gt;Try extending this project by adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository count&lt;/li&gt;
&lt;li&gt;Following count&lt;/li&gt;
&lt;li&gt;Public gists&lt;/li&gt;
&lt;li&gt;Starred repositories&lt;/li&gt;
&lt;li&gt;Latest commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will help you understand how powerful agent-based development can become.&lt;/p&gt;




&lt;h2&gt;
  
  
  Source Code
&lt;/h2&gt;

&lt;p&gt;You can find the complete source code for this project in the GitHub repository below:&lt;/p&gt;

&lt;h5&gt;
  
  
  🔗 &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/snackoverflowasad/Git-Agent" rel="noopener noreferrer"&gt;https://github.com/snackoverflowasad/Git-Agent&lt;/a&gt;
&lt;/h5&gt;




</description>
      <category>ai</category>
      <category>agents</category>
      <category>openai</category>
      <category>github</category>
    </item>
    <item>
      <title>GitHub new space shooter README — Step-by-Step Guide</title>
      <dc:creator>Asad Hussain</dc:creator>
      <pubDate>Mon, 02 Feb 2026 12:03:32 +0000</pubDate>
      <link>https://dev.to/snackoverflowwithasad/github-new-space-shooter-readme-step-by-step-guide-2m9b</link>
      <guid>https://dev.to/snackoverflowwithasad/github-new-space-shooter-readme-step-by-step-guide-2m9b</guid>
      <description>&lt;h4&gt;
  
  
  Hey folks!! In this post, I’ll show how I set up a GitHub Actions workflow that generates and updates a Space Shooter GIF no manual work required. The workflow runs on a schedule (daily) and can also be triggered manually, automatically committing the updated GIF back to the repository.
&lt;/h4&gt;




&lt;h3&gt;
  
  
  Setup Instructions (Step-by-Step)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  STEP 1:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Create a Repository On GitHub (For those who don't have a README.md → New Repository → Name it (Same as your username) → Make it PUBLIC → Create it. Inside it, create
README.md&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  STEP 2:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Create a folder named .github ( as shown above in the file structure ).&lt;/li&gt;
&lt;li&gt;Inside it create another folder named workflows.&lt;/li&gt;
&lt;li&gt;Inside it create a file name space-shooter.yml.&lt;/li&gt;
&lt;li&gt;Follow the project structure given below :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/
└── workflows/space-shooter.yml
assets/
└── space-shooter.gif // will be created automatically
README.md // your original readme.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Paste the code inside the space-shooter.yml file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Update Space Shooter GIF&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create assets directory&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mkdir -p assets&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;czl9707/gh-space-shooter@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;github-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
          &lt;span class="na"&gt;output-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;assets/space-shooter.gif&lt;/span&gt;
          &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;random&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Save the file, commit the changes and push it to the main branch (recommended)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step 4:
&lt;/h4&gt;

&lt;h5&gt;
  
  
  RUN the workflow
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Open the repo -&amp;gt; click on the action tab -&amp;gt; select update space shooter GIF (On the left sidebar) -&amp;gt; click run workflow (On the right side)&lt;/li&gt;
&lt;li&gt;Wait for it to complete.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step 5:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Once the workflow is completed, paste this code in your READM.md file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"assets/space-shooter.gif"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Contact
&lt;/h2&gt;

&lt;p&gt;I am open to discussing opportunities and collaborations. Connect with me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email:&lt;/strong&gt; &lt;a href="mailto:techie.asad.dev@gmail.com"&gt;techie.asad.dev@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Asad-bot07" rel="noopener noreferrer"&gt;@asad-bot07&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/asad-hussain-765502319/" rel="noopener noreferrer"&gt;Asad Hussain&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Portfolio Link
&lt;/h2&gt;

&lt;p&gt;Explore my work and professional journey: &lt;a href="https://asadtechdev.vercel.app/" rel="noopener noreferrer"&gt;https://asadtechdev.vercel.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>tutorial</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Why NumPy and Pandas Are Essential: A Beginner’s Realization in AI/ML</title>
      <dc:creator>Asad Hussain</dc:creator>
      <pubDate>Wed, 10 Dec 2025 19:49:40 +0000</pubDate>
      <link>https://dev.to/snackoverflowwithasad/why-numpy-and-pandas-are-essential-a-beginners-realization-in-aiml-959</link>
      <guid>https://dev.to/snackoverflowwithasad/why-numpy-and-pandas-are-essential-a-beginners-realization-in-aiml-959</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hello everyone&lt;/strong&gt;, I am back after a very long time. I was busy with my end-semester exams, which went pretty good. You guys know how college exams go. Anyway, this fall I finally started learning about AI and ML since it has become an important part of computer science today.&lt;/p&gt;

&lt;p&gt;For a long time, I wondered why AI and ML require &lt;strong&gt;NumPy&lt;/strong&gt; and &lt;strong&gt;Pandas&lt;/strong&gt;. I knew a little about NumPy from our curriculum, mostly the basics like converting data into arrays and performing simple operations. But once I actually started learning AI and ML, I understood the real power behind these libraries.&lt;/p&gt;

&lt;p&gt;NumPy is way more than just 1D or 2D arrays. It gives precise control over big data sets and makes complex mathematical tasks easier. Features like &lt;strong&gt;random seeding, broadcasting, reshaping, vectorization,&lt;/strong&gt; and &lt;strong&gt;efficient matrix operations&lt;/strong&gt; changed my perspective completely. Coming from a Java background, starting with C in my first semester, operations like matrix multiplication or elementwise tasks always seemed difficult to operate. These are as simple as working with basic variables. The difference in speed is also huge because NumPy is optimized for numerical computation.&lt;/p&gt;

&lt;p&gt;Then I started looking at Pandas. I had never worked with Pandas, and I always thought it was just like NumPy. Sure enough, when I started using it, I found out how powerful this library truly is when working with structured data. Reading files of types &lt;strong&gt;CSV, Excel, JSON, or even SQL outputs&lt;/strong&gt; can easily be done. Functions like &lt;strong&gt;head(), tail(), iloc,&lt;/strong&gt; and &lt;strong&gt;loc&lt;/strong&gt; make filtering or selecting data very intuitive. The &lt;strong&gt;describe()&lt;/strong&gt; method instantly gives you statistical information like &lt;strong&gt;mean, count, standard deviation&lt;/strong&gt;, among others useful in getting a fast feel of a dataset.&lt;/p&gt;

&lt;p&gt;Now, I dive into Pandas, where I will go through &lt;strong&gt;cleaning, preprocessing, handling missing values, grouping, data aggregation, and transformation&lt;/strong&gt;. This is all very important because good quality, well-structured data is at the heart of every AI or ML model: a model is only as good as the data quality that it is trained on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The starting AI and ML made me realize that NumPy and Pandas are not just optional tools, but a must-have for any data worker who wants to do the job efficiently and with meaning. NumPy handles the heavy mathematical lifting while Pandas does the organizing, cleaning, and preparing of data for modeling. Knowing these libraries has ironed my path into AI and ML so much, as well as smoother. I am looking forward to continued learning and exploration of more advanced concepts ahead.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>How being lazy made me a better developer</title>
      <dc:creator>Asad Hussain</dc:creator>
      <pubDate>Thu, 13 Nov 2025 17:41:51 +0000</pubDate>
      <link>https://dev.to/snackoverflowwithasad/how-being-lazy-made-me-a-better-developer-1cd0</link>
      <guid>https://dev.to/snackoverflowwithasad/how-being-lazy-made-me-a-better-developer-1cd0</guid>
      <description>&lt;p&gt;Before I start lemme inform you that I don’t really have hobbies other than coding and gaming (which everyone loves anyway), and I’m honestly Z+++ lazy so lazy that my mom scolds me daily, but in a weird way this laziness pushes me to build things that make my own life easier. Me and my college friend (we’re in second year btw, and I probably have an exam next week idk whenever you’re reading this but yeah) always daydream about getting placed in some U.S. company or FAANG and earning in dollars, and every single time we end up Googling “convert USD to INR” to calculate our imaginary expenses and savings for our imaginary Lamborghini. I was too lazy to open Google and type it again and again, so I built a currency converter using &lt;strong&gt;React, Tailwind CSS&lt;/strong&gt;, and a free API default set to USD -&amp;gt; INR so I don’t have to do anything. It’s not a big project, but it taught me API handling in React for the first time, and now I call APIs like they’re my girlfriend (I don’t have one). Another time, when boredom hit hard, I built a death calculator using &lt;strong&gt;TypeScript, Motion, and some basic JS logic&lt;/strong&gt; pure brainrot but fun. These projects may look silly, but they help me learn and survive the boring days. And yes, I don’t only make dumb stuff; it’s just fun to share. I’m currently rebuilding another project purely out of laziness. &lt;strong&gt;&lt;em&gt;All my projects are on my GitHub if you want to check them out see you soon with more chaotic builds.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>career</category>
    </item>
    <item>
      <title>Hey there, do you know me?</title>
      <dc:creator>Asad Hussain</dc:creator>
      <pubDate>Sun, 09 Nov 2025 18:39:36 +0000</pubDate>
      <link>https://dev.to/snackoverflowwithasad/how-being-lazy-made-me-a-better-developer-398h</link>
      <guid>https://dev.to/snackoverflowwithasad/how-being-lazy-made-me-a-better-developer-398h</guid>
      <description>&lt;p&gt;I’m Asad Hussain, currently doing my Bachelor of Computer Applications at IEM Kolkata. I’ve been into coding for a while now and honestly, it’s the only hobby that stuck 😭😭😭&lt;br&gt;
I’m that kind of person who’s lazy in the smartest way possible. If there’s a long method to do something, I’ll find a shorter and smarter way to make it work. I love building stuff that solves problems or just makes life a little more fun.&lt;br&gt;
When I get bored or tired of building complex projects for practice, I end up creating random things that may not change the world but definitely make me laugh. Like once, I built GrimTok(which i call atank) a totally useless (but hilarious) project that predicts my death. My mom thought it was real, and let’s just say… she wasn’t amused 💀🤣.&lt;br&gt;
This is my first post here, and I’ll be sharing my projects, thoughts, and random coding experiments that keep me sane. If you’re into coding, memes, or just making weird but fun stuff you’re in the right place.&lt;/p&gt;

&lt;p&gt;Thanks for reading :)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>coding</category>
      <category>developer</category>
    </item>
  </channel>
</rss>
