If you're a JavaScript developer curious about stepping into the world of AI agents, this AI Agents Hackathon session is the perfect starting point. Learn how to build intelligent agents, integrate them with tools like Bing Search and Azure AI Search, use function calls, and even interpret code — all using TypeScript and the Azure AI Agent Service!
Introduction: The Era of AI Agents in JavaScript
During the AI Agents Hackathon, one of the most anticipated sessions was presented by Wassim Chegham, Senior AI Developer Advocate for JavaScript at Microsoft. The topic? "How to Create Your First AI Agent with JavaScript and Azure AI Agent Service" — a powerful tool designed for modern developers looking to build AI-first applications with security, scalability, and productivity in mind.
In this article, we explore the main highlights of the session, focusing on how you can create your own AI agent using JavaScript and Azure AI Agent Service.
The video’s goal is clear: walk through the step-by-step process of creating AI agents using JavaScript and TypeScript with Azure AI Foundry, and explain all the key concepts behind this new development paradigm.
If you missed the session, don’t worry! You can watch the recording:
What Are AI Agents?
Wassim starts the session with a historical overview: from traditional chatbots to the intelligent and autonomous agents we know today. He highlights:
- LLM-based Agents (Large Language Models) that understand natural language.
- Tool-using Agents that perform real-world tasks like API calls, searches, code execution, etc.
- Multi-agent Systems, coordinating multiple agents to solve complex problems.
The main advantage of Azure AI Agent Service is how it simplifies all of this by offering a managed platform that handles orchestration, security, tracking, and agent execution.
Solution Architecture with Azure AI Agent Service
During the session, Wassim provided a clear view of a typical AI agent app architecture built with JavaScript. He explained that while you can use a graphical interface (Frontend) with frameworks like Angular or React, it’s not mandatory — the app can work just fine from a terminal, as demonstrated live.
In the Backend, the focus is on using Node.js, often combined with frameworks like Express.js or Fastify to expose APIs that communicate with agents. This API layer acts as a bridge between users and the agent’s logic, coordinating messages, executions, and tool invocations.
The agent itself is created and managed using the azure/ai-projects SDK, which provides a simple API to register agents, define instructions, attach tools, and control executions. Wassim emphasized how this approach reduces complexity compared to other agent frameworks that require manual state configuration, orchestration, and context management.
Additionally, there is a layer of integrated tools that greatly expand the agent's capabilities:
- Code Interpreter: sandboxed Python code execution
- Function Calling: user-defined function invocation
- Azure AI Search: vector search and RAG (Retrieval-Augmented Generation)
- Bing Search: real-time web data grounding
All these tools are available plug-and-play through the Azure AI Agent Service infrastructure.
This architecture is powered by an Azure AI Foundry instance, which centralizes control over models, tools, connections, and data, providing a robust, secure, and scalable base for AI-first applications. Wassim made it clear: the agent is the true "brain" of the application — receiving instructions, reasoning over them, and coordinating task execution with external tools, all with just a few JavaScript commands.
Creating Your First Agent: Hands-on with JavaScript
During the hands-on demo, Wassim walks participants through every step to create a working AI agent using JavaScript and Azure AI Agent Service. He begins by highlighting that all code is publicly available in a GitHub repository, so anyone can clone, run, and adapt it.
> Repository link: Azure AI Agent Service - Demonstration
The first step is installing the required packages. The core one is the azure/ai-projects SDK (npm package), which handles agent interactions. You’ll also need azure/identity to securely authenticate with Azure credentials using, for example, DefaultAzureCredential.
Once the environment is set up, Wassim shows how to create an authenticated client using a connection string from the Azure Foundry portal. This string is stored in a .env file and allows secure communication with the agent service.
With the client ready, the next step is to create the agent. You define its name, the language model (like GPT-4), and clear instructions about what the agent should do — whether it’s calculating, answering questions, interpreting data, or interacting with external tools.
Wassim then introduces the thread concept, which acts as a conversation space between the agent and user. This is where messages are stored, executions are initiated, and interaction history is tracked. He shows how to create a thread, send a message, and launch a run, or agent execution.
The session then showcases tool usage. In the first example, the agent solves a simple equation using its internal knowledge — a classic case demonstrating reasoning capabilities based on instructions. Next, Wassim activates a custom function call: the agent fetches local CPU usage, demonstrating environment interaction.
Another impressive example is using the Code Interpreter tool to run Python code remotely. Wassim uploads a CSV with car sales data, and the agent processes the data and generates charts in real-time.
He also demonstrates using Bing Grounding to fetch up-to-date info from the internet (e.g., stock prices). Finally, he shows how Azure AI Search queries a vector index with healthcare plan data to answer specific questions — with precise source citations. A great RAG (Retrieval-Augmented Generation) example.
These examples prove that with just a few JavaScript commands, you can build powerful agents capable of interacting with users, data, and tools seamlessly and securely.
Understanding the Inner Workings: How an Agent Works
Wassim explains the key concepts in an agent's lifecycle:
- Agent: configured with model and instructions.
- Thread: represents conversation (context).
- Run: task execution.
- Run Steps: steps in the execution.
- Tools: defined via schema and triggered as needed.
- Events: emitted during execution (streaming, tool-call, response, error, etc).
He also showcases a personal project: a visual tracing tool to track agent steps in real-time — helpful for understanding and debugging.
A Bit About the Technologies Used
For the tech-curious, Wassim highlighted the stack powering the project:
- 📦 SDKs
- 🔧 Integrated tools
- Function Calling: run functions based on LLM input.
- Code Interpreter: safely run Python remotely.
- Azure AI Search: vector and full-text search (RAG).
- Bing Search Grounding: real-time web info.
- File Search (coming soon): search uploaded files.
- ⚙️ Security & Compliance
- Keyless authentication
- Private Networking (VNet)
- Content Filtering
- Tracing/logging to prevent hallucinations
Conclusion: The Future of AI Agents with JavaScript
Wassim Chegham's session at the AI Agents Hackathon was a masterclass in how to create AI agents using JavaScript and Azure AI Agent Service. He not only introduced the core concepts, but demonstrated how quick and easy it is to develop intelligent apps with this new approach.
Again, if you missed the session, you can watch the full recording here.
And don’t forget to check out the GitHub repo with all the examples and code used in the session: Azure AI Agent Service - Demonstration.
Wassim’s closing message was clear: the future of AI agents is bright. With the right tools, any developer can build impactful and innovative solutions. So don’t wait — start building your AI agent with Azure today!
Useful Links
- Azure AI Agent Service: Official docs for Azure AI Agent Service.
- Azure AI Foundry: Platform for creating and managing AI agents.
- Azure AI Agent Service - Demo: GitHub repo with session code and examples.
- AI Agents Hackathon: Event gathering developers to explore AI agent potential.
- Wassim Chegham: LinkedIn profile of the session speaker.
- Azure AI Foundry - Getting Started: Quickstart guide for Azure Foundry.
- Agent Service Quickstart: Get started with your first agent.
- Agent Service Tools: Learn about tools available in the Agent Service.
- Function Calling Docs
- Code Interpreter Docs
Updated May 07, 2025
Version 1.0Glaucia_Lemos
Microsoft
Joined April 15, 2019
Microsoft Developer Community Blog
Follow this blog board to get notified when there's new activity