Headlong: A microharness for persistent agents
Comments
MikhailTal
embedding-shape
I'm curious, you say "super interesting engineering" but then they say "it will often just tell you, even though we’ve asked it not to" and to me that seems like extremely shit engineering.
Where are the interesting engineering parts at? Seems to be an interesting idea and perhaps design, but to call the implementation/engineering itself bad seems to be an understatement.
fc417fc802
The security and the overall engineering were entirely separate items in that comment I think. It was explicitly called out that this is a security problem that you'd really only see treated in this manner in the LLM space. For what it's worth it's effectively unsolvable (AFAIU) short of realizing AGI with an amicable alignment.
embedding-shape
What do you mean unsolvable? Don't give the LLM access to stuff it shouldn't, this is like Access Control 101, not sure how anyone can claim that particular problem is unsolvable?
fc417fc802
Just don't give the hammer access to the nails they said ...
bbor
Good engineering means optimizing the things you care about, at the cost of things you don't. In this case, secrecy doesn't matter kinda inherently.
It's like criticizing Reddit for not handling SSNs well; the intended design is 'just don't do that, cause you'd never have a reason to, anyway'
rendaw
If secrecy doesn't matter, why did they tell the agent not to divulge stuff in the first place?
andyk
Should maybe have said more loudly in the posts that this is not intended to be disciplined engineering (or used in prod!) we did think about the architecture quite a bit and we've tried a bunch of different things out. We are fully optimizing for velocity of research experimentation and iterations on the design vs engineering hygiene
i've been playing with the project and idea for years now. the codebase started as javascript plus supabase before reasoning models were a thing (i incorrectly predicted the world would call reasoning models Large Thinking Models - bahaha). at one point the focus was almost entirely on a really easy-to-use human prosemirror UI for editing the agent's thought stream--because the models were still so bad at reasoning at that time.
then we pivoted to all bash at some point since it simplified things and i have this hypothesis that the LLMs will do better if as much of its world as possible is command line operations (inspired by terminus the agent we built as part of the terminal bench project)
the bash implementation is entirely written by coding agents - the human time goes into iterating with an AI agent on the design docs in the ./design folder
re security model - i think of the project as a research experiment about what it's like to treat an agent more like a person - so for secrets you have to trust its judgement about what it will share or if it will betray your trust. I don't know the OpenClaw architecture in great depth but my sense is that none of the LLM based agents that can interact with multiple people have strong guards in place that prevent the agent from leaking secrets between people. Definitely an interesting area for research though!
so yeah security is not a priority in this research per se - easier to assume you don't share sensitive things with a headlong agent
Along those lines, because we keeping it research and optimizing the velocity with which we can try new things out, the current aim isn't necessarily to get a bunch of community contributions. but if we do start to get any i'm thinking we will actually require people to only create PRs with design docs (no code allowed) and maybe even also require the logs (or at least the human prompts and the agent's responses) from the coding session where they created the design doc.
maybe i should write up the history, philosophy, and big picture aims of the project at some point
jeffsheldon
The part they punt on ("we haven't studied what happens when two people give conflicting instructions") is the interesting part. That's not a memory problem, it's an authz problem. If everyone writes into one shared stream then there's no model of whose instructions bind the agent or who can override whom. It's resolving the conflict that will generate the greatest "learnings" and advance the agent. This basically becomes a tool designed to misbehave rather than a tool that will learn creatively.
We all know how conflicting instructions to AI end - "I'm sorry Dave. I'm afraid I can't do that"
goodra7174
[dead]
theturtletalks
A lot of harness launches recently but this one actually stood out to me. Just like the Prime Intellect harness that launched recently, this one also leverages RLM (recursive language model). It’s supposed to allow a persistent agent.
The specifics are really interesting. The model itself can change the user input and when you message it, it gets entered into “its stream of consciousness.”
I have a software factory going with Pi, might swap the main orchestrator with Headlong and have it be persistent to drive the other sessions without me.
ekabod
What do you mean by "software factory"?
ffsm8
Aka vibecoding platform.
A software that's optimized for agentic development, varying levels of review necessary depending on the technical choices of the factory developer. Some review may be automated via agents itself etc.
Ymmv obviously. Its definitely one of the funnest toy projects I've been working on for the last 5-7 months now (such a factory, mine is unreleased however - just for myself as of today)
vedtam
"turn -> FINAL -> schedule wake-up", this is where my excitement has faded unfortunately. Many of us are probably wondering about the same idea: bridging the gap between a reactive agent and my daily workflow or existence. But, this still feels too close to how Claude (or any other agent) runs as a process in the background (always ON), where you can use a custom channel to feed the dialog with external signals like chat, CI/CD events, whatsapp, etc.
Humans aren't scheduling a wake-up to the next thought. Ideally, a sub second agentic loop with no FINAL / wake-up, always "spinning" would get closer. I'm conscious about the waste of resources this would drag with it (because of current architectures), but exciting still.
PS. I love the take on using bash instead of Python (one less abstraction layer!) and using UNIX fundamentals as stepping stone when composing tools as agents are naturally drawn to using it on a box anyways.
andyk
fair point. the headlong agent running on my mac mini, cleo, doesn't pause between calls to "generate next thought". for a while the implementation didn't support pausing between thoughts. a `thinker`, which is where the thinking loop lives, only had a boolean variable `self_trigger`, which caused it to recursively fire itself to run again (ie immediate generate the next thought). We added the ability for it to slow down its thinking and prep for sharing it with the world since it makes it easier to leave it running and not have it spend a few hundred dollars a day and you can still observe the same mechanism, which is the heart of what we want to get at here:
I don't think the blog post fully conveys this, but for me it's not whether there's a pause between thought generations, but instead whether the agent is designed to stop after some human-set goal is achieved to wait for more instructions
In contrast the idea here was to force the agent to pick its own next goal (even when it receives no explicit tasks from a human) -- even if that goal is implicit -- and then watch and see what it picks (or at least what it does with its time). and then figure out what sort of mechanisms we can introduce to the architecture at that outermost life/goal picking loop
bbor
AFAIU, that's basically impossible with a typical transformer architecture. The "recursive" transforms mentioned above are indeed a little closer, but still. You could just always start a new inference after the last one finishes, of course, but that feels more like a really fast, one-sided conversation than a real approximation of the modality/lifecycle of human consciousness.
I think the main answer to this concern is that humans are absolutely scheduling wake-ups on a cognitive level -- the best example may be, y'know, sleep! But also on a moment-to-moment basis, which is especially noticable during periods of boredom.
Think of the head LLM as you, and the workers as your subconscious faculties (e.g. the part of you that knows how to ride a bike in ways that you have never had to consciously articulate). The looping part is the unconscious substrate that makes all of that possible, arguably with some room for the faculty above you (metacognition) to control what gets presented to your conscious mind and when. The vast, vast majority of input never makes it that far tho, by design.
(ETA: ...so, that means that we don't need to fundamentally change the architecture of LLMs in order to get some really scary stuff going.)
pm25coder
[flagged]
yewenjie
Are there any objective metrics/ benchmarks that people test harnesses by?
There are just so many now that it's hard to personally test them all or just trust the vibes.
andyk
andy here (headlong post author). terminal bench 3 is pretty popular for comparing different harnesses using the same underlying model (it's another laude project actually). artificial analysis has an index. you can look at the model cards of popular model releases- they tend to have the most popular current benchmarks on them. w/ headlong we decided to announce it before we've benchmarked it. we mostly wanted to informally share our experiences w/ it in this initial post. we plan to do some benchmarking coming up here soon tho
embedding-shape
Don't use any public benchmarks, every single one is worthless for your own use cases essentially.
Spend a day or two going through your existing chat sessions, and create your own private benchmark with test cases based on real tasks, that you don't share with anyone nor publicly. Make it easy to add/remove new harnesses and model combinations, make it give you a final score, ideally avoid using other LLMs for scoring, then use this to figure out if the new model/harness actually improves things for you.
I've been doing this for some time, and while most new releases show big increases in the benchmarks/evaluations, my own benchmark usually barely moves.
krashidov
> make it give you a final score
what does this mean exactly? A scored based on what?
embedding-shape
For translations, the score is basically 1 or 0. For some tasks, the least amount of LOC gives the highest score, and so on. Basically, you need to figure out how to score it, so you can compare scores across agents/models.
walrus01
Can we please not normalize telling people to install things by curl piped into bash? I hate this trend. And particularly not for a very new, mostly untested by a wider audience piece of software from a company that few have ever previously heard of.
It even says, quoting from the website: "Headlong is alpha research software."
Yeah that's totally something I want to curl thing.sh | bash , great idea.... Wow.
I understand that people want to get people using their software as quickly as possible and with the absolute minimum of friction, but let's put some more thought into how this could be done in a less sketchy way.
It's like we've regressed to the days when you would download a .exe file from tucows and blindly run/trust it on your windows 98SE PC.
aacid
You can always read the script file (orm ore realistically feed it to agent). If they distributed appimage or rpm would that be safer anyhow? Cannot it run malitious code same as the script would run?
Systemerror7A69
One of the big problems is that no one actually does read these scripts. You could say "Oh but it's their own fault, duh" but theres a very legitimate argument to be made users going the path of least resistance and that you shouldn't offload this responsibility on your users.
Regarding appImage or rpm, attackers need to build and package these to inject these, while this curl | bash pipe opens up the possiblity of payloads simply by taking over the domain. And this isn't really that far fetched, just think about the Notepad++ update payload recently. The regular package was unaffected while the domain used for the update was taken over.
Then theres also the argument about normalization. Just like he said, this isn't just something he said, this is a very real argument. You don't want to teach users bad habits. Even if / you / inspect the code you get, not everyone will. And ultimately, we should strive to make the Internet a safer place, if only to get less botnets.
indstinctdialog
This is the same as terms of service agreements. There's a crowd mentality around it where only one person with enough of a voice needs to read it and scream. It's brittle because if everyone thinks that then nobody checks it but the probability scales with the attention it gets.
Totally agree we should make the internet safer, this is just a clarification that we don't necessarily need everyone to check it. One person who always checks everything and sends this to their LLM and posts a viral post can be a deterrent.
The installer is one threat. You're then running this on your machine which is the next threat.
walrus01
> You don't want to teach users bad habits.
Take a look at the screenshots here for one example of getting non-technical users to paste things into the equivalent of bash:
https://www.tilburguniversity.edu/about/conduct-and-integrit...
b5n
> no one actually does read these scripts
I do.
forestcall
Really hard to support these types of projects without subscription options. BYOK API only approach can run huge amounts of money. I budget for $200 Pro subscriptions. Just using Openrouter for a dark factory kanban ticket system using frontier models will run you $50-$150 which is about 1 ticket.
gandreani
What is a dark factory in this context?
weinzierl
The language composition is interesting. The source is half Shell, a quarter Python, almost a fifth Typescript. Among the rest is 2.3% Rust and 1.3% Swift.
If you wonder what the Rust is for: It is the Ratatui TUI.
tesnorindian
Looks very interesting. Best suited with Local LLMs with unlimited tokens.
jnwatson
It buries the lede. Prime Agent sounds like a very cool project.
ma2kx
I'm just exhausted. So I've today now learned about four new harness:
https://github.com/exoharness/exo/
https://github.com/laude-institute/headlong
https://github.com/microsoft/agent-lightning
and now https://github.com/PrimeIntellect-ai/prime-agent
Of course the don't have exactly the same scopes but they are in general all about persistent memory and / or continous agent loops. Like I miss those times where only once a week a new js framework was promoted.
NicoJuicy
Used an llm to re-order my stars on github into appropriate lists ( it became a mess after LLM and the different type of projects).
I had all of those projects already in my favorites except Headlong. Arround 4k+ stars.
And probably WIKI ingested 300 of them for recipes and best practices.
Haven't used the WIKI yet though...
airocker
Sub Question : IS there a real successful agent product today that uses a library for harness(like langgraph etc)? Building our own worked for us. Works with our components(postgres, events ...) and scales naturally with our system.
gexla
I don't know about real successful. Since you mentioned Langchain, you could look at https://www.langchain.com/dcode which is a CLI harness build off Langchain deep agents.
JacobAsmuth
The Googlers must be vague posting about something internal.
weinzierl
The page has a nice little easter egg if you click "Dr. K" in the footer.
tesnorindian
+1
efitz
It’s written in 10k lines of bash? Why?
docheinestages
But did it produce anything meaningful? If so, show me.
walrus01
the webpage says: "Your agent keeps thinking between external interactions in a self-guided loop inspired by human inner monologue"
Since supposedly it keeps thinking when you leave it alone, I wonder what happens if you give it a brief prompt like "research the unicode eggplant emoji" and then ignore it for a week, and come back to find that you've spent thousands of dollars for claude to write a 385 page novel about the eggplant emoji.
0xbadcafebee
> Audel designed experiments to spawn recursive shellm sub-runs to work on subproblems. Most of the experiments failed, because shellm has a safety watchdog that kills any command that stays silent for 30 seconds. Audel fought the watchdog for about 40 minutes and mostly stopped using shellm sub-runs. Results from recursive sub-runs of shellm merged back into Audel’s mind 64 times in its first two days and 12 times in the twelve days since. We’ve since revamped the watchdog, and we’ll see if we can convince Audel to give recursion another shot.
This is why "I made it think in a loop" doesn't result in significant improvement in LLM performance. It's not learning. You need RLAIF, STAR, IDPO, etc to retrain the model to learn from its mistakes. And you need a human to review it so it's not compounding mistakes. It's expensive and time-consuming. Doing it wrong leads to bad outcomes. But not doing it leads to no significant improvement.
dominotw
> inspired by human inner monologue
most of the training data is the output of inner monologue. ie ppl dont write their inner monologue on the internet( not as often anyways).
inner monologue isnt just thoughts that you keep to yourself. There is a different stucuture and meaning to it. isnt it?
imagetic
that imaginary line. this crossed it.
bbor
Every Headlong agent has a name and at Laude we named our shared agent Audel. We’ve spent the last few weeks interacting with Audel over Slack, Telegram, and a mobile app. Many team members talk with Audel, and each of those conversations shows up in the agent’s single stream of inner thoughts. The agent decides if and when to respond. It sets its own interests and priorities, and it comes up with its own projects.
P(doom)++deadbabe
Harnesses really are the new 'javascript framework' aren't they?
metrofun
We need "React" moment, to solve imperative O(n^2) state transitions with declarative O(n) target states, and let the harness do the "diffing"
Hyperlisk
I literally just wrote about exactly that https://nicktrevino.com/your-repository-is-your-swarm.html
andyk
> bingeineering
i'm gonna start using this
simianwords
Why compress by recency rather than something else?
andyk
because it seems like the human mind does this and it was easy to start with. The human mind obviously also compresses by other dimensions so we'll keep experimenting
suggestions for what to try next?
russellbeattie
> "Headlong is a complete agent harness with a core of less than 10K lines of Bash..."
Wow. So, be nice or I'll replace you with a very large shell script?
janeabegail1
[flagged]
manganate06
[flagged]
13639366668
[flagged]
falcon_tech
[flagged]
TokenLat
[flagged]
runtime_lens
[dead]
luciana1u
[dead]
Very fascinating, super interesting engineering. Although i do find it very funny how they just bypass a massive vulnerability, basically zero data isolation (even between good actors, let alone bad ones) with 3 sentences. Only in the llm space you can slap a massive limitation like this in the middle of the article and continue like nothing happened
> Whatever anyone tells Audel becomes part of the single experience that every other conversation draws on. In practice, Audel is bad at keeping secrets. Ask it what it’s been working on with someone else and it will often just tell you, even though we’ve asked it not to. We also haven’t studied what happens when two people give conflicting instructions. For now, we assume anything you tell Audel is shared with everyone on the team.