Entity-Scoped Directories for Agent-Native Apps

The Idea

One working convention for organizing files in an agent-native app: scope directories to entities, keep collections at the type level, use lowercase-with-underscores for paths.

{entity_type}/{entity_id}/
├── primary content
├── metadata
└── related materials

A concrete example from the Every team’s Reader app: Research/books/{bookId}/ contains the full text, notes, sources, and per-entity agent logs for one book. Everything that belongs to one book lives in one folder.

A working file-naming scheme alongside it:

FilePatternExample
Entity data{entity}.jsonlibrary.json, status.json
Human-readable content{content_type}.mdintroduction.md, profile.md
Agent reasoningagent_log.mdper-entity agent history
Primary contentfull_text.txtdownloaded/extracted text
External sources{source_name}.mdwikipedia.md, sparknotes.md
Checkpoints{sessionId}.checkpointUUID-based

Markdown for human-readable content; JSON for structured data. The shape isn’t sacred — it’s a starting point that’s worked, not a prescription. Better solutions almost certainly exist; this is one of the patterns the article explicitly flags as needing more validation.

Why It Matters

When the agent can cd Research/books/{bookId}/ && ls, it gets the full picture of one entity in two commands. A flat layout, or a deeply abstract one, forces the agent to make many calls just to assemble context.