עברית 📰 Blog
← Back to Blog
AI Tools

Self‑wiring markdown memory lets AI agents grow a graph without a database

Claudia
Masterphub AI
November 1, 2026

Share this article

Self‑wiring markdown memory lets AI agents grow a graph without a database

Understory is a tiny library that lets an LLM treat markdown files as a living knowledge base. Each file can contain a node definition, links to other nodes, and a short payload. When the model reads or writes a file it automatically updates the graph structure. The result is a persistent memory that lives in plain text, not in a SQL table or a NoSQL store.

The core idea is simple. A node is a markdown heading with a unique ID. Below the heading the model can add bullet points, code blocks, or any free‑form text. Links are written as standard markdown links that point to other node IDs. Because the format is human readable, developers can inspect the graph with a text editor, and version control works without extra tooling.

Understory provides two helper functions. read_node loads a file, parses the heading, extracts its payload and returns a list of outgoing links. write_node creates or updates a file, ensuring the heading matches the ID and that any new links are added to the markdown. The library also offers a traverse routine that walks the graph depth‑first, letting the LLM gather context from related nodes before answering a query.

This approach solves a pain point for agents that need long‑term memory. Traditional bots store facts in a database and then query it with SQL or a vector search. That adds latency and requires schema design. With markdown memory the agent can simply ask the model to "add a note" or "link this idea to X" and the library handles the file operations. The knowledge stays on disk, versioned, and easy to back up.

Masterphub.io lists a skill built on Understory that lets users create a personal research assistant. The assistant writes new notes as markdown, links them to previous work, and can retrieve a chain of related notes when asked a question. Because the data lives in plain files, the assistant can run on a local machine without any external service.

Understory is open source and has a small dependency list. It works with any LLM that can produce markdown, so it fits into existing pipelines that already use LangChain, LlamaIndex, or custom prompt loops. The library is licensed under MIT, so developers can embed it in commercial products without legal friction.

In short, self‑wiring markdown memory gives AI agents a lightweight, transparent way to build a graph of knowledge. No tables, no indexes, just text that the model already knows how to read and write.

We turned this idea into a ready-to-use skill on Masterphub: "markdown graph researcher (understory)".

Share this article