Hermes Compaction: Setup Step By Step

Julian Goldie — founder, AI Profit Boardroom
By Julian Goldie · 7 min read
Get The AI Profit Stack Join AIPB →
🎯 1,000+ done-for-you AI agent workflows 📅 4 live coaching calls every week 🛡️ 7-day refund + 30-day ROI guarantee 👥 3,400+ AI operators inside

Hermes compaction is how Hermes Agent shrinks a long conversation so it fits inside your model's context window: once a session hits the trigger, a separate summary call folds the older messages into one summary and keeps the newest messages word for word. It runs on its own by default, you can force it with /compress, and the v0.22.6 release added an opt-in setting called prepare_ahead that writes the next summary before you need it.

📺 Watch: 20 Hermes Agent Tips to make it 10X better!

🔥 Get the Agent OS as a free bonus: AI Profit Boardroom members get the full Agent OS zip, prompt libraries, daily tutorials and weekly live coaching calls. → Get inside

Hermes Agent is built by Nous Research. Everything on this page comes from the official Hermes docs and the v0.22.6 release notes published on GitHub on 2 November 2026.

If you want the copy-paste setups our members use to keep long agent sessions fast, they live inside the AI Profit Boardroom ($69/mo). If you want help planning how agents fit into your business, book a free AI strategy session.

What Hermes compaction does

Every model has a context limit. A long chat full of tool calls, file reads and terminal output fills that limit fast. When it gets full, the model slows down, costs more per turn, or stops answering.

Hermes fixes this by compressing the conversation. The docs call the feature context compression; compaction is the moment it fires. Here is the flow:

The summarizer is its own model call. By default it uses your main chat model. You can point it at a cheaper or faster model under the auxiliary compression settings, with auxiliary.compression.model and auxiliary.compression.provider.

Old turns are not thrown away. With the default compression.in_place set to true, the session keeps the same id and the pre-compaction turns are soft-archived under it. They stay searchable through session_search.

When Hermes compaction triggers

There are four ways a compaction starts.

  1. The size trigger. compression.threshold defaults to 0.50, so Hermes compresses at 50% of the model's context limit.
  2. An absolute cap. compression.threshold_tokens is off by default. Set it and Hermes compresses at whichever comes first, the ratio or the token count. The docs give 256000 as an example for compacting a 1M-window model at 256K instead of 500K.
  3. The idle trigger. compression.idle_compact_after_seconds is off by default. Set it to 1800 and a session you come back to after 30 minutes compacts before the first reply, so an old Telegram thread does not re-read its whole stale history every turn.
  4. Manual. You type /compress.

Automatic compaction is silent on chat platforms like Telegram, Discord and Slack. Turn on compression.progress_notices if you want to see the start and finish notices there. Failure notices and /compress feedback always show.

One edge case: if a plugin's pre_llm_call hook blocks a turn, that turn skips compaction completely. The hook runs before turn-start compaction. We cover that hook in our Hermes Agent hooks guide.

📺 Watch: Hermes Agent Just Got a FREE Second Brain!

Hermes compaction config keys

All compression settings live in config.yaml. There are no environment variables for them. These are the keys most people touch, with the defaults from the docs.

KeyDefaultWhat it does
compression.enabledtrueTurns compression on or off
compression.threshold0.50Compress at this share of the context limit
compression.threshold_tokensnullOptional absolute token cap; the lower trigger wins
compression.target_ratio0.20Share of the threshold kept as the recent tail
compression.tail_modeleanHow much recent history stays verbatim
compression.protect_last_n20Minimum recent messages kept uncompressed
compression.protect_first_n3Opening messages pinned across every compaction
compression.in_placetrueKeep the same session id after compaction
compression.idle_compact_after_seconds0 (off)Compact a session that resumes after this much idle time
compression.prepare_aheadfalseWrite the next summary in the background before the trigger
compression.proactive_prune_tokens0 (off)No-LLM prune of old, bulky tool results

A few notes on these:

Compaction is one half of keeping a session lean. The other half is what Hermes stores in memory, which we cover in the Hermes memory budget guide.

📺 Watch: NEW Hermes Agent Updates are INSANELY GOOD! 🤯

Using /compress for manual Hermes compaction

The /compress slash command compacts on demand. The docs list three forms:

Use it before you switch tasks inside one long session. Finish the research, run /compress with a focus on the findings, then start the build. The build turns get a short summary instead of fifty tool results.

In Bot Mode, each Bot in a group room has its own hidden room session. Group settings has a Compress history button per member that runs the same compression as /compress against that session.

Hermes compaction with prepare_ahead

This is the new part. The v0.22.6 release notes list "opt-in prepared compaction (compression.prepare_ahead)" in the window since v0.22.5.

What prepare_ahead does

Normally the summary is written at the moment compaction fires, so that turn waits on an extra model call. With compression.prepare_ahead set to true, Hermes writes the next summary in the background once the session gets close to the trigger. It does this while tools run and between turns.

When automatic compaction fires, Hermes checks the prepared summary still covers the same messages. If it does, it uses that summary instead of making a fresh summary call. Every message newer than the summary stays outside it, in the uncompressed tail.

The rules from the docs:

What prepare_ahead costs and where it does not apply

Turn it on if your long sessions stall at the compaction turn and you are fine paying for a summary that sometimes goes unused. Leave it off if you run a memory provider that injects context into summaries, or if you mostly compact by hand.

How to get the new Hermes compaction setting

The release notes split it by install type:

Then add prepare_ahead: true under the compression block in config.yaml and start a new session.

If you are setting Hermes up for a team or a client and want a plan for models, memory and compaction together, grab a free AI strategy session. For the full map of how agents, skills and memory fit into one system, read the Agent OS guide. To see how different models handle long agent runs, Julian keeps his own model tests on Goldie Bench.

Hermes compaction FAQ

Does Hermes compaction delete my old messages?

No. With in_place set to true, which is the default, the pre-compaction turns are soft-archived under the same session id. They are marked inactive but stay searchable with session_search.

Can I use a cheaper model for compaction summaries?

Yes. Set auxiliary.compression.model and auxiliary.compression.provider. Leave the model empty to use your main chat model.

Does prepare_ahead work with /compress?

No. The docs say prepare_ahead does not apply to manual /compress, plugin context engines or native compaction. It only feeds automatic compaction.

Is prepare_ahead on by default?

No. It defaults to false. You opt in with compression.prepare_ahead set to true in config.yaml.

Want the setups, templates and weekly calls that keep your Hermes agents running? Join the AI Profit Boardroom. Want a one-to-one plan for using AI agents in your business? Book a free AI strategy session.

What members say about the AI Profit Boardroom

Read all 114 reviews on Skool →

★ 4.9 out of 5 from 114 member reviews on Skool

Yosuke Sato, AI Profit Boardroom member review (5 stars, paying member for 17 months): The best Skool course you get for AI! I have attended a few Skool courses before, but AI Profit Boardroom is the most active community and has great support from the management team, including Julian! You can get the most up-to-date information and practical implementations in this community. I highly recommend this!Mazzie T, AI Profit Boardroom member review (5 stars, paying member for 10 months): My mind is blown everyday with all the content and the incredible information. So much support and I love the personalised attention and quick responses. The community is great and people are very responsive and helpful.Rene Clayton, AI Profit Boardroom member review (5 stars, paying member for 9 months): The AI Profit Boardroom is a GAME CHANGER people. I could not be more thrilled that I joined!! So much support, more information than you can even consume, a huge value for what the small fee was. I have grown my business, my knowledge and my FUN!. SUCH a fantastic leader and group of humans. I am incredibly honored to be a part of this fantastic group of intelligent humans :-) THANK YOU!Arpiet Malpani, AI Profit Boardroom member review (5 stars, paying member for 8 months): Incredible learning from Julian and team. I started out in march and was able to build end to end SAAS with the help and learning from this group. I am incredibly thankful to Julian for crazy support and prompt response.James Grimm, AI Profit Boardroom member review (5 stars, paying member for 7 months): I asked Julian for help finding local business websites with little to no traffic. Julian was gracious in providing me my personal "how-to" video instruction. Wow, this is the pinnacle of customer service! I am just one of 3,400 subscribers and Julian took the time to help me personally. Thank you Julian for your assistance and outstanding custoemr support and care. James (Jim) GrimmNick Good, AI Profit Boardroom member review (5 stars, paying member for 4 months): I’m part of many AI groups and hands down, what Julian Goldie, has built here…the classroom trainings are amazing, but the community he has created is second to none (the community is worth the cost of joining!). If you’re looking to become the AI expert and build/create something meaningful, then AI Profit Boardroom is for YOU!Steven Gray, AI Profit Boardroom member review (5 stars, paying member for 4 months): Been in awhile. I’m a dad on a factory shift, not a tech bloke. Julian’s lot showed me how to use AI without drowning in tools. Avatar, voice, the workflow thinking — that’s what I needed. If you’re stuck on “where do I start,” this group’s worth it. I always read them.Steve Erickson, AI Profit Boardroom member review (5 stars, paying member for 4 months): I asked Julian a simple question, and he ended up creating a 10-minute video and a guide breaking down in extreme detail what I had asked. Amazing response!Rod Martin, AI Profit Boardroom member review (5 stars, paying member for 3 months): Julian is brilliant, and more prolific than I can keep up with (which is a great thing). His AgentOS is remarkable, and he is THE go-to guy for what you can really do (and not do) with the ever-increasing deluge of new AI upgrades and tools. HIGHLY recommend.Daniel Shulman, AI Profit Boardroom member review (5 stars, paying member for 4 months): Julian is very helpful. He doesn't try sell stuff you dont need and will give you a straight answer to your questions.Rj Herzog, AI Profit Boardroom member review (5 stars, paying member for 5 months): Top notch. If you are searching & searching thinking there is always something better out there.... You just found it. No need to look any further. Goldie covers it all & is super helpful. Can't beat the group either. Really can't recommend this group enough.Jermey Matthews, AI Profit Boardroom member review (5 stars, paying member for 6 months): While he has the capacity to do it, Julian is definitely doing the unscalable things to support his community.

Ready To Join The #1 AI Community?

Join 3,400+ entrepreneurs inside the AI Profit Boardroom. Get the Agent OS, 1,000+ plug-and-play AI agent workflows, daily Q&A with Julian and 4 live coaching calls every week.

Join The AI Profit Boardroom →

7-Day No-Questions Refund • 30-Day ROI Guarantee

← Back to all posts