langchain-quickjs
JavaScript REPL middleware for deepagents
What it is and what it does
langchain-quickjs is a middleware for deepagents that injects a persistent, sandboxed JavaScript REPL into an agent's tool set. Instead of the model issuing N serial tool calls, it can write one JavaScript block that orchestrates work in-loop—variables and functions persist across calls, Promise.all runs concurrent work, and configured subagents are dispatchable as await task({...}). The REPL runs in a QuickJS context with no ambient capabilities (no filesystem, network, or real clock), but can explicitly call into the agent's own tools via programmatic tool calling (PTC).
The middleware registers an eval tool, appends a system-prompt snippet explaining sandbox semantics, and gives each LangGraph thread_id its own QuickJS Runtime so conversations remain isolated. Persistence modes control how far state reaches: thread (default, survives across turns), turn (within a turn only), or call (fresh per eval). Each call has a wall-clock timeout (default 5 s) and the runtime has a shared memory limit (default 64 MiB); PTC calls are budgeted at 256 per eval by default. Results and console output are independently truncated before returning to the model.
Use it for:
- Loop over a list and call tools per item without round-tripping to the model between iterations.
- Run multiple independent tool calls concurrently using Promise.all and orchestrate filtering or aggregation in one eval.
- Dispatch multiple subagents in parallel, filter results, and synthesize them in JavaScript before returning to the parent.
- Compute intermediate state between tool calls (aggregate, dedupe, format) without leaving the REPL.
- Reuse state across several turns by persisting variables and functions in thread mode.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds a persistent, sandboxed JavaScript REPL tool to deepagents agents, letting the model write orchestrated JavaScript code instead of issuing serial tool calls.
Yes, if you are building deepagents-based agents and need to reduce model round-trips for orchestrated tool use. The low install friction, active maintenance, and permissive MIT license make it a straightforward addition. The 16-day-old release and alpha status mean expect occasional breaking changes; verify that the default timeouts and memory limits suit your workload before production use.
Install
langchain-quickjs on PyPI
pip
pip install langchain-quickjsuv
uv add langchain-quickjspoetry
poetry add langchain-quickjsInstalling langchain-quickjs
Before you install
Low friction: ships as a prebuilt wheel for CPython 3.11+ on macOS, Linux, and Windows. Active maintenance with recent releases; 27774 repository stars suggest established backing.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
from deepagents import create_deep_agent
from langchain_quickjs import CodeInterpreterMiddleware
agent = create_deep_agent(
model="claude-sonnet-4-6",
middleware=[CodeInterpreterMiddleware()],
)
result = await agent.ainvoke({"messages": [{"role": "user", "content": "..."}]})
Requires Python 3.11+; must use ainvoke (async) rather than sync invoke when PTC bridges are registered, or ConcurrentEvalError is raised.
Verify before relying
- Whether the 64 MiB default memory limit and 5 s timeout are tunable per-agent or only globally configurable.
- Exact concurrency cap for subagent dispatching mentioned as 'per REPL' but not quantified.
- Whether PTC host-function budget of 256 calls can be tuned or only disabled entirely.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — bsdiff4, deepagents, langchain-core, langchain, langgraph, quickjs-rs |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 198,124/month — #9,739 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_quickjs-0.3.5-py3-none-any.whl
Keywords: deepagents, javascript, langchain, langgraph, middleware, quickjs, repl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
deepagents-cliCommand-line tool for scaffolding, configuring,…
permissive · top 15,000 on PyPI
deepagentsDeep Agents is an opinionated agent harness…
permissive · top 5,000 on PyPI
quickjs-rsExecutes JavaScript code inside a WebAssembly…
permissive · top 15,000 on PyPI
langchain-cliCommand-line interface for building, testing,…
permissive · top 15,000 on PyPI
deepagents-codeA terminal-based AI coding agent that works…
permissive · top 15,000 on PyPI
langchain-modalIntegrates Modal serverless compute sandboxes…
permissive · top 15,000 on PyPI
quickjsWraps the QuickJS C library to execute…
unclear · top 5,000 on PyPI
deepagents-acpBridges Deep Agents with the Agent Client…
permissive · top 15,000 on PyPI
quickjs-ngEmbeds and executes JavaScript code within…
unclear · top 15,000 on PyPI