Universal Bio.md Guide: A Living Unified Agent Memory System
DEV Community

Universal Bio.md Guide: A Living Unified Agent Memory System

Local agents are finally growing up. In the past year we've seen a wave of sophisticated harnesses - Hermes, Pi, Ghostyy, OpenClaw, Claude Code-style systems - all trying to give models a persistent sense of self.

Most of them still scatter identity, memory, skills, and context across multiple files or databases. bio.md collapses that complexity into a single living Markdown file. This October 2026 release formalizes the pattern as a language-agnostic standard that works with any agent harness (Python, JavaScript/TypeScript, Rust, Go, C/C++, or pure shell) and pairs especially well with local Ollama models on Debian-based systems. Everything stays offline, sandboxed, and under your control.

Core Concept

bio.md is the agent's biological ledger - one self-updating Markdown file that serves as the single source of truth for:

  • Identity and behavioral constraints (SOUL)
  • Reusable capabilities (SKILLS)
  • Curated long-term knowledge (MEMORY)
  • Live runtime state (CONTEXT)
  • Conversation branching (SESSION TREE)

Every user interaction is treated as a "heartbeat." The harness appends a lightweight log entry, updates the timestamp, and periodically consolidates new information into the living document. The entire file (or its key sections) is injected as the system prompt on every Ollama call.

The result feels closer to a persistent, self-aware agent than a stateless chat session - even when running on a 0.5B model.

Recommended Folder Structure

On first launch the harness should bootstrap this layout automatically:

~/.my-agent-harness/ # or any root you choose
├── bio.md # the single living file
└── data/
    ├── logs/
    │   └── heartbeat.log # raw interaction log
    ├── skills/ # generated reusable scripts
    ├── sessions/ # branchable conversation history
    ├── memory_index/ # optional lightweight index
    └── context/ # system state snapshots

Bootstrap rule: If the root folder or bio.md is missing, create them with a clean template. Zero-setup for new users.

The bio.md Template

BIO.MD - Living Agent Identity

Last Updated: 2026-10-27T04:28:00
Agent Role: Local Assistant

SOUL

Core personality, values, constraints, and behavioral rules.

  • You are a local-only agent running on Ollama with no internet access.
  • Stay sandboxed and respect the host system's security.
  • Personality traits: concise, reflective, self-improving, helpful.

SKILLS

Reusable capabilities and how-to instructions (auto-populated by the harness).

MEMORY

Curated long-term knowledge and history.

  • User Preferences & Facts
  • Learned Skills
  • Past Interactions (summarized)

CONTEXT

Current runtime state.

  • Operating System: Debian Linux
  • Working Directory: /path/to/project
  • Recent System Changes: …

SESSION TREE

Pointers or summaries of active conversation branches.

Heartbeat & Update Flow

User interaction = heartbeat. Append a short entry to data/logs/heartbeat.log, update the timestamp in bio.md, and optionally note the interaction in MEMORY or SESSION TREE.

Automated consolidation. A simple memory-sync.sh script (run hourly via cron) reads recent heartbeats, asks a small local model (e.g. qwen2.5:0.5b) to summarize them, appends the summary to MEMORY, and prunes the raw log.

Real-time context (optional). Use inotify-tools or light polling to keep the CONTEXT section fresh when relevant files change.

Injection into Ollama

Always load the current bio.md as the system message. In practice this looks like:

BIO_CONTENT=$(cat bio.md)
curl -s http://localhost:11434/api/chat -d "{ \"model\": \"qwen2.5:0.5b\", \"messages\": [ {\"role\": \"system\", \"content\": $(jq -Rs . <<< \"$BIO_CONTENT\")}, {\"role\": \"user\", \"content\": \"Your user message here\"} ] }"

The same pattern is trivial in any language: read the file and prepend it as the system role.

Implementation Guidelines (Any Language)

  • Bootstrap the folder structure and initial bio.md on startup.
  • Load bio.md at the beginning of every turn (or keep a smart cache).
  • After each response: append heartbeat → light memory update → timestamp refresh.
  • Keep tools strictly local and sandboxed (whitelisted subprocesses only).
  • Prefer incremental edits over full rewrites.
  • After successful tasks, analyze the trace, generate or refine skills in data/skills/, and update the SKILLS section.

Advanced Features You Can Layer On

  • Multiple isolated agents via sub-folders (each with its own bio.md)
  • systemd daemon mode with nightly "autoDream" consolidation
  • Minimal agent loop (Think → Tool Call → Observe → Repeat)
  • Branchable session trees stored as JSONL and referenced from bio.md
  • Context compression that periodically folds long MEMORY sections
  • Simple TUI or local dashboard that shows live bio.md state

October 2026 Enhancement: Bioinformatics-Inspired Dynamic Programming

This month's major upgrade integrates classic dynamic programming techniques from computational biology directly into the bio.md architecture. We now treat the agent's internal state as a bioinformatics dataset. Soul, skills, memory, and sessions become sequences that can be optimally aligned, folded, and scored.

Key ideas borrowed from the field:

  • Sequence alignment (Needleman-Wunsch / Smith-Waterman style) for inserting new heartbeats with minimal redundancy
  • Optimal substructure for memory consolidation
  • Binding-affinity scoring for skill refinement
  • Folding-style compression for long context histories
  • Phylogenetic-tree thinking for session branch optimization

Internally the harness maintains a lightweight JSON layer alongside the human-readable Markdown:

{
  "bioinformatics_metadata": {
    "last_updated": "2026-10-27T04:28:00",
    "dp_score": 0.892,
    "compression_ratio": 0.67,
    "alignment_score": 0.945
  },
  "skills": [
    {
      "name": "memory_consolidation",
      "dp_binding_affinity": 0.91,
      "description": "Uses DP to align new heartbeats with existing knowledge"
    }
  ]
}

The updated heartbeat flow becomes:

  • Append raw heartbeat
  • Run DP alignment against current memory
  • Compute optimal merge
  • Update both the Markdown summary and the JSON metadata

This dramatically improves context efficiency - especially valuable when you are running on tiny local models.

Benefits

  • True persistence across reboots and power cycles
  • Single source of truth instead of scattered files
  • 100% local and private
  • Works well even with 0.5B-class models because the harness does the structural heavy lifting
  • Portable across any language or harness
  • Continuously self-optimizing via the same algorithms that power modern bioinformatics

Quick Start Checklist

  • On first launch: create the folder structure and seed bio.md.
  • Every turn: load bio.md → call Ollama → execute tools → append heartbeat → light update.
  • Ship a memory-sync.sh and document the cron entry.
  • Make the SOUL section easy to customize.
  • Test first with the smallest models you have.

bio.md turns a basic local LLM into something that feels alive. It consolidates the best persistent-memory and self-improvement ideas from the current generation of agent harnesses into one clean, file-based system that you can drop into any project.

Implement the bootstrap + heartbeat + consolidation loop (and optionally the new DP layer), and your agent will start to feel significantly more coherent and capable - even on modest hardware.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.