AB
AiBoss
project

Headlong - Laude Institute's open-source AI Agent microframework

Headlong is an open-source AI agent micro-framework from the Laude Institute, with a core of only about 10,000 lines of Bash script. Its biggest breakthrough is persistent agency; the agent never 'sleeps,' requiring no wake-up calls or scheduled tasks, functioning like a human...

What is Headlong?

Headlong is an open-source AI agent micro-framework from the Laude Institute, with a core of only about 10,000 lines of Bash script. Its biggest breakthrough is persistent agency; the agent never "sleeps," requiring no wake-up calls or scheduled tasks, continuously thinking autonomously and self-driven like a human's inner monologue. Headlong can autonomously diagnose bugs, write fixes, and commit, collaborating with the entire team via Slack/Telegram, acting more like a shared digital colleague.

Head long's main functions

  • Persistent SubjectivityThe agent never goes dormant, continuously thinking autonomously like a human's inner monologue, without needing to be woken up or scheduled tasks.
  • shellm engineThe core of the recursive language model is to send the context to the LLM, run the returned Bash commands, and repeat the process.
  • traj trajectory systemUse an append-only jsonl DAG to fully record the Agent's entire thought and action history, supporting fork and merge.
  • Hierarchical context compressionThe entire trajectory is always preserved in context, but presented at an exponentially decaying resolution.
  • thinkers schedulerIt runs multiple reactive thought processes and autonomously decides what to think about next and when to respond to humans.
  • mem memory storageA file-based memory system allows agents to accumulate experience and knowledge.
  • Skills reuseThe processing flow of specific tasks is saved and invoked through the SKILL.md file.
  • Multi-platform collaborationSupports integration with Slack, Telegram, and built-in chat applications, allowing the entire team to share the same Agent mindset.
  • Docker SandboxThe generated code runs in a container by default, isolating risks and ensuring host security.
  • Self-improvementThe Agent can fork the codebase, modify and test it independently. If successful, it will be merged back into the main branch; otherwise, it will be discarded.
  • Real-time Dashboard: Observe the Agent's thought process, inner monologue, and action log in real time within the browser.
  • Multi-model supportIt is compatible with LLM providers such as Anthropic, OpenAI, Gemini, and OpenRouter through a unified CLI interface.

Headlong's technical principles

  • Persistent AgencyHeadlong's core design is to free the Agent from the traditional request-response model, allowing it to continuously generate ideas through a never-ending thought loop. As observations are injected into its thought process, the Agent autonomously decides priorities, when to respond, and whether to initiate new tasks. The background thought rate decays exponentially when there is no interaction to control costs.
  • shellm recursive language modelThe framework uses Bash as the "native language" of the Agent, sending the context to the LLM via the shellm engine, executing the returned Bash commands, and reading the output, forming a recursive loop of "think-execute-observe". Since the LLM naturally understands Bash, existing tools such as curl and jq directly act as HTTP clients and JSON processors, without the need for additional tool abstraction layers.
  • The trajectory is a DAG (Trajectory as DAG).The Agent's entire thought and action history is recorded as an append-only JSON file, forming a directed acyclic graph. This design supports forking (branching experiments) and merging (merging results), allowing the Agent to review the original state at any point in time and providing a version control basis for self-improvement—the Agent can fork the codebase, modify it, test it, and then decide whether to merge it.
  • Tiered Context CompactionTo address the context window limitations of long trajectories, Headlong employs an exponentially decaying hierarchical projection mechanism. The most recent entries retain their full text, while older entries are progressively summarized. These hierarchies also act as indexes, allowing the agent to retrieve the original content whenever needed, ensuring the trajectory remains "in context" throughout its entire lifecycle without being lost.
  • ThinkersThe thinkers module manages multiple reactive thought processes, coordinating different types of thinking activities, from responding to human messages to autonomously initiated observations and plans. The scheduler ensures that the Agent processes input from multiple channels such as Slack and Telegram within a single thought stream, autonomously deciding on the optimal next action based on the current state and memory.
  • Docker Sandbox ExecutionTo ensure security, the code generated by the Agent runs in a Docker container by default, providing a controlled execution environment through shellm-docker. The container is reusable to reduce restart overhead, and can also run locally without Docker, but explicit confirmation is required to ensure that potentially dangerous shell commands do not directly harm the host system.

Follow us on WeChat and reply with "open source",join inAI open source project discussion group

How to use Headlong

  • Mounting Frame:run curl -fsSL https://headlong.ai/install.sh | bash The installation is completed with a single command, during which you will be interviewed and your first Agent identity will be created.
  • Prepare the environmentEnsure that your system has bash 3.2+, git, curl, and jq installed, and that you have prepared the API key for Anthropic/OpenAI/Gemini/OpenRouter.
  • Start AgentAfter installation, the name you gave the Agent (e.g., ...) adaIt can be directly converted into a system command and is available at any time.
  • Send message:implement ada hello Sending a single message to the Agent and waiting for a reply will inject the message into its thought process rather than opening a new session.
  • Continue chatting:implement ada Enter interactive mode and engage in multiple rounds of dialogue with the Agent, with all content flowing into the same thought process.
  • Pause and Resume:implement ada stop Pause the agent's thought process.ada start Restore its autonomous operation.
  • Observational thinking:implement ada dash Open the Dashboard in your browser to view the Agent's inner monologue, observations, and action logs in real time.
  • Safety SandboxIt is recommended to run the installation process via Docker, so that the code generated by the Agent can be executed automatically in an isolated container, thus ensuring host security.
  • Emergency brakingIf an error occurs, execute... headlong-killall Terminate all Headlong-related processes on the machine with one click.
  • Submit feedback:implement ada bugreport Automatically package logs and track files, and anonymize the API key for issue reporting.
  • Docker running independently: Can be executed directly docker run The Agent is persistently run in a separate container using the installation script.
  • Uninstall and clean up:run curl -fsSL https://headlong.ai/uninstall.sh | bash It can completely remove all installed content.

Headlong's core advantages

  • Persistent SubjectivityAgents never go dormant, continuously thinking autonomously and driving themselves like a human's inner monologue.
  • Minimalist architectureThe core consists of only about 10,000 lines of Bash script. LLMs can think directly in Bash without the need for additional tool abstraction layers.
  • Complete memory preservationLayered context compression ensures that the Agent's entire lifecycle trajectory is always "in context," providing detailed information up close and concise details down further, while allowing for the retrieval of original details at any time.
  • Team sharing colleaguesA single thought process interface connects to Slack, Telegram, and the built-in chat, with the entire team sharing the same agent that proactively initiates communication.
  • Self-iterative evolutionThe Agent can fork the codebase, modify and test it independently, and merge it back into the main branch if successful. Laude has adopted 50+ of its commits.
  • Native security sandboxThe generated code runs in a Docker container by default, isolating potential risks and requiring no complex permission configuration.
  • Cost intelligent controllableBackground thinking speed decreases exponentially with no human interaction, running on demand for about $1-2 per hour, and instantly resumes full speed when a message arrives.

Headlong's project address

  • Project official website:https://www.laude.org/updates/headlong-a-microharness-for-persistent-agents
  • GitHub repository:https://github.com/laude-institute/headlong

Headlong's Competitive Product Comparison

Comparison Dimensions Headlong AutoGPT
Core Architecture A minimalist Bash micro-framework of approximately 10,000 lines, using Bash natively for LLM thinking. Python modular framework, tools require secondary encapsulation, and the architecture is relatively heavy.
Operating mode Persistent SubjectivityNever dormant, continuously engaging in self-reflective, internal monologue-style thinking. Task-drivenAfter inputting the target, the process is broken down and executed; once completed, the process will pause.
Interaction Model Messages are injected into the thought process; the agent autonomously decides when to respond and whether to proactively contact you. The session boundaries are clear: user inputs the goal → agent executes → returns the result.
Memory mechanism Complete trajectory DAG + hierarchical context compression, traceable throughout the entire lifecycle Vector databases with short-term memory are prone to data loss or inaccurate retrieval over long periods of time.
Tool System Zero abstraction, native capabilities of system tools such as curl/jq Requires predefined utility functions and depends on plugin extensions.
Teamwork A single thought process; multiple platforms including Slack and Telegram share a single agent. Single-user session, no native multi-user sharing mechanism
Self-improvement Built-in fork/test/merge workflow, with 50+ commits contributed. It can generate code but lacks built-in version control and verification loop.
Deployment threshold Install with a single command; Docker sandbox is enabled by default. You need to configure a Python environment, vector library, API Key, etc.

Application scenarios of Headlong

  • 7x24 Intelligent Code Review and Self-RepairThe agent continuously monitors the codebase, autonomously discovers pipeline bugs in the early morning, diagnoses them, writes fix code, runs end-to-end verification, and submits a commit, all without human intervention.
  • Cross-platform team collaboration hubAs a shared digital colleague, you can access Slack/Telegram to observe the work progress of each member, proactively connect with relevant people, summarize project status, and push key information in a timely manner.
  • Continuous operation and maintenance monitoring of infrastructureIt continuously reads server logs and metrics, autonomously identifies abnormal patterns, and executes repair scripts in containers, upgrading from passive alerts to proactive self-healing.
  • Personal knowledge management and in-depth researchIt allows users to continuously read, summarize, and connect scattered information, prioritize information based on their interests, proactively push important discoveries, and build a searchable personal knowledge trajectory.
  • Open source project community automatic maintenanceAutomatically categorizes Issues, reviews PRs, updates documents, and answers frequently asked questions, maintaining project health 24/7 and reducing the burden on maintainers.