[KongchangAI]
· 2 min read· 1,036 words

Running Agent Workflows on 80KB of RAM: tiny-langgraph Goes Open Source

Running Agent Workflows on 80KB of RAM: tiny-langgraph Goes Open Source

tiny-langgraph compiles Python workflows to C so multi-agent graphs run offline on microcontrollers with just 80KB of RAM.

tiny-langgraph is an open-source multi-agent engine inspired by LangGraph that compiles Python-written node-edge workflows into C for ultra-edge devices like the ESP32-S3 and ESP8266. It supports nodes and edges, multi-agent collaboration, contract-based inter-board communication, and MCP servers, with no cloud dependency. The tradeoff: compile-time topology limits runtime flexibility, and complex reasoning still needs the cloud. It's early-stage, and the author is seeking feedback from agent framework developers.

When Agent Workflows Meet Microcontrollers

In the cloud, frameworks like LangGraph make multi-agent collaboration easy. But if all you have is a microcontroller with just 80 KB of memory, can you still run the same kind of brain? A developer has open-sourced tiny-langgraph on Reddit, attempting to answer that with a yes.

It's a multi-agent engine inspired by LangGraph, and the core idea is to compile workflows written in Python into C code that gets flashed directly onto ultra-edge devices like the ESP32-S3 and ESP8266. The project is public on GitHub, and the author has explicitly asked for feedback from agent framework developers, with particular interest in workflow design and execution strategies in resource-constrained environments.

LangGraph is a framework in the LangChain ecosystem for building stateful, multi-agent applications. Its core abstraction is the "graph": nodes represent computation steps (such as calling a model or executing a tool), edges define control flow (including conditional branches and loops), and it supports persistent state and human-in-the-loop intervention. It typically runs on cloud servers or local machines with a Python interpreter and ample memory, relying on dynamic scheduling and runtime interpretation. tiny-langgraph borrows this node-edge graph abstraction but swaps the execution layer for compiled C code, reproducing similar workflow orchestration semantics on microcontrollers with no Python runtime.

What It Can Actually Do

According to the project description, tiny-langgraph supports several core elements of agent workflows:

  • Nodes and edges: the basic topology of a workflow, consistent with LangGraph's graph abstraction
  • Multi-agent collaboration: multiple agent nodes can work together on the same device or across boards
  • Contract-based inter-board communication: different hardware boards exchange information through agreed-upon interfaces
  • MCP server support: an entry point for connecting to a richer tool ecosystem

The key constraint is no dependence on cloud infrastructure. All workflow logic is compiled and executed locally on the device, meaning that even when the network is down, agents can still run through their predefined flows. This matters clearly for scenarios like industrial sensors and agricultural monitoring—they're often deployed in environments with unreliable connectivity.

ESP32-S3 and ESP8266 are low-cost Wi-Fi microcontrollers from Espressif. The ESP8266 runs at about 80 MHz with typically under 100 KB of SRAM; the ESP32-S3 is dual-core at 240 MHz, with vector instruction extensions and optional external PSRAM, and around 512 KB of SRAM. Neither is remotely enough to run a Python interpreter and a large model, but both are sufficient to carry compiled lightweight state machines and communication protocol stacks. The "80 KB of memory" constraint in the article roughly corresponds to the order of magnitude of usable RAM on these chips, and it also explains why the approach must compile to C and avoid dynamic memory allocation and interpretation overhead.

The Compilation Path from Python to C

Describing workflows in Python and then compiling them to C for execution splits usability and runtime efficiency into separate concerns. Developers orchestrate nodes and edges in a familiar Python environment, and the compiler converts that into C code suitable for microcontrollers, bypassing the resource overhead of running a Python interpreter directly on the MCU.

The cost of this path is flexibility. A topology fixed at compile time means limited room for dynamically adjusting workflows at runtime, whereas cloud frameworks can rely on interpreted execution and dynamic scheduling. When soliciting feedback, the author specifically mentions the direction of "constrained execution," which shows he understands the difficulty of dynamic behavior on microcontrollers.

Another highlight is contract-based inter-board communication. Multiple microcontrollers each run part of a workflow and collaborate through agreed interfaces, effectively splitting one large graph across several boards. This provides a foundation for distributed edge agents, but it also raises engineering issues like synchronization and fault tolerance, and the project has not yet disclosed implementation details.

MCP (Model Context Protocol) is an open protocol proposed by Anthropic for letting AI applications connect to external tools, data sources, and services in a standardized way. It defines message formats and capability discovery mechanisms between clients and servers, so agents don't need custom adapter code for every tool. Supporting MCP servers in tiny-langgraph means workflows on the device can theoretically call into the tool ecosystem through a unified interface, rather than hard-coding every tool's logic into the firmware; however, limited by MCU compute and memory, the scale and complexity of MCP services that can actually be connected will be noticeably smaller than in cloud scenarios.

How It Divides Work with Cloud Solutions

tiny-langgraph does not try to replace LangGraph. The 80 KB memory ceiling means it can only carry lightweight decisions: simple conditional branches, a small amount of state passing, short chains of agent interaction. Complex reasoning and large model calls still require more compute.

Its value lies in bringing the abstractions of agent architecture to the edge. Microcontroller programs have traditionally been mostly hard-coded state machines, with developers manually managing state transitions. If graph-structured workflows can run on MCUs, code organization will move closer to the modern agent development paradigm, making migration and reuse easier.

The project is currently at an early stage. The author has validated it on the ESP32-S3 and ESP8266, but community feedback, documentation improvements, and broader hardware support all need time. For engineers working in edge AI and embedded development, this is an open-source experiment worth watching—it explores a path few have taken before: landing agent workflows on devices with extremely limited resources.

Project URL: https://github.com/mak-ahoy/tiny-langgraph

One-line Summary

tiny-langgraph compiles Python workflows to C, letting multi-agent graphs run offline on microcontrollers with just 80KB of memory.

Paragraph Summary

tiny-langgraph is an open-source multi-agent engine inspired by LangGraph. Its core idea is to compile node-edge workflows written in Python into C code and flash them directly onto ultra-edge devices like the ESP32-S3 and ESP8266. It supports nodes and edges, multi-agent collaboration, contract-based inter-board communication, and MCP server integration, with no dependence on cloud infrastructure—workflows still run their predefined flows even when offline. The tradeoff is that topology is fixed at compile time, leaving limited room for runtime adjustment, and complex reasoning still needs cloud compute. The project has been validated on two chips and is at an early stage, with the author seeking feedback from agent framework developers.

#tiny-langgraph#LangGraph#multi-agent workflows#ESP32-S3#ESP8266#edge AI#MCP#microcontroller AI#open source
Share:

Related articles