I thought my agent needed a huge soul.md until a 52-word file worked better
I used to think better agent behavior came from a bigger soul.md. You know the file: tone rules personality rules edge cases values backstory workflow preferences weird little reminders you swear matter It starts as
I used to think better agent behavior came from a bigger soul.md.
You know the file:
- tone rules
- personality rules
- edge cases
- values
- backstory
- workflow preferences
- weird little reminders you swear matter
It starts as βjust a few notesβ and ends up as a 1,500-word manifesto that gets injected into every run.
Iβve built that version. It feels smart for a while.
Then the agent gets more obedient and less useful.
It starts protecting its persona better than your actual state.
And after looking through a couple OpenClaw threads, I think the better pattern is much simpler:
- tiny
soul.md - markdown save files for canonical state
- retrieval with something like LanceDB
That setup is less glamorous than a giant prompt. It also works better.
The comment that killed the giant-prompt myth for me
In an r/openclaw thread about writing a soul, one commenter said:
Have your AI write it. Also it barely matters. Agent and memory files matter.
Thatβs a rude sentence if youβve spent hours polishing a persona file.
It gets worse.
Another user said their soul.md was just 52 words, and theyβd been working with that agent since January.
Fifty-two words.
Thatβs enough to define role and tone. Not enough to pretend the file is a database, CRM, runbook, and autobiography at the same time.
That matches what I keep seeing in real agent setups:
- short persona
- deterministic saved state
- retrieval for relevant context
Not the other way around.
The best example I found: an OpenClaw Dungeon Master
The clearest proof came from another OpenClaw thread where someone built a Dungeon Master agent.
What mattered wasnβt a better soul.md.
It was architecture:
- structured directory layout for hard saves
- local LanceDB vector search as memory-core
- local markdown copies of the D&D 5e SRD
Thatβs the important distinction.
The agent wasnβt βrememberingβ because the prompt was poetic.
It was remembering because state lived outside the prompt and retrieval pulled in only what was relevant.
Thatβs a much better design for agents that have to survive real use.
Whether your agent runs a campaign, triages support, handles Discord ops, or executes an n8n workflow all day, continuity usually comes from memory architecture, not prompt theater.
Why giant prompts underperform
A bloated system prompt tries to solve every problem in one place:
- personality
- policy
- memory
- workflow rules
- examples
- special cases
- historical context
So every request drags around the same giant instruction block.
That causes a few problems:
- more tokens every run
- more chances for instruction conflicts
- harder debugging
- more prompt dilution
- smaller models get mushy faster
Itβs like making a function depend on a global config object that contains your entire company wiki.
Technically possible. Terrible to reason about.
A cleaner split: persona, state, retrieval
Hereβs the split Iβd recommend.
1. soul.md handles identity
Keep it short.
Think 50 to 150 words.
Example:
You are a pragmatic coding agent.
Be concise, specific, and honest about uncertainty.
Prefer shipping over theorizing.
Ask clarifying questions only when blocked.
Preserve existing conventions unless there is a strong reason to change them.
Thatβs enough.
It defines role and behavior without pretending to store memory.
2. Markdown files handle canonical state
Put facts here.
Examples:
campaign_state.md
customer_context.md
decisions_log.md
inventory.md
runbook.md
incident_notes.md
These are your source of truth.
Example:
# customer_context.md
- Customer: Acme Health
- Plan: Enterprise
- Primary integration: n8n
- Known issue: intermittent Slack webhook retries
- Last decision: keep retries at 3 before escalation
- Escalation contact: [email protected]
This is much easier to inspect than burying the same facts inside a giant prompt.
3. Retrieval handles fuzzy recall
Use LanceDB or another retrieval layer when the agent needs relevant context, not all context.
That means:
- smaller prompts
- less repeated baggage
- better recall on demand
- easier debugging when memory goes weird
Conceptually:
query = "What did we decide about Slack webhook retries for Acme Health?"
results = memory.search(query, top_k=3)
context = "\n\n".join([r.text for r in results])
Thatβs cleaner than injecting your entire customer history into every turn.
What this looks like in practice
A simple agent workspace might look like this:
agent/
βββ soul.md
βββ state/
β βββ customer_context.md
β βββ decisions_log.md
β βββ runbook.md
βββ memory/
β βββ lancedb/
βββ tools/
And a request pipeline might look like this:
1. Load soul.md
2. Load the specific state files needed for this task
3. Query LanceDB for relevant memory chunks
4. Build a small prompt from those pieces
5. Run the model
6. Persist new facts back into markdown and memory
That is a lot more maintainable than βappend more instructions until the vibe improves.β
Prompt caching helps, but it does not fix bad design
This is where people get sloppy.
Yes, prompt caching is useful.
OpenAI supports prompt caching for long reused prefixes. Anthropic also offers prompt caching and shows major latency and cost reductions for repeated long prompts.
Thatβs real.
But caching does not solve the actual problems caused by giant prompts:
- conflicting instructions
- over-scripted behavior
- poor retrieval design
- hard-to-debug failures
- smaller models choking on too much prefix
Cheaper bloat is still bloat.
If your whole agent strategy depends on sending the same monster prompt forever, caching can reduce the bill and latency. It does not make the architecture elegant.
For teams running lots of automations, that distinction matters.
Why this matters more in automations than in chat demos
If youβre running one-off chats, prompt bloat is annoying.
If youβre running agents inside:
n8n- Make
- Zapier
- OpenClaw
- custom workers
- Slack bots
- Discord bots
then prompt bloat becomes an operational problem.
Every run pays for unnecessary context unless your provider offsets it. Every handoff becomes harder to reason about. Every failure turns into a forensic exercise inside a giant prefix.
This is exactly why predictable compute matters.
When youβre building agents that run all day, you want to optimize for architecture and reliability, not constantly wonder whether one more chunk of prompt text is worth the cost.
Thatβs also why Standard Compute is an interesting fit for this kind of workload: it gives you an OpenAI-compatible API with flat monthly pricing, so you can run agent-heavy workflows without babysitting per-token spend. That makes it much easier to choose the right memory design instead of the cheapest prompt at every step.
My ranking after looking at the patterns
| Approach | What itβs best at |
|---|---|
| LanceDB retrieval | Semantic recall, RAG, agent memory, smaller prompts |
| Markdown hard-save files | Canonical facts, deterministic state, easy inspection and versioning |
Long soul.md / bloated system prompt |
Tone shaping, behavior nudging, but easy to overdo |
My actual winners:
- best for continuity: markdown hard saves
- best for recall: LanceDB
- best for style: short
soul.md - easiest thing to waste time on: giant persona files
If I had to keep only one, Iβd keep the hard-save files.
State beats self-mythology.
What to put in each layer
Keep soul.md embarrassingly short
Good contents:
- role
- tone
- a few constraints
- one or two priorities
Bad contents:
- entire customer history
- every workflow edge case
- logs
- inventories
- project state
- emotional backstory the model does not need
Put facts in markdown
Use markdown files for things that should be true until explicitly changed.
Examples:
# decisions_log.md
- 2026-07-10: Keep Slack webhook retries at 3.
- 2026-07-11: Escalate repeated failures to Maya.
- 2026-07-12: Do not auto-close incidents without human review.
Put fuzzy memory in retrieval
Use retrieval for:
- prior conversations
- semantically related incidents
- similar customer issues
- docs that are too large to inject every time
Thatβs where LanceDB shines.
Smaller models benefit even more
This matters a lot if youβre using cheaper or smaller models.
Claude Opus 4.6 or GPT-5.4 can absorb some prompt abuse.
Smaller Qwen or Llama variants usually canβt.
A lot of βthis model is badβ takes are really βthis agent is dragging around too much prompt junk.β
If youβre evaluating the best cheap model for agent workflows, test it with:
- tiny persona
- explicit state files
- retrieval-based memory
Then compare it to the same model under a 1,500-word system prompt.
You may find the architecture was the bottleneck, not the model.
How Iβd debug an agent like this
One reason I like this setup is that it gives you layers you can inspect.
If the agent fails, check them in this order:
- Is canonical state wrong?
- Is retrieval pulling irrelevant chunks?
- Is the persona too restrictive or too vague?
- Did the workflow fail to persist new facts?
In OpenClaw specifically, the built-in commands help:
openclaw status
openclaw status --all
openclaw status --deep
openclaw logs --follow
openclaw doctor
Thatβs a much better debugging loop than editing a giant prompt and hoping the vibe changes.
The practical takeaway
The real question is not:
βhow detailed should my soul.md be?β
Itβs:
βwhere should memory actually live?β
My answer:
- identity in
soul.md - truth in markdown
- recall in retrieval
That gives you an agent that is easier to run, easier to debug, and easier to scale across automations.
And if youβre running those automations continuously, flat-cost compute becomes a real advantage. Per-token billing pushes people toward weird prompt compromises. Predictable monthly pricing lets you optimize for what works.
If youβre still tempted to write a 2,000-word soul.md, try this first:
Write 52 words.
Then spend the rest of your effort on state and retrieval.
Thatβs where the real memory usually comes from.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.