How to Build an AI Agent: No-Code Builders, Frameworks and SDKs
A practical guide to building your first AI agent: choosing between no-code builders, open-source frameworks and model vendors' SDKs, the core agent loop, tools, guardrails and testing, with live usage data for each option.
An AI agent is a language model running in a loop with tools: it decides what to do next, calls a tool, reads the result and repeats until the task is done. Building one is less about the model and more about everything around that loop: which tools it can use, what it is allowed to do on its own, and how you know it works. This guide walks through the choices in the order you will meet them.
Step 1: Pick the route
There are three ways to build an agent today, and the right one depends on who will maintain it.
| Route | Best for | You write | Examples |
|---|---|---|---|
| No-code and low-code builders | Operations and business teams automating a process | Little or no code; you connect blocks in a visual editor | n8n, Dify, Langflow, Flowise |
| Open-source frameworks | Developers building a product or internal tool | Python or TypeScript, with the framework handling state, tools and orchestration | LangChain, AI SDK, LangGraph, Cloudflare Agents SDK |
| Model vendors' agent SDKs | Developers who have chosen a model provider | Thin code close to the provider's API, with new model features first | OpenAI Agents SDK, Claude Agent SDK, Google ADK |
If you are not sure, start with the simplest route that can do the job. A visual workflow with one AI step is easier to run and debug than a multi-agent system, and many "agents" in production are exactly that.
Step 2: Understand the loop
Every framework wraps the same loop. Written out in plain Python-like pseudocode, it looks like this:
messages = [system_prompt, user_task]
while True:
reply = model(messages, tools=tool_definitions)
if reply.wants_tool:
result = run_tool(reply.tool_name, reply.arguments) # your code, your permissions
messages += [reply, result]
else:
return reply.text # the agent decided it is done
Everything else a framework offers sits around this loop: memory that survives between runs, retries when a tool fails, streaming, tracing so you can see what happened, approval steps before risky actions, and ways to split work between several agents. Knowing the loop makes it easier to judge which of those you actually need.
Step 3: Design the tools
Tools are where an agent touches the real world, and they matter more than the prompt.
- Few, clear tools beat many vague ones. Each tool needs a name and a description the model can understand, and inputs it can fill in correctly.
- Return useful errors. "Customer not found: check the email address" lets the model recover; a stack trace does not.
- Separate reading from acting. Tools that look things up can run freely; tools that send, pay, delete or publish should go through an approval step.
- Use existing connectors where they exist. Many frameworks and builders support the Model Context Protocol (MCP), which lets an agent use tools published by other services without you writing the integration.
Step 4: Choose a framework (with live data)
These are the most downloaded agent frameworks and SDKs right now:
| # | Agent | Pulse | Downloads 7d | 7d | 30d | Stars | Latest release | Last 90 days | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 |
LangChainLangChain |
77 | 44.3M | up 1.9% | down 22.0% | 147K+45/day | 1.4.38d ago | ||||
| 10 |
LangGraphLangChain |
69 | 16.1M | up 11.4% | down 21.8% | 42.7K+48/day | 1.2.13yesterday | ||||
| 11 |
AI SDKVercel |
67 | 34.5M | up 13.5% | up 20.9% | 27.1K+18/day | 6.0.301yesterday | ||||
| 13 | 63 | 8.7M | up 0.6% | up 2.0% | 8,679+23/day | 1.58.0yesterday | |||||
| 17 |
Claude Agent SDKAnthropic |
59 | 21.5M | up 14.6% | up 0.6% | 8,219+5/day | 0.2.1636d ago | ||||
| 21 |
MastraMastra |
58 | 2.2M | up 11.1% | up 19.1% | 28.6K+27/day | 1.74.0yesterday | ||||
| 23 |
Deep AgentsLangChain |
57 | 2M | up 13.5% | up 5.0% | 30K+19/day | 0.7.22yesterday | ||||
| 25 |
Cloudflare Agents SDKCloudflare |
56 | 2.3M | up 11.0% | up 23.9% | 5,778+18/day | 0.26.04d ago | ||||
| 29 |
OpenAI Agents SDKOpenAI |
54 | 5.5M | up 7.7% | down 46.4% | 29.8K+16/day | 0.23.14d ago | ||||
| 30 |
DSPyStanford NLP |
53 | 1.4M | up 4.8% | down 13.9% | 38.5K+16/day | 3.4.011d ago | ||||
| No agents match that filter. | |||||||||||
Downloads count installs in CI and as dependencies of other packages, so popular base libraries lead by a wide margin. More useful signals when choosing:
- Language. Most frameworks are Python-first; several are TypeScript-first, which matters if your product is a web app.
- Release activity. A framework that ships every week is moving fast, which means fixes but also breaking changes.
- Fit to your model. Vendor SDKs work best with their own models; independent frameworks make it easier to switch.
The full ranking is on agent frameworks and SDKs. Popular pairs are compared side by side, for example LangGraph vs CrewAI and LangGraph vs LangChain.
If you prefer a visual builder, these are the leading workflow and agent builders:
| # | Agent | Pulse | Downloads 7d | 7d | 30d | Stars | Latest release | Last 90 days | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 6 |
n8nn8n |
74 | 141K | up 30.2% | down 24.3% | 207K+92/day | 2.41.7yesterday | ||||
| 12 |
DifyLangGenius |
63 | — | — | — | 158K+73/day | 1.17.126d ago | ||||
| 43 |
FlowiseFlowiseAI |
49 | 2,943 | up 1.1% | down 9.3% | 55.5K+6/day | 3.1.42mo ago | ||||
| 47 |
LangflowLangflow (DataStax, an IBM company) |
47 | 14.5K | up 32.2% | down 26.6% | 156K+32/day | 1.12.47d ago | ||||
| 66 |
ActivepiecesActivepieces |
41 | — | — | — | 24.9K+22/day | 0.92.16d ago | ||||
| 73 |
Coze StudioByteDance |
38 | — | — | — | 21.7K+4/day | 0.5.18mo ago | — | |||
| No agents match that filter. | |||||||||||
Step 5: Add guardrails
An agent that can act can also act wrongly. Before it touches anything real:
- Limit permissions to what the task needs: read-only access first, a sandbox for code, spending caps for paid APIs.
- Require approval for irreversible actions: sending messages, payments, deletions, deployments.
- Treat inputs as untrusted. Web pages, emails and documents can contain text written to steer the agent (prompt injection). Do not let content from those sources trigger sensitive tools without a check.
- Set limits on the loop: a maximum number of steps, a time-out and a budget per run.
Step 6: Test it like software
Agents are non-deterministic, so one successful demo proves little.
- Build a small test set of real tasks with known good outcomes, including a few that should fail or be refused.
- Run it after every change to the prompt, tools or model, and compare results.
- Turn on tracing so you can read every step of a failed run; most frameworks and builders support it.
- Measure what matters: task success, cost per run and time per run.
Step 7: Run it in production
Start with a human in the loop on a small slice of real work, watch the traces, and widen the agent's autonomy only where it has proved reliable. Keep the test set growing with every failure you find.
Where to go next
- New to the topic: what an AI agent is.
- Ready-made agents for common jobs, if you would rather not build: the best AI agents by category.
- Open-source options to self-host: open-source AI agents.
Agents mentioned in this guide
| # | Agent | Pulse | Downloads 7d | 7d | 30d | Stars | Latest release | Last 90 days | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 10 |
LangGraphLangChain |
69 | 16.1M | up 11.4% | down 21.8% | 42.7K+48/day | 1.2.13yesterday | ||||
| 4 |
LangChainLangChain |
77 | 44.3M | up 1.9% | down 22.0% | 147K+45/day | 1.4.38d ago | ||||
| 29 |
OpenAI Agents SDKOpenAI |
54 | 5.5M | up 7.7% | down 46.4% | 29.8K+16/day | 0.23.14d ago | ||||
| 17 |
Claude Agent SDKAnthropic |
59 | 21.5M | up 14.6% | up 0.6% | 8,219+5/day | 0.2.1636d ago | ||||
| 49 | 47 | 2.6M | down 9.6% | down 42.6% | 21.7K+8/day | 2.11.04d ago | |||||
| 33 |
CrewAICrewAI |
52 | 611K | up 7.2% | — | 59.4K+37/day | 1.15.238d ago | ||||
| 6 |
n8nn8n |
74 | 141K | up 30.2% | down 24.3% | 207K+92/day | 2.41.7yesterday | ||||
| 12 |
DifyLangGenius |
63 | — | — | — | 158K+73/day | 1.17.126d ago | ||||
| 11 |
AI SDKVercel |
67 | 34.5M | up 13.5% | up 20.9% | 27.1K+18/day | 6.0.301yesterday | ||||
| 21 |
MastraMastra |
58 | 2.2M | up 11.1% | up 19.1% | 28.6K+27/day | 1.74.0yesterday | ||||
| No agents match that filter. | |||||||||||