HomeTutorialsAgent Operating System
    — AI Agents // Memory

    How to Give Your AI Agents Persistent Memory with an Agent Operating System

    Chat history is not memory. This build gives your agent crew a shared wiki of plain markdown that every agent reads before it answers and writes to after it works: your world and outside claims kept separate, two nightly jobs keeping it honest, a dashboard to see what the crew knows, and git as the safety net. Fifteen steps, twenty-six prompts, in order.

    26 prompts · 6 parts · copy-paste ready

    Usage & License

    Use the prompts and downloadable templates on this page in your own personal and commercial projects. What's not allowed: reselling, repackaging, redistributing, or republishing this material — on YouTube, Gumroad, paid courses, newsletters, or anywhere else. Send people to komputermechanic.com instead. Violations get reported and taken down.

    Tutorial Sponsor

    Sodales AI

    Proudly supporting this tutorial.

    — Watch the Full Tutorial

    // Contents

    Part 04 / 06 — Prove it compounds

    WHAT YOU'LL NEED

    Prerequisites

    • A Hermes agent crew already running (two agents minimum) on a VPS
    • Claude Code on that machine as the builder (or build with one of your Hermes agents via prompt 1H)
    • The Wiki Page Template file, downloaded before step 13
    • One Claude Code conversation kept open for the whole build (if it resets, re-paste prompt 1 and say which step you are on)

    Download the prompts, free for subscribers

    All 26 prompts are free for subscribers. Just confirm your email.

    Want them as a single Markdown file plus the dashboard template? Already on the list? Instant download.

    Want every paid tutorial? Become a member

    $10/month. All prompts, bundles, and auto-installers. Cancel anytime.

    Part 01 / 06

    Brief your builder

    One briefing prompt sets the contract for the whole build: Claude Code builds files, the habits live in the agents. Building with a Hermes agent instead? Use 1H.

    PROMPT 1

    Brief Your Builder

    The one line everything depends on: Claude Code builds files; the habits live in the agents. The container check comes from a live incident: per-profile HOMEs made ~/wiki resolve differently for each agent. Building with one of your Hermes agents instead of Claude Code? Skip this and paste 1H.

    We are building the memory layer for my Hermes agent crew: a wiki at ~/wiki of plain
    markdown the agents read before answering and write to after working. Chat history gets
    summarised away; this does not.
    
      processed/   what agents WRITE - my world (personal/, business/), outside
                   material (research/)
      raw/         the originals, verbatim, never edited - so any claim can be
                   checked against its source
    
    Build order: backend first - wiki, skill, habits, ingestion, feeds and the night
    jobs - until the whole thing works and is proven. Then the dashboard, so I can see
    what the agents know. Git last, as the safety net. I feed you numbered prompts one
    at a time.
    
    Read these two first (if unreachable, say so and carry on):
    1. https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f - the idea: the
       model maintains a persistent wiki instead of retrieving at query time.
    2. https://hermes-agent.nousresearch.com/docs - profiles, skills, SOUL.md, cron.
    
    YOU ARE A BUILD TOOL, not a crew member. Files, scripts, routes, jobs: you. Habits the
    agents must own: I paste those into the agents myself. A scheduled job that thinks is a
    Hermes cron agent turn on a named profile, never a shell script imitating one.
    
    STANDING RULES: one prompt at a time, never run ahead. Back up before changing.
    Absolute paths in anything scheduled. Verify by looking, never by claiming. When you
    finish a prompt, say what you did and what you are waiting for.
    
    BEARINGS: report whether Hermes runs directly or in a container here. If
    containerised, ~/wiki must be the SAME real path for every profile and for you - pin
    CREW_WIKI_DIR in the container env and symlink each profile's home/wiki to it,
    otherwise per-profile HOMEs give every agent a different empty wiki. Also report:
    every profile and its HERMES_HOME, what is at ~/wiki, whether systemd --user and git
    are available, and date +%Z (a hint - the scheduler's zone is verified later).
    
    Close with your understanding: what we are building and why it beats chat history, the
    two layers, the build order, your role versus the agents'. If anything here seems
    wrong for THIS machine, say so now. Build nothing yet.
    PROMPT 1H

    Brief Your Builder (Hermes as the builder)

    The alternative briefing for building WITH one of your Hermes agents instead of Claude Code. Use prompt 1 OR 1H, never both. Give the builder agent a capable model - this build is real engineering. Everything after this stays identical: wherever a later prompt says Claude Code, it means your builder agent. To switch to Claude Code at the dashboard, see 13H.

    We are building the memory layer for my Hermes agent crew: a wiki at ~/wiki of plain
    markdown the agents read before answering and write to after working. Chat history gets
    summarised away; this does not.
    
      processed/   what agents WRITE - my world (personal/, business/), outside
                   material (research/)
      raw/         the originals, verbatim, never edited - so any claim can be
                   checked against its source
    
    Build order: backend first - wiki, skill, habits, ingestion, feeds and the night
    jobs - until the whole thing works and is proven. Then the dashboard, so I can see
    what the agents know. Git last, as the safety net. I feed you numbered prompts one
    at a time.
    
    Read these two first (if unreachable, say so and carry on):
    1. https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f - the idea: the
       model maintains a persistent wiki instead of retrieving at query time.
    2. https://hermes-agent.nousresearch.com/docs - profiles, skills, SOUL.md, cron.
    
    YOU ARE PART OF THE CREW, and for this build you also wear the builder's hat: you
    construct the files, scripts, skills and jobs the whole crew will run on - yourself
    included. The discipline that comes with the hat: rules and habits are never saved
    from memory - they are written into identity files VERBATIM with your file tools,
    your own SOUL.md included, when the prompt for that comes. Wherever a later prompt
    says Claude Code, it means you. A scheduled job that thinks is a Hermes cron agent
    turn on a named profile, never a shell script imitating one.
    
    STANDING RULES: one prompt at a time, never run ahead. Back up before changing.
    Absolute paths in EVERYTHING - your own home folder may not be the wiki's home (in
    containers each profile can have its own), so pin the wiki's real path once and use
    it everywhere. Verify by looking, never by claiming. When you finish a prompt, say
    what you did and what you are waiting for. If your session resets mid-build, I will
    re-paste this briefing and tell you which step we are on.
    
    BEARINGS: first report which profile you are running as, and prove your terminal and
    file tools work. Then: does Hermes run directly or in a container here; every
    profile and its HERMES_HOME; what is at ~/wiki as the DEFAULT profile sees it, not
    just as you see it; whether systemd --user and git are available; date +%Z (a hint -
    the scheduler's zone is verified later). If containerised, ~/wiki must be the SAME
    real path for every profile - pin CREW_WIKI_DIR in the env and symlink each
    profile's home/wiki to it.
    
    Close with your understanding: what we are building and why it beats chat history,
    the two layers, the build order, and the builder's hat you wear on top of your crew
    role. If anything here seems wrong for THIS machine, say so now. Build nothing yet.
    Part 02 / 06

    Build the memory

    The wiki and its rules, the skill that teaches every agent to use it, and the habits: every reply starts from your name, agents empty your head into the wiki, and a different agent proves recall.

    PROMPT 2

    Build the Wiki and Its Rules

    WIKI.md is the contract every agent reads before writing. The three filing rules exist because without them each agent invents its own shelves and the same company lands on two pages - and two copies drift apart until the stale one turns into wrong answers. The linking cautions each come from a live mistake (a customer named Matt swallowed Matthew Berman). No git yet: that is deliberately the last step, once everything works.

    Build ~/wiki. If it exists and is not empty, STOP and tell me what is in it.
    
      ~/wiki/
      |-- processed/          what the agents WRITE
      |   |-- personal/       me, my household, anything not the business
      |   |-- business/       what we sell, who buys, who we pay
      |   \-- research/       what we read - their claims, never our facts
      |-- raw/                originals, verbatim, never edited
      |-- index.md            the catalog: one line per page, each a link to that page,
      |                       a heading per parent, Research its own section - agents
      |                       read this FIRST
      |-- log.md              append-only diary, one line per change
      \-- WIKI.md             the rulebook
    
    personal/, business/ and research/ in these prompts always mean the folders inside
    processed/. Do not create sub-folders yet; they come later, when real material needs
    them.
    
    WIKI.md rules - write them into the rulebook, short and clear:
    
    - Where a page goes: what I make or sell goes in business/; what we read to learn
      goes in research/; everything else about me goes in personal/. A person goes where
      the money flows - a customer, a supplier and a partner are different pages. When
      two folders both fit, file the page where I would look for it later (a
      competitor's price list goes in research/ - I open it to check the market). Every
      page has exactly one home.
    - Names and links: page names are lowercase-with-dashes and unique across all
      folders. The first mention of anything that has a page becomes a [[link]] - but
      never inside emails, handles, headings or code, and never a first name or a
      common word that could point at the wrong page.
    - Writing: pages are short and factual, a one-line summary on top, a date on
      anything that can go stale. A repeated fact gets a counter, never a second copy.
      Contradictions are flagged side by side, never overwritten. Known aliases are
      listed on the page, and the page's index line ends with (aka ...).
    - Bookkeeping: every edit also updates index.md and log.md. Define the exact line
      formats in the rulebook - the nightly checks will hold everything to them.
      Underscore paths are machinery: never counted, never indexed.
    - Never: small talk, and never secrets - a credential, code or bank detail is
      recorded by name only, never by value.
    - WORKFLOWS, both habits in full (this only stores them in WIKI.md - the agents get
      them in a later prompt): RECALL - search the wiki before answering anything it
      might know; answer from it when it knows, say "Not on file" when it does not.
      FILE - after real work, file the lasting part through wiki file, never by hand.
      Leave ingest and fact-vs-inference as empty headings for later.
    
    Show me the tree and the rulebook.

    Subscribe to unlock the full prompt set

    You've just walked through the first 3 prompts. Drop your email below to get the rest. Orchestration, edge cases, polish, plus the dashboard template. 100% free for subscribers.

    // What you're building toward

    A crew whose knowledge survives the session: a wiki of plain markdown every agent reads before it answers and writes to after it works, with your world and outside claims kept strictly apart, nightly jobs that keep it honest, a dashboard that shows what the crew knows, and the whole thing versioned under git.

    Stuck on a step? Drop a comment on the video — or book a session and we'll walk through it together.