newloom-code — a coding agent woven from this framework
v0.10.27 — workflow + agent framework

Warp and weft
for agent systems.

A Python framework with two primitives held in tension. Workflow is the warp — the graph you hold taut. Agent is the weft — the loop you hand to the model. Thread either through the other; memory, budgets and audit follow the user_id across every pass.

classifyrouteagent.runas_tool
warp = workflow nodes · weft = agent pass
warp · workflow

You hold the graph.

A developer-controlled DAG. Nodes are functions, Agents, or other Workflows. Edges are decisions. Cycles are allowed, with a visit cap so a refinement loop can't spin forever.

weft · agent

The model threads across.

An LLM-controlled loop: it reasons, calls tools, reads memory, and decides when it's done. Twelve architectures from ReAct to Tree-of-Thoughts, swapped with one argument.

reads like pseudocode

Draw the flow, or hand it over.

support.py
from loomflow import Agent, Workflow

# two LLM-controlled specialists (the weft)
billing = Agent("Handle billing.", model="gpt-4.1-mini")
tech = Agent("Handle tech.", model="gpt-4.1-mini")

async def classify(text: str) -> str:
    return (await Agent(
        "Reply 'billing' or 'tech'.", model="claude-haiku-4-5",
    ).run(text)).output

# developer-controlled DAG (the warp)
support = Workflow.route(classify, {
    "billing": billing, "tech": tech,
})

r = await support.run(
    "My card was charged twice.", user_id="alice",
)
print(r.visited)  # ['classify', 'route_billing']

Compose both directions

Pass an Agent as a workflow node. Or call wf.as_tool() and the whole workflow becomes a tool the agent can call. The trace reads the same either way.

Branches and cycles

add_router branches on whatever the last node returned. Loops are first-class, bounded by max_visits_per_node.

Replay after a crash

Wrap with SqliteRuntime or PostgresRuntime. Completed steps are journaled; a resumed run picks up where it stopped.

what you get

Built for the second draft.

01

Workflow primitive

chain · route · parallel, or build the graph by hand. Cycles work; caps keep them honest.

02

Twelve architectures

ReAct, Plan-and-Execute, ReWOO, Reflexion, Self-Refine, ActorCritic, Tree-of-Thoughts, Router, Supervisor, Debate, Swarm, Blackboard.

03

Multi-tenant by default

user_id partitions memory, budgets, permissions and the audit log. Namespacing is automatic.

04

Composition both ways

An Agent is a valid workflow node; a Workflow is a valid agent tool. One observability spine.

05

Goal loops & guards

run_until= re-prompts until a condition is met; timeout= caps the whole run on the wall clock.

06

Streaming first

agent.stream() and wf.stream() yield events with backpressure. Wire to SSE or WebSocket.

07

Model agnostic, vision-ready

OpenAI, Anthropic, LiteLLM (~100 providers), Echo for tests. Image input on vision-capable models.

08

Typed outputs

output_schema= takes any Pydantic model; the result is parsed, validated, and re-prompted on a miss.

09

Durable replay

SqliteRuntime / PostgresRuntime journal each step; a resumed run skips completed work.

one pass through the loom

How a run is woven.

seed
instructions + promptuser_id partitionmemory rehydrate
weave
Agent · ReActWorkflow.chainSupervisorReflexion
dispatch
@tool functionsMCP serversfilesystem / bashvector retrieval
finish
episode + factsHMAC audit logOTel spans
woven with loomflow

loom-code. A coding agent, cut from this cloth.

A terminal coding agent built entirely on loomflow — living plans, memory, sub-agents, and the approval gate, composed into a daily-driver CLI. Works with any model, including free ones. It is both a product and the reference for the framework in production.

make all the tests in tests/test_parser.py pass
● loom
Two tests were failing on the new date format. I updated parse_date() to accept ISO-8601 offsets and added a regression case. 8/8 passing.
─────────────────────────── 41,882 in · 1,204 out · $0.0179
$ pipx install loom-code
any modelfree NVIDIA tierfull-screen chat UIsteer mid-turnimage pasteapproval gateper-turn cost
begin

One line to start weaving.

$ pip install loomflow