Back to Guides

From a pile of mixed documents to an agent-friendly knowledge repository

Turn a pile of Word files, PDFs and slides into a repository of text files that people and agents can maintain.

Many researchers and research teams end up with a pile of documents on their subject: Word files, PDFs, slides, spreadsheets, emails, web pages. I heard someone describe giving their agents "a bunch of documents" of exactly this kind. On very small collections, keeping PDFs and .docx files is fine but as the collection grows, it becomes a limitation.

This guide is about the next step: turning such a pile into a repository of research and knowledge that agents can work with, that you can pass on to other people and their agents, and that can be kept up to date as new material arrives.

Everything I work on ends up in this form. My own projects—books, websites, research collections and the instructions my agents work from—are kept as repositories of text files with the same formatting conventions, and I use those conventions as the worked example. The guide is for material you are free to share. The other guides in this series cover publishing with Cloudflare, building sites from data files with Astro, Git and GitHub for sharing data with agents (coming soon) and spreadsheets and tabular data.

Repositories I keep this way

Three examples of different sizes.

  • An archive I helped rescue and rebuild. About 10,500 records in Markdown and YAML files, with about 2.4 million words. The media files are kept out of Git.
  • My book readers. Each book is a set of Markdown chapters. The online reader sites and the ebooks are generated from them. Developing Competence, Deliberate Practice and Czech Navigator are made this way.
  • The Semantic Machines guides, including this one. Each guide is a Markdown file, and the site is generated from it.

Sources, content and rendering stay separate

The first decision is to keep three things apart.

  • Sources. The original documents, exactly as they arrived, in a sources/ folder. They are never edited. If someone asks what a document originally said, the original is there.
  • Content. The converted and edited text, as Markdown files. This is what people and agents read, correct and add to.
  • Rendering. Anything made for reading: a website, an ebook, slides. It is generated from the content and can be generated again whenever the content changes. This also makes it easy to rebuild during a redesign. This relies on the established principles of keeping the content layer and presentation layer separate that is the foundation of modern web design.

The pile of documents you start with becomes the sources. But the sources are only kept for provenance not as the core of the collection on which I continue to work.

Markdown files with frontmatter

Every durable knowledge file in my repositories is a Markdown file: plain text with light marks for headings, lists and links. At the top of each file is a short block of YAML frontmatter, a few labelled fields that say what the file is and where it came from. This is the frontmatter of a policy document converted from a PDF:

---
title: University policy on AI in assessment (2025)
date: 2026-11-18
status: converted, checked against the original
register: FOR AGENTS
sources:
  - file: sources/policy-university-ai-assessment-2025.pdf
    origin: university policy web page, downloaded 2026-11-10
    converted: 2026-11-18, academic-pdf-to-mkd skill, tables checked by hand
---

The fields I use are these.

  • title and date. What the file is and when it was last written or converted.
  • status. Where the file stands: converted, checked, draft.
  • register. Who the text is written for. In my files there are three values: for agents, for me, and as me (text that goes out under my name).
  • sources. The provenance: where the file came from, when, and how it was converted.

With provenance in every file, anyone who receives the repository—a colleague or their agent—can trace a statement back to the original document.

File names that make sense anywhere

A file name should be intelligible on its own: in search results, in a list of recent files, in a link, or in a copy that has left its folder. The folder organises the files; the name identifies the file.

  • Lowercase kebab-case: words in lower case, joined by hyphens.
  • Role first, then subject, then date or version. The role is what distinguishes neighbouring files in the same folder; the subject keeps the file identifiable outside it. For example, review-<subject>-2026-11-run.md.
  • No bare generic names such as notes.md, draft.md or data.json. A date or a status word can qualify a subject but never replaces it.
  • Required names stay as they are. README.md, AGENTS.md and SKILL.md keep their names, because tools look for them.
  • Indexes are named _INDEX-<subject>.md and link to the files they list instead of copying their content.

An example layout

This is how a small repository built from a pile of documents on AI in assessment could look.

ai-in-assessment-knowledge/
├── README.md
├── AGENTS.md
├── LICENCE.md
├── _INDEX-ai-in-assessment-sources.md
├── changelog-ai-in-assessment-decisions.md
├── sources/
│   ├── README.md
│   ├── policy-university-ai-assessment-2025.pdf
│   ├── slides-workshop-ai-marking-2026-03.pptx
│   └── survey-staff-ai-use-2026.xlsx
├── content/
│   ├── README.md
│   ├── policy-university-ai-assessment-2025.md
│   ├── slides-workshop-ai-marking-2026-03.md
│   ├── summary-workshop-ai-marking-2026-03.md
│   └── table-staff-ai-use-2026.csv
├── inventory-ai-in-assessment-media.csv
├── skills/
│   └── convert-new-source/
│       └── SKILL.md
├── scripts/
│   └── check-ai-in-assessment-repo.py
└── site/

Each converted file keeps the name of its source with a new extension, so the pair is easy to match. The summary is a separate file with its own role, summary-, because it was written by a model and the converted text was not. The site/ folder holds the rendering.

Converting the pile

Each kind of document has its own route into Markdown.

  • PDFs. I convert them with the academic-pdf-to-mkd skill.
  • Word files and slides. They go through conversion tools and are then cleaned. The same applies to emails and web pages.
  • Spreadsheets. They become clean tables; the spreadsheets guide covers how.
  • Anything that needs judgement. Classifying documents, summarising them or picking out what they say about a question is done by the model and recorded as such: the file says a model produced it. Keyword rules do not do this kind of work well. The judgement-vs-code skill describes where the line falls between what a model should judge and what code should do.

The conversion itself goes into the provenance: which tool or skill, when, and what was checked by hand.

One fact in one place

Each fact lives in one file. Indexes, lists, summary pages and other views are generated from those files or link to them; they do not hold their own copies. A correction then has to be made only once. The text-as-graph skill describes this way of treating a body of text as connected records.

Instructions for people and for agents

Three kinds of files tell people and agents how the repository works.

  • README.md, for people. One at the top of the repository saying what it is, and one in each folder that matters saying what the folder holds.
  • AGENTS.md, for agents. One for the repository: the layout, the naming and frontmatter conventions, the commands to run and the checks to pass.
  • Skills, for repeatable procedures. A skill is a folder with a SKILL.md file that describes one task an agent does again and again, such as converting a new source. My public skills are collected in dominiks-agent-skills, in folders by category.

Large files

Text records go in Git. Large media files—images, audio, video—stay out of it, and the repository keeps an inventory of them with a checksum for each (a fingerprint that shows whether a file has changed). The Git and GitHub guide (coming soon) covers where the large files go instead.

Sharing the repository

A repository set up like this can be cloned, forked, published as a site, zipped and sent to a colleague, or given to another agent.

My public data repository for Research Snacks, research-snacks-data, is an example. Alongside the data and code it has a README, a list of data sources (DATA-SOURCES.md), a licence (LICENCE.md, with a LICENSES/ folder), a description of how it is validated (VALIDATION.md), a check script (check.py) and a provenance file (provenance.json).

Keeping it up

What keeps the repository usable over time is the set of files described above: AGENTS.md with the conventions, skills for the repeated tasks and a validation script the agent runs after every change. For a knowledge repository, the script can check that every content file has frontmatter with its sources, that every source it names exists, and that the media files still match their checksums.

The last piece is a changelog of decisions: what was decided, when and why. For example, how a category was defined, why a document was left out or which version of a source was used.

Give this guide to your agent

Copy this and give it to your agent (Claude Code, Codex or another). The agent can read the whole guide and the rest of the series on this site, each page also as a Markdown file written for agents.

Read https://semanticmachines.fyi/guides/knowledge-repository-for-agents (and https://semanticmachines.fyi/llms.txt for the rest of the series), then help me turn my documents into a repository the way it describes. Start by asking me what I want to share.

What your agent takes from this guide

This is the practice the guide describes, written for the agent. It is here so that you can see what your agent will work from.

# Practice: knowledge repository built from mixed documents

## Purpose
Turn a pile of mixed documents (Word, PDF, slides, spreadsheets, emails, web pages) into a repository that agents can work in, that can be shared, and that can be maintained.

## Layout
- `sources/`: original documents, unchanged. Never edit, rename or delete a file here. Add new originals here first.
- `content/`: converted and edited text as Markdown; tables as CSV.
- `site/` (or other rendering folders): generated from `content/`. Never edit by hand; regenerate.
- Root: `README.md` (for people), `AGENTS.md` (for agents), `LICENCE.md`, a changelog of decisions, an inventory of large media files with checksums, `skills/`, `scripts/`.
- Each folder that matters has its own `README.md` saying what it holds.

## File names
- Lowercase kebab-case. Order: role, subject, then date or version: `<role>-<subject>[-<date-or-version>]`.
- A name must be intelligible outside its folder. Never use bare generic names (`notes.md`, `draft.md`, `data.json`).
- Keep required names: `README.md`, `AGENTS.md`, `SKILL.md`.
- A converted file keeps its source's name with the new extension.
- Name manual indexes `_INDEX-<subject>.md`. Indexes link to files; they do not copy content.

## Frontmatter
Every Markdown file in `content/` starts with YAML frontmatter:
- `title`, `date`, `status`, `register` (who the text is written for)
- `sources`: for each source, the file path in `sources/`, where it came from and when, and how it was converted (tool or skill, date, what was checked by hand).

## Conversion
- PDFs: use the academic-pdf-to-mkd skill (https://github.com/techczech/dominiks-agent-skills/tree/HEAD/research/academic-pdf-to-mkd).
- Word, slides, emails, web pages: convert with conversion tools, then clean the Markdown.
- Spreadsheets: one tidy table per CSV file, converted by a script.
- Classification, summaries and other meaning-sensitive extraction: do it with the model, not keyword rules. Put model-written text in its own file (e.g. `summary-<subject>.md`) and record in its frontmatter that a model produced it. See judgement-vs-code (https://github.com/techczech/dominiks-agent-skills/tree/HEAD/philosophy-for-agents/judgement-vs-code).

## One fact in one place
- Each fact lives in one file. Generate indexes and other views from it, or link to it. Never maintain a second copy.
- See text-as-graph (https://github.com/techczech/dominiks-agent-skills/tree/HEAD/philosophy-for-agents/text-as-graph).

## Large files
- Text records go in Git. Large media files stay out of Git; record each in the media inventory with its checksum.

## Maintenance
- Keep `AGENTS.md` current with the layout, conventions, commands and checks.
- Write a skill in `skills/<task>/SKILL.md` for any task that repeats (e.g. converting a new source).
- After every change, run the check script. It checks that every content file has frontmatter with sources, that every named source exists in `sources/`, and that media files match their checksums. Fix failures before finishing.
- Record decisions (definitions, exclusions, versions used) in the changelog of decisions with the date and the reason.

## Sharing
- The repository must have a licence and a README before it is shared, published or handed to another agent.
- Example of a public repository with README, licence, data sources, validation description, check script and provenance file: https://github.com/techczech/research-snacks-data

Cite this page

Lukeš, Dominik (n.d.). From a pile of mixed documents to an agent-friendly knowledge repository · SemanticMachines. SemanticMachines. https://semanticmachines.fyi/guides/knowledge-repository-for-agents