Melder LLM Harness

Melder is my most recent small LLM harness. It's an evolution/rename of agent.py. It shares the same minimalist, single-file philosophy but I've let it grow to over 1k loc (about 3x the size.) It's still one file but it's intentionally organized into a proper module now with all of the VTE output injectable. I still haven't fully decided on the interface so it's not documented but it's very short and you can just read it if you want to import it into your software.

As far as I can tell it's still the smallest serious agent harness available.

Agent Meld files

The "killer feature" of melder and its namesake is the "/meld" command. When you use /export to save your agent/conversation as a json file it will include all of the memories, conversation history, system command, and most importantly tools.

This means you have a simple file that includes not just the prompt but all of the custom software needed to make your agent do what it does. It's a very powerful idea and I think it could be very useful to a lot of people if it were widely adopted.

/Meld allows you to combine these with the current running agent (if you want to overwrite it just use the /new command first.) It's named after the special power the alien "Vulkan" race in Star Trek has where they can "mind meld" and share thoughts.

Other new features in Melder

Melder adds a number of other new features that distinguish it from the original agent.py.

Structured memories and "dreaming"

Agentnotes.md has been replaced with a structured list of memories. The "memory_save" tool now adds an entry to this list instead of appending to the markdown file. This is useful for the big new feature: "dreaming."

As an alternative to the /new command you can now use /dream which preserves much of the learnings of the current conversation with minimal context use. It performs the following sequence:

  1. Summarizes the conversation the same way compaction works (tool calls/responses other than from subagents are ommited
  2. Saves the summary as a memory
  3. Starts a "dreaming agent" with only a singular tool: memory_save, and the previous list of moemories as a user message with a system message directing it to topically coalesce all of the memories preserving dates and important learnings.
  4. Finally the conversation is cleared as if the /new command were run (so the new context just has the system prompt, dynamic prompt, and memory list.

I've found this is actually useful for coding agents and allows them to persist important information without having to recover it with every new conversation using subagents. It also has an extremely minimal impact on the useful model context since the memories are aggressively pruned (by default they are all discarded in the dream cycle.)

Making custom tools

Any python module can be added to your agent as a set of mcp tools using the /impor command. All of its top-level functions will then be presented as tools using python's built-in reflection. The docstring will be used as the description, kwargs can be used to provide defaults.

You can also use the /newtool command to interactively open a text editor to write such a module.

TODO: show an example tool.

Exporting, sharing, and melding agents

Experience with looping agents.

I have a small group of "looping" persistant agents. I use an external wrapper script "agents.sh" for this. One thing I've found to be very useful is giving them all mbox files and having them email eachother and me. This can be read directly in mutt (my usual mail client.)

I have most of them performing long-running research tasks and name them after these. I'm putting their names in lowercase because while they're proper nouns, much link unix tools they are computer software and often referred to by case sensitive file names (In particular their project directory or mbox files.) I think it's appropriate.

Initially these used gemma4 because I have the infrastructure to self host that. I tried GPT Luna a couple times and eventually found that Deepseek was actually the best. Since it's a batch job and Deepseek is so cheap the extra reasoning isn't a big deal.

buisnessagent

This was the first agent I tried creating. It was simply told to make money on the internet without breaking the law. It kept trying to make a website offering legal and advice so I repeatedly stepped in to stop it. One thing it managed to do on its own was make an externally facing email account so it could sign up for services on its own as well as generate a bitcoin key pair so it could pay for things/get paid. It never really got anywhere otherwise.

muse

I don't really go out much these days but when I did it was really hard to find things to do. I aggressively block ads and have pretty niche interests so it's hard for people to get my attention. This agent looks around Lynchburg/Virginia for events I might be interested in attending. I would have really loved this in my 20s. So far I think this one has produced the most value for me.

*quant

Despite the names only one of these, "zquant", actually does quantitative analysis. fquant does fundamental analysis using data from alphavantage. nquant Looks at the news for interesting events. hquant tries to compile all of their research into something useful.

hquant was actually very interesting because it would email the other agents on its own, directing them to look into new ideas. The others acted on its suggestions and replied with results too. It really demonstrated the potential for collaboration among these long running agents.

I'd say the output of their research was mediocre at best. I'm a little surprised since this is probably one of the more straightforward and well-bounded research tasks. Despite my total lack of formal training in finance I'm still able to outperform them. They're not even really faster than I am either.

zquant was probably the most disappointing. It's original goal was to try and find information in public data using z-transforms (hence the name.) It got things wrong and hallucinated a lot. At one point I emailed it demanding it plot and summarize the massive pile of research it had generated. Looking through the matplotlib output it sent me back things looked pretty rough; lots of stuff just sitting on the real axis, sparse matrices (sorry, "heatmaps") where everything except the diagonal was zero. I sent it an email questioning all of this and it freaked out once it realized how much of its data was hallucinated.

metagent

Meta agent is essentially a supervisor. I've heard Grok build (which was released a few months after I wrote agents.sh) has something similar but I've never used it.

One goofy bit of behaviour I noticed is that it would find itself and have a minor identity crisis. Almost every round I'd have to reenable it after it disabled itself. Eventually I hoisted it up out of the normal agent loop so it didn't see itself and it tended to behave.

How to use it

If you have llama-server running on port 8080 Simply download agent.py and run it.