Google ADK vs LangGraph: Which Agent Framework to Use in 2026

By TwitterAPI.io Team•16 min read
Diagram comparing Google ADK 2.x and LangGraph 1.x building the same X research agent. Blue box, Google ADK under Apache-2.0: Agent with tools, Workflow with edges, McpToolset over Streamable HTTP, to_a2a and RemoteA2aAgent, adk deploy cloud_run or Agent Runtime. Green box, LangGraph under MIT: StateGraph add_node, checkpointer plus interrupt, MCPAdapter with a client and key, LangSmith Deployment A2A endpoint. Both arrows point to a tool layer (MCP server at mcp.twitterapi.io/mcp or the REST advanced_search endpoint), which feeds X data at $0.15 per 1,000 tweets returned versus the X rate card at $0.005 per post.
Same agent, two frameworks, one tool layer. Our X study (961 posts, 50 requests) cost $0.14; the same reads at X's $0.005 per post would be about $4.80. Collected in 2026.
TL;DR
  • Versions checked this session: google-adk 2.14.0 (Python 3.11+, Apache-2.0, about 22.2K GitHub stars) and langgraph 1.2.20 (Python 3.10+, MIT, about 44.8K stars).
  • Both are graph frameworks now. ADK 2.0 added Workflow(edges=[...]) on top of its Agent class; LangGraph has always been a StateGraph of nodes and edges.
  • State is the real split: LangGraph checkpoints every step for durable execution and interrupt(); ADK keeps sessions, state and Memory Bank behind a SessionService, with tool confirmation for human approval.
  • MCP in both: ADK's McpToolset with StreamableHTTPConnectionParams; LangChain 1.4's MCPAdapter (beta) feeds tools into a LangGraph agent. A2A: ADK ships to_a2a and RemoteA2aAgent; LangSmith's Agent Server exposes /a2a/{assistant_id}.
  • On X: 280 LangGraph posts vs 101 ADK posts in one 74-hour window; MCP appears in 23.1% of ADK posts and 20.0% of LangGraph posts; ADK posts name LangGraph 19.1% of the time, the reverse only 3.2%.
  • X data for either agent: $0.15 per 1,000 tweets returned on TwitterAPI.io vs $0.005 per post read on X's pay-per-usage rate card (about 33x); our 961-post study cost $0.14.

Most "Google ADK vs LangGraph" comparisons were written against ADK 1.x, when ADK was a hierarchy of LLM agents plus sequential, parallel and loop agents, and LangGraph was the only one of the two with a real graph runtime. That changed with ADK 2.0. This page compares the versions you would install today, checked against both GitHub repositories, PyPI, the ADK docs at adk.dev, the LangChain docs and both vendors' pricing pages this session.

This page is the ADK-versus-LangGraph decision. If you are choosing between LangChain and LangGraph instead, read our LangChain vs LangGraph guide; if you already picked a framework and need X (Twitter) data inside it, our LangChain + Twitter and Gemini + Twitter guides cover the wiring. Here we answer the framework question first, then build the same X research agent in both and measure, on real X data, what builders actually say about each framework.

LangGraph vs Google ADK posts on X, same window

2.8x: 280 LangGraph posts vs 101 Google ADK posts in the same 74 hours, yet the median ADK post earned 4 likes to LangGraph's 1 (961 posts, collected in 2026).

01 — Section

Google ADK vs LangGraph at a glance

The table lists what each project ships today. Version numbers, licenses and Python requirements come from PyPI and the GitHub repositories; features come from each project's README and docs.

Google ADKLangGraph
Latest release checkedgoogle-adk 2.14.0 (ADK 2.0 GA on May 19, 2026)langgraph 1.2.20 (1.0 shipped October 2025)
License, maintainerApache-2.0, GoogleMIT, LangChain Inc
LanguagesPython, Java, Kotlin, Go, TypeScriptPython, plus LangGraph.js for JavaScript
Core building blocksAgent (instructions, tools) and Workflow (graph of nodes)StateGraph with typed state, nodes and edges
State and memorySessions, state, artifacts, Memory Bank via servicesCheckpointers (durable execution), stores for long-term memory
Human-in-the-loopTool confirmation flow, workflow HITL nodesinterrupt() and resume from any checkpoint
MCP clientMcpToolset (stdio, Streamable HTTP)MCPAdapter in langchain[mcp] 1.4+ (beta), built on FastMCP
A2Ato_a2a() server, RemoteA2aAgent clientAgent Server endpoint /a2a/{assistant_id} (JSON-RPC)
Dev toolingadk web UI, adk run, adk evalLangSmith Studio, tracing and evals in LangSmith
Managed deployCloud Run, Agent Runtime on Gemini Enterprise Agent PlatformLangSmith Deployment (serverless or dedicated)

Model choice. ADK's README says it is "optimized for Gemini" but model-agnostic and deployment-agnostic; its examples default to Gemini models. LangGraph has no default model at all: a node is a Python function, so the model is whatever you call inside it, usually through LangChain's chat model integrations.

Community size. At the time of checking, langchain-ai/langgraph had about 44.8K GitHub stars and google/adk-python about 22.2K; the other ADK ports add adk-go (about 9.0K), adk-java (about 1.8K) and adk-js (about 1.5K). Both repositories had commits the day we looked, and ADK's README states a roughly bi-weekly release cadence.

02 — Section

What changed in ADK 2.0: ADK has a graph runtime too

ADK started (first PyPI release April 2025, 1.0 in May 2025) as a code-first way to compose LLM agents into a tree: a root agent delegates to sub-agents, and workflow agents (SequentialAgent, ParallelAgent, LoopAgent) run them in fixed patterns. That was the basis for the common claim that ADK is "hierarchical" and LangGraph is "a graph".

The ADK 2.0 release notes describe a "model-agnostic engine for orchestrating non-linear, conditional, and cyclical agent execution patterns", and the current README lists a Workflow runtime with routing, fan-out and fan-in, loops, retry, state management, dynamic nodes, human-in-the-loop and nested workflows. A Workflow takes edges, and each node can be an agent, a plain Python function, a tool or another workflow; a node's return value becomes the next node's input. ADK 2.0 also added a Task API for structured agent-to-agent delegation.

In practice this means a deterministic pipeline (fetch, then filter, then summarize) no longer forces you toward LangGraph. The snippet below is a three-node ADK workflow where the middle step is ordinary Python. The 2.14 release notes go further and move execution environments, A2A, evaluation and core runtime modules out of experimental status.

The gap that remains. LangGraph's graph is the whole framework: state is a typed dict that every node reads and writes, reducers merge updates, and a checkpointer saves the state after every step so a run can pause for days and resume where it stopped. ADK's workflow passes outputs node to node and keeps conversation state in its session service. If your design centers on resumable, inspectable state (approvals, retries after a crash, time travel through past steps), LangGraph's model is the more direct fit. If it centers on agents that delegate to agents, ADK's is.

Interop exists. ADK Python ships a LangGraphAgent class (google.adk.agents.langgraph_agent) that wraps a compiled LangGraph StateGraph as an ADK agent, so a team can keep an existing LangGraph graph and orchestrate it from ADK, or expose it over A2A through ADK.

python
# ADK 2.x Workflow: a graph of agents and plain functions (from the ADK Workflow docs pattern)
from google.adk import Agent, Workflow

pick_query = Agent(
    name="pick_query",
    model="gemini-3.5-flash",
    instruction="Turn the user's topic into one X search query. Return only the query.",
)

def fetch_posts(node_input: str):
    return search_x(node_input)          # the shared tool from the full example below

write_brief = Agent(
    name="write_brief",
    model="gemini-3.5-flash",
    instruction="Summarize the posts you receive in five bullet points with like counts.",
)

root_agent = Workflow(name="x_brief", edges=[("START", pick_query, fetch_posts, write_brief)])
03 — Section

State, durability and human approval

This is the dimension that decides most real projects, and it is where the two frameworks are still built differently.

LangGraph. You declare the state schema up front (TypedDict or Pydantic), every node returns a partial update, and a checkpointer (in-memory, SQLite, Postgres, or the managed one in LangSmith Deployment) stores a snapshot after each step under a thread_id. The LangGraph README lists durable execution ("persist through failures and can run for extended periods, automatically resuming from exactly where they left off"), human-in-the-loop ("inspecting and modifying agent state at any point") and short- and long-term memory as its first three features. interrupt() pauses a node and waits for a human value; you resume the same thread later.

Google ADK. A Runner executes an agent against a session from a SessionService (in-memory, database, or the managed sessions on Agent Runtime). Session state is a key-value dict that agents and tools read and write, events are appended to the session, and a separate memory service (Memory Bank on Google Cloud) holds long-term recall. For approvals, ADK's tool confirmation flow guards a tool call behind an explicit yes or custom input, and ADK 2.0 workflows support human-in-the-loop nodes.

NeedLangGraphGoogle ADK
Resume a crashed run mid-graphBuilt in (checkpointer per step)Session and events persist; workflow resume depends on runtime
Pause for human approvalinterrupt() in any nodeTool confirmation, HITL workflow nodes
Inspect or edit past stateRead and update checkpoints by threadRead session state and events
Long-term memoryStore API (namespaced key-value, search)Memory service, Memory Bank on Google Cloud

If you need fine-grained replay of a long, branching run, LangGraph gives you more control with less code. If your agents are conversational and session-shaped (a support agent, an assistant inside Google Workspace or Gemini Enterprise), ADK's session model maps onto the product with less glue.

04 — Section

MCP and A2A in each framework

Both frameworks are MCP clients, which matters more than any built-in tool list: whatever MCP servers your team already uses work in either one. The code connects each to the same hosted server, TwitterAPI.io's X data MCP server at https://mcp.twitterapi.io/mcp, which takes the key as Authorization: Bearer <key> and exposes tools such as search_tweets, get_user_info, get_user_last_tweets and get_tweet_replies (setup for other clients is on our MCP server page).

ADK. McpToolset with StreamableHTTPConnectionParams(url=..., headers=...) turns every tool on the server into an ADK tool. The ADK docs add two rules worth knowing before you deploy: an agent deployed to production "must define McpToolset synchronously" in agent.py, and the toolset opens its session on first use rather than at construction. The docs also recommend auth_scheme and auth_credential for OAuth-style servers; a static bearer header is fine for an API key.

LangGraph. Since LangChain 1.4, the documented path is MCPAdapter from langchain.mcp (install langchain[mcp]), built on FastMCP; the docs mark it as beta and point users of the older langchain-mcp-adapters package to a migration guide. A bearer token goes on a FastMCP Client(url, auth=token). The adapter returns LangChain tools you can hand to create_agent or to a ToolNode inside your own StateGraph.

A2A (agent-to-agent). ADK treats A2A as a first-class feature: to_a2a() serves an ADK agent with an agent card, and RemoteA2aAgent lets a local agent delegate to a remote one as if it were a sub-agent; the ADK docs still label A2A experimental in Go, Java and Kotlin, while the 2.14 release notes graduate the Python module. In the LangGraph ecosystem, A2A is served by the deployment layer: LangSmith's Agent Server exposes each assistant at /a2a/{assistant_id} with its card at /.well-known/agent-card.json, using the A2A JSON-RPC binding only, with a documented list of unsupported methods and the requirement that graph state include a messages key.

python
# Google ADK: our hosted MCP server as a toolset (define it synchronously in agent.py for deploys)
import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

root_agent = LlmAgent(
    model="gemini-3.5-flash",
    name="x_analyst",
    instruction="Answer questions about X (Twitter) using the search_tweets and get_user_* tools.",
    tools=[McpToolset(connection_params=StreamableHTTPConnectionParams(
        url="https://mcp.twitterapi.io/mcp",
        headers={"Authorization": f"Bearer {os.environ['TWITTERAPI_IO_API_KEY']}"},
    ))],
)

# LangGraph / LangChain: the same server through MCPAdapter (langchain[mcp] >= 1.4.0, beta)
from fastmcp.client import Client
from langchain.mcp import MCPAdapter

async def load_x_tools() -> list:
    async with MCPAdapter(Client("https://mcp.twitterapi.io/mcp",
                                 auth=os.environ["TWITTERAPI_IO_API_KEY"])) as adapter:
        return await adapter.list_tools()   # pass to create_agent or a ToolNode in your StateGraph
05 — Section

Deploying each, and what the platforms charge

Both libraries are free and open source; you pay for the model calls, the tools, and wherever you run the agent. Each has a managed home from its own vendor, and both also run as an ordinary container.

Google ADK. adk deploy cloud_run and adk deploy docker are built into the CLI; the managed option is Agent Runtime on Gemini Enterprise Agent Platform, which the ADK README notes was formerly Vertex AI Agent Engine. Google's Agent Platform pricing page lists Agent Compute at $0.085 per vCPU-hour and Agent Memory at $0.009 per GiB-hour, rounded to the second, and states that runtime idle time between turns is not billed; sessions and Memory Bank storage bill as Agent Storage at $0.30 per GiB-month plus read and write operations.

LangGraph. You can self-host the open-source library anywhere. LangSmith Deployment is LangChain's managed runtime. The LangSmith pricing page lists Developer at $0 / seat per month (1 seat, up to 5k base traces / mo), Plus at $39 / seat per month (up to 10k base traces / mo, one free small serverless deployment) and Enterprise at custom pricing. Deployments are metered in LangChain Standard Units at $1.00 / LSU: runtime compute 0.0675 LSU / vCPU-hr, runtime memory 0.0090 LSU / GiB-hr, database compute 0.177 LSU / vCPU-hr and database memory 0.025 LSU / GiB-hr.

Google ADK managedLangGraph managed
ProductAgent Runtime (Gemini Enterprise Agent Platform)LangSmith Deployment
Compute$0.085 per vCPU-hour0.0675 LSU / vCPU-hr runtime, 0.177 LSU / vCPU-hr database
Memory$0.009 per GiB-hour0.0090 LSU / GiB-hr runtime, 0.025 LSU / GiB-hr database
Seats and tracingGoogle Cloud project billing$0 Developer, $39 / seat per month Plus, Enterprise custom
Self-host optionCloud Run, Docker, any container hostAny container host; library is MIT

These rates are list prices as shown on each vendor's page when we checked; neither includes model tokens. Compare total cost on your own workload, not per-unit rates, because the two platforms meter different things (Google bills the agent's compute, LangSmith bills the runtime and its state database separately).

06 — Section

When to choose Google ADK, and when to choose LangGraph

Choose LangGraph if the workflow is the product: long-running runs that must survive restarts, approvals in the middle of a graph, branching you want to replay and debug step by step, or a team that already uses LangChain integrations and LangSmith tracing. It is also the safer choice when you must stay model-neutral and cloud-neutral, and when you want the larger pool of examples and answered questions.

Choose Google ADK if you build on Gemini and Google Cloud (Agent Runtime, Memory Bank, Vertex AI Search, Gemini Enterprise), if your design is a team of agents that delegate to each other, if A2A interoperability with other teams' agents is a requirement, or if parts of your stack are in Java, Go, Kotlin or TypeScript and you want one framework across them. ADK's built-in adk web UI and adk eval also get a first agent tested quickly without a separate service.

Use both if you already have LangGraph graphs and are moving onto Google Cloud: ADK's LangGraphAgent can wrap a compiled graph, and either side can call the other over A2A. The cost of mixing is two mental models for state.

Do not decide on these alone. Both frameworks call tools the same way through MCP, both support any model with some effort, and both are open source with permissive licenses. The differences above (state model, vendor platform, languages, community) are the ones that will still matter after the first prototype.

If your team is new to agents in general, our guide to building an AI agent walks through the loop (model, tools, memory) without committing to a framework, and the OpenAI Agents SDK guide covers a third option with the same X tools.

07 — Section

The same X research agent in both frameworks

To compare them on a real task, we built one small agent twice: given an X search query, fetch recent posts and report how many there are, the median likes and the three most-liked posts. The full script is in the code block at the end of this page; it shares one tool function, search_x(), which calls /twitter/tweet/advanced_search on https://api.twitterapi.io with the X-API-Key header and follows next_cursor while has_next_page is true.

In LangGraph the task becomes two explicit nodes, fetch and summarize, joined by edges from START to END. The counting and ranking are deterministic Python, so the run needs no model at all; you add an LLM node only for the prose summary. Add a checkpointer at compile() and the run becomes resumable.

In Google ADK the natural shape is one Agent with search_x passed in tools=[...]: ADK reads the function's signature and docstring to build the tool schema, Gemini decides when to call it, and InMemoryRunner.run_debug() prints the exchange. If you want the deterministic version instead, the ADK 2.x Workflow shown earlier does the same job with a function node.

What the comparison shows. For a fixed pipeline, LangGraph's version is shorter to reason about because nothing is left to the model. For an open-ended research assistant that decides which searches to run, ADK's single agent with tools is less code. Swapping the REST tool for the MCP toolset from the previous section changes one line in either framework.

The X data bill is the same in both. TwitterAPI.io bills tweet endpoints at 15 credits per tweet returned, which is $0.15 per 1,000 tweets; a full 20-post page costs $0.003, and an empty search costs the 15-credit minimum of $0.00015. X's own pay-per-usage rate card (docs.x.com/x-api/getting-started/pricing) charges $0.005 per post read and $0.010 per user read, so the same 1,000 posts cost $5 there versus $0.15 here, about 33x.

Measured on this page. The study below read 961 posts in 50 requests for $0.14; at X's $0.005 per post read the same posts would cost about $4.80. An agent that polls a search every 5 minutes and usually finds nothing pays the minimum on each check: about $1.30 a month, or $6.48 a month at every 60 seconds. New accounts that pass the automatic bot check get up to $1 of free credits (at most 100,000 credits, no card, one per person or network, expiring after 31 days); reads need no X account. Before the first payment the rate limit is 0.2 requests per second, so a tool-calling loop should pace itself; it rises to 20 once paid.

08 — Section

What X builders say about Google ADK and LangGraph (real-data study)

We searched X for the latest posts about each framework with /twitter/tweet/advanced_search (Latest, retweets excluded): 481 posts mentioning Google ADK from 369 accounts and 280 posts mentioning LangGraph from 228 accounts, plus a third search for posts that name both. Then we flagged which topics each post mentions.

Topic mentioned in the postGoogle ADK postsLangGraph posts
MCP23.1%20.0%
A2A13.7%3.6%
Gemini19.5%8.6%
Google Cloud deploy target6.4%3.2%
LangSmith7.1%7.5%
Multi-agent13.1%16.8%
Names the other framework19.1%3.2%
Links to github.com17.0%11.1%

MCP is common ground. About one post in five about either framework mentions MCP (23.1% for ADK, 20.0% for LangGraph), which matches the technical picture: tools are portable between them.

A2A and Gemini are ADK's identity. A2A shows up in 13.7% of ADK posts against 3.6% of LangGraph posts, and Gemini in 19.5% against 8.6%. Explicit Google Cloud deploy targets (Vertex, Agent Engine, Agent Runtime, Cloud Run) are rarer than the marketing suggests: 6.4% of ADK posts.

The comparison is one-directional. ADK posts name LangGraph 19.1% of the time; LangGraph posts name ADK 3.2%. LangGraph posts more often mention LangChain (25.7% vs 11.4%) and are more often replies (27.9% vs 13.9%), which reads as an established community talking among itself, while ADK posts position ADK against the incumbent.

Posts that name both are roundups. Of 176 posts that named both frameworks, 70.5% also named CrewAI, 31.2% AutoGen and 25.0% the OpenAI Agents SDK; 81.8% named at least one other agent framework. Head-to-head ADK-versus-LangGraph discussion is rare on X; most of it is "top frameworks" lists.

Grouped horizontal bar chart of the share of X posts about Google ADK (blue, 481 posts) and LangGraph (orange, 280 posts) that mention each topic: MCP 23.1% vs 20.0%, A2A 13.7% vs 3.6%, Gemini 19.5% vs 8.6%, Google Cloud deploy target 6.4% vs 3.2%, LangSmith 7.1% vs 7.5%, multi-agent 13.1% vs 16.8%, CrewAI 15.8% vs 17.5%, LangChain 11.4% vs 25.7%, names the other framework 19.1% vs 3.2%, links to GitHub 17.0% vs 11.1%.
Share of X posts about each framework that mention a topic. Keyword match on post text, retweets excluded, collected in 2026.
09 — Section

Volume, reach, and how we collected this

LangGraph is talked about more. The LangGraph search returned 280 posts spanning 74 hours before the search had no further pages; in that same window ADK drew 101 posts, so LangGraph had 2.8x the volume. ADK's 481 posts spanned about 63 days.

ADK is climbing. ADK's weekly post count ran between 30 and 54 for most of the sample, then jumped to 122 in the last full week before collection. We did not test why; the jump overlaps the ADK 2.14 release on the GitHub releases page, but a single launch post or event could explain it too.

ADK posts reach further per post. The median ADK post earned 4 likes and 315 views; the median LangGraph post earned 1 like and 106 views, and 41.8% of LangGraph posts had no likes at all against 15.4% for ADK. More ADK posts carry media (53.8% vs 33.9%) and GitHub links (17.0% vs 11.1%), consistent with launch and tutorial posts rather than conversation.

MeasureGoogle ADKLangGraph
Posts in sample (distinct accounts)481 (369)280 (228)
Posts in the same 74-hour window101280
Median likes / median views4 / 3151 / 106
Posts in English75.9%71.4%

How we collected this. Question: what do X posts about Google ADK and LangGraph talk about, and how much attention does each get? Queries: ("google adk" OR "agent development kit" OR "adk-python" OR #googleadk) -filter:retweets, langgraph -filter:retweets, and a co-mention query naming both, run on /twitter/tweet/advanced_search with queryType=Latest, following next_cursor. Window: the most recent matching posts at collection time, collected in 2026. Sample: 961 posts in 50 requests (cost $0.14). Topic flags are case-insensitive keyword matches on the post text.

What the sample cannot show. It counts posts, not users or downloads, and it covers X only; the LangGraph sample spans a few days, so it can over- or under-state a normal week. Keyword flags miss posts that discuss a topic without naming it, and the bare word "adk" in the co-mention query can match unrelated uses (we kept only posts that also named LangGraph). Privacy: authors are mostly private individuals, so we report aggregates only, keep no post text, handles or IDs in the committed sample, and name no individual.

Left: bar chart of Google ADK posts on X per week, counted back from collection: 24, 30, 36, 34, 30, 54, 53, 36, 122, 62, with the first and last weeks partial and a jump to 122 in the last full week. Right: median likes per post, ADK 4 vs LangGraph 1, and share of posts with zero likes, ADK 15.4% vs LangGraph 41.8%. Median views ADK 315, LangGraph 106.
Left: weekly ADK post count. Right: engagement per post. Same 74-hour window: 280 LangGraph vs 101 ADK posts. Collected in 2026.
python
"""x_research_agent.py - the same X (Twitter) research agent in Google ADK and in LangGraph.

Both versions call one shared tool, search_x(), which reads posts from TwitterAPI.io's
/twitter/tweet/advanced_search endpoint and follows next_cursor. Reads need no X account.

    pip install requests google-adk langgraph
    export TWITTERAPI_IO_API_KEY=...   # from twitterapi.io/dashboard
    export GOOGLE_API_KEY=...          # only for the ADK version (Gemini via Google AI Studio)
    python3 x_research_agent.py langgraph "langgraph lang:en -filter:retweets"
    python3 x_research_agent.py adk "google adk lang:en -filter:retweets"
"""
import asyncio
import os
import statistics
import sys
from typing import TypedDict

import requests

BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_API_KEY"]}


def search_x(query: str, max_pages: int = 3) -> dict:
    """Search recent X posts. Returns up to max_pages x 20 posts with text, likes and views."""
    posts, cursor = [], ""
    for _ in range(max_pages):
        r = requests.get(
            f"{BASE}/twitter/tweet/advanced_search",
            headers=HEADERS,
            params={"query": query, "queryType": "Latest", "cursor": cursor},
            timeout=30,
        )
        r.raise_for_status()
        body = r.json()
        for t in body.get("tweets", []):
            posts.append({
                "text": t["text"][:280],
                "createdAt": t["createdAt"],
                "likes": t.get("likeCount", 0),
                "views": t.get("viewCount", 0),
                "author_followers": (t.get("author") or {}).get("followers", 0),
            })
        if not body.get("has_next_page"):
            break
        cursor = body.get("next_cursor", "")
    return {"query": query, "count": len(posts), "posts": posts}


# ---------------------------------------------------------------- LangGraph: explicit state graph
def run_langgraph(query: str) -> None:
    from langgraph.graph import StateGraph, START, END

    class State(TypedDict, total=False):
        query: str
        posts: list
        report: str

    def fetch(state: State) -> State:
        return {"posts": search_x(state["query"])["posts"]}

    def summarize(state: State) -> State:
        p = state["posts"]
        if not p:
            return {"report": "No posts matched."}
        likes = [x["likes"] for x in p]
        top = sorted(p, key=lambda x: x["likes"], reverse=True)[:3]
        lines = [f"{len(p)} posts, median likes {statistics.median(likes)}"]
        lines += [f"- {x['likes']} likes: {x['text'][:120]!r}" for x in top]
        return {"report": "\n".join(lines)}

    g = StateGraph(State)
    g.add_node("fetch", fetch)
    g.add_node("summarize", summarize)
    g.add_edge(START, "fetch")
    g.add_edge("fetch", "summarize")
    g.add_edge("summarize", END)
    app = g.compile()          # add a checkpointer here for durable, resumable runs
    print(app.invoke({"query": query})["report"])


# ---------------------------------------------------------------- Google ADK: model-driven agent with a function tool
def run_adk(query: str) -> None:
    from google.adk import Agent
    from google.adk.runners import InMemoryRunner

    agent = Agent(
        name="x_research_agent",
        model="gemini-3.5-flash",
        instruction=(
            "You research what people say on X. Call search_x with the user's query, "
            "then report the post count, the median likes and the three most-liked posts."
        ),
        tools=[search_x],      # a plain Python function becomes a tool
    )
    runner = InMemoryRunner(agent=agent, app_name="x_research")
    asyncio.run(runner.run_debug(f"Research this X search: {query}"))


if __name__ == "__main__":
    which, q = sys.argv[1], sys.argv[2]
    run_adk(q) if which == "adk" else run_langgraph(q)

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

10 — Questions

Questions readers ask

Is Google ADK better than LangGraph?

Neither is better in general. LangGraph is the stronger fit for long-running, stateful workflows that must resume after failures or pause for approval, and for teams that want to stay model- and cloud-neutral. Google ADK is the stronger fit for Gemini and Google Cloud projects, multi-agent delegation, A2A, and teams that need Java, Go, Kotlin or TypeScript as well as Python.

Does Google ADK have graphs like LangGraph?

Yes, since ADK 2.0 (generally available May 19, 2026). Its Workflow class takes edges whose nodes can be agents, Python functions, tools or nested workflows, with routing, fan-out and fan-in, loops, retries and human-in-the-loop. LangGraph still differs in how state works: a typed shared state with a checkpoint after every step.

Can I use LangGraph inside Google ADK?

Yes. ADK Python includes LangGraphAgent in google.adk.agents.langgraph_agent, which wraps a compiled LangGraph StateGraph as an ADK agent. You can also connect the two over A2A: ADK's RemoteA2aAgent can call a LangGraph assistant served by LangSmith's Agent Server at /a2a/{assistant_id}.

Does Google ADK only work with Gemini?

No. The ADK README says it is optimized for Gemini but model-agnostic and deployment-agnostic. Its examples and defaults use Gemini models, and the tightest integrations (Agent Runtime, Memory Bank, Vertex AI Search) are on Google Cloud, but you can run ADK in any container and call other models.

Do both frameworks support MCP?

Yes. ADK uses McpToolset with StreamableHTTPConnectionParams for remote servers (or stdio for local ones). LangGraph agents get MCP tools through LangChain's MCPAdapter (install langchain[mcp] 1.4 or later; the docs mark it beta). Both can connect to a hosted server such as https://mcp.twitterapi.io/mcp with a bearer token.

Which is cheaper to run, Google ADK or LangGraph?

Both libraries are free (Apache-2.0 and MIT). Managed hosting differs: Google's Agent Runtime lists $0.085 per vCPU-hour and $0.009 per GiB-hour with idle time between turns not billed; LangSmith lists Developer at $0 / seat per month and Plus at $39 / seat per month, with deployments metered in LSUs at $1.00 each. Model tokens are extra on both, and the cheaper choice depends on your workload.

Which framework has the bigger community?

LangGraph, by the measures we checked: about 44.8K GitHub stars against about 22.2K for ADK's Python repo, and 2.8x as many X posts in the same 74-hour window in our study. ADK's X volume was rising at collection time, and ADK spreads its community across five language ports.

How do I give an ADK or LangGraph agent access to X (Twitter) data?

Either pass a Python function that calls a REST endpoint such as /twitter/tweet/advanced_search as a tool, or connect the framework's MCP client to TwitterAPI.io's hosted MCP server. Reads need no X account and cost $0.15 per 1,000 tweets returned, against $0.005 per post read on X's pay-per-usage rate card.

11 — Further reading

Continue

Sources & further reading
More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.