About this project

BareAgent is a lightweight, zero-dependency agent orchestration library for Node.js that provides a think→act→observe loop for AI agents. Unlike heavier frameworks such as LangChain, CrewAI, or AutoGen, BareAgent focuses on composable building blocks rather than a monolithic framework, with the core importing nothing. Core capabilities include: - **Loop**: The central think→act→observe cycle that runs until a goal is complete, with opt-in seams for policy governance, context engineering, and transcript trimming. - **Planner & runPlan**: Breaks goals into a step DAG and executes steps in parallel waves with dependency awareness and per-step retry. - **recurse (RLM)**: A recursive decomposition primitive that decomposes hard tasks, fans out sub-tasks, verifies results, and synthesizes a final answer. Supports model-driven spawning, forced fan-out, and data-driven partitioning. Includes honest counting over corpora via scan-based retrieval that code-counts rather than relying on model-stated numbers. - **Memory**: Persistent storage and recall across sessions via a swappable Store interface (JSON, SQLite, or litextx). - **Governance**: Optional bareguard integration provides a single policy gate over all LLM and tool calls, with audit logging, budget caps, and human approval checkpoints. - **Resilience**: Retry with backoff and jitter, circuit breaker, and provider failover. - **Providers**: Supports OpenAI-compatible APIs, Anthropic, Gemini, Ollama, CLIPipe, and custom providers. All return a normalized shape with honest token/cost metrics, including prompt-cache tier reporting. - **Tools**: Any function can be a tool. Built-in web browsing (barebrowse), mobile control (baremobile), and shell execution. MCP Bridge auto-discovers MCP servers from IDE configs. - **Cross-language**: Can run as a subprocess from Python, Go, Rust, Ruby, or Java via JSONL over stdin/stdout. - **Streaming**: Structured JSONL events for real-time progress. - **Evaluator & refine**: Judge output by predicate, rubric, or agentic critic, with a bounded generate→evaluate→regenerate loop. - **Scheduler**: Cron or relative triggers with job persistence across restarts. - **Checkpoint**: Human approval gate with bring-your-own transport. - **Spawn**: Fork child agents with shared audit log and budget. - **Defer**: Queue actions for later execution by a waker. - **SkillRegistry**: Surface skills on demand via a meta-tool catalog. - **stash**: Compact finished work out of the live context window or auto-fold under token pressure. The library is designed to be lightweight enough to understand completely while being complete enough to avoid reinventing wheels. It ships with zero required dependencies; optional peers include bareguard for governance, better-sqlite3 for SQLite storage, and cron-parser for scheduling. Licensed under Apache 2.0.