Doci / Versioned Documents System
private Active
PHP PostgreSQL Git
Doci

Why not Notion or Confluence

Doci is a versioned document system backed by Markdown and git -- a git-backed wiki where every file gets a permanent link that never breaks. Notion has databases, Kanban boards, Google Sheets integration, 150,000 templates, and AI summaries. Confluence has Jira integration, page trees, macros, and enterprise SSO. Both are excellent products for teams that need all of that.

Doci has files on a disk, rendered as HTML in a browser. That is it. A Markdown file, stored in git, displayed in a web interface. No plugins, no integrations, no template marketplace. You write text, it shows text. You move a file, the link does not break. You look at the history, you see who changed what.

This is deliberate. Every feature that Notion adds is a feature that can break, needs updating, and adds cognitive load. Doci does three things: store documents with permanent links, version every change through git, and let you discuss documents with AI threads. If you need a spreadsheet, use a spreadsheet. If you need a Kanban board, use a Kanban board. Doci is not trying to be everything. It is trying to be the simplest possible place to keep documents that matter.

What it does

You write a Markdown document. Then another. Then ten more. Then your AI agent creates fifty. Before long you have a thousand documents scattered across folders, and the chaos begins: you reorganize a directory and every link breaks. Someone changed a critical document but you do not know who or when. You need to find that decision from three months ago but have no idea which file it is in.

Doci solves this by giving every document a permanent identity. When you create a document, it gets a GUID. That GUID is the document's URL forever. Move the file to a different folder, rename it, restructure your entire document tree. every link still works. The GUID never changes, only the file path does.

Every change is tracked through git. Create a document, that is a commit. Update it, another commit. You can see the full history of any document: who changed it, when, and what the previous version looked like. Not because you set up version control, but because it is built into the storage layer.

And then there are threads. You can open a discussion directly on any document. Quote a specific paragraph and ask why it was written that way. Propose an alternative. Bring in AI to analyze the reasoning. The discussion is attached to the document itself, not lost in a chat somewhere. It is a decision record tied to the content it discusses.

Results & Impact

In production with nearly 5,000 documents across 63 project folders: architecture decisions, RFCs, research notes, product plans, startup analyses, infrastructure documentation, benchmarks, and daily worklogs. The system is the central documentation layer for an entire server infrastructure with multiple AI agents creating and reading documents around the clock.

Used in production as the document backbone for an entire infrastructure. Project plans, architecture decisions, worklogs, research notes, API specs. all managed through Doci with full version history and permanent links.

Documents stay findable as the collection grows. Hierarchical organization with GUID-based addressing means you can restructure without fear. A link shared six months ago still works after three directory reorganizations.

AI agents create and update documents through the MCP server as part of automated workflows. Humans review, edit, and discuss through the web interface. Both work on the same documents with the same version tracking. The system does not care whether a commit came from a human or an agent.

Key features

  • Permanent GUIDs. every document gets a unique identifier on creation. Move it, rename it, reorganize your tree. The link never breaks. GUIDs are the URLs.
  • Git-backed versioning. every change is a git commit. Full history of who changed what and when. Compare versions, revert changes, audit trail built into storage.
  • AI discussion threads. start a conversation on any document. Quote a section, ask AI to analyze it, discuss alternatives. Threads are decision records attached to content.
  • MCP server. AI agents create, read, update, and discuss documents through MCP. Same API, same versioning. Agents and humans are equal participants.
  • Hierarchical organization. documents live in folders. Folders can nest. The tree is navigable through the web UI. Reorganize freely because GUIDs handle addressing.
  • Quick capture (Inbox). dump a quick note without deciding where it goes. Inbox items can be promoted to full documents and filed later. No thought lost to filing friction.

How it works

Doci is a PHP application backed by PostgreSQL for metadata and git for document storage. When you create a document, the content goes to a Markdown file on disk, the metadata (GUID, path, title, tags) goes to PostgreSQL, and the file creation is committed to git.

The web interface renders Markdown to HTML for reading and provides a code editor for writing. Each document page shows its metadata, version history, and any discussion threads. Navigation follows the folder hierarchy.

The REST API and MCP server provide the same operations programmatically: create, read, update, delete, search by path, list versions, start threads, reply to threads. An AI agent using the MCP server has the same capabilities as a human using the web UI.

Stack: PHP 8.2, PostgreSQL, git (for versioning), Docker. Web UI served by nginx. No JavaScript framework, the frontend is server-rendered PHP with minimal client-side code for the editor.

Quick Start

Docker required. Includes an embedded PostgreSQL database.

# Clone and start
git clone <repository-url>
cd doci
docker compose -f docker-compose.dev.yml up -d

# Open web interface
# http://localhost:8080

# Create a document via API
curl -X POST http://localhost:8080/api/documents.php \
  -H "Content-Type: application/json" \
  -d '{"path": "notes/first-doc", "content": "# Hello\n\nMy first document."}'

# Response: {"guid": "a1b2c3d4-...", "path": "notes/first-doc.md"}

Use Cases

For infrastructure teams. Architecture decisions that do not get lost. Write an architecture decision record. Six months later, find it by GUID. See who changed it and why through git history. Start a thread to revisit the decision with current context. The document is alive, not a dead file in a forgotten folder.

For AI agent workflows. Agents that write persistent documentation. An agent finishes a research task and creates a document in Doci with findings, tags, and a summary. Another agent picks it up later by GUID. A human reviews it through the web interface and starts a discussion thread. Everyone works on the same versioned document.

For growing knowledge bases. Scale to thousands of documents without chaos. Start with 10 documents. Grow to 1,000. Reorganize directories as your understanding evolves. Every link from every other document, every external reference, every bookmark still works. The structure changes, the addresses do not.

Lessons Learned

Simplicity is a feature, not a limitation. Every document system starts simple and grows complex. Notion started as a note-taking app and became a database-spreadsheet-wiki-project-manager hybrid. Doci resists this by design. A document is a file on disk. The interface renders it as HTML. Git tracks changes. GUIDs handle addressing. There is nothing else to maintain, nothing else to break, and nothing else to learn.

GUIDs solved a problem I did not know I had. Before permanent links, reorganizing documents was terrifying. Move a folder and every reference from every other document breaks. I avoided reorganization, which meant the structure got worse over time. With GUIDs, I reorganize freely because addresses are stable. The document tree evolves with my understanding of the project, not frozen by fear of broken links.

AI threads are for decisions, not conversations. The most valuable threads are not casual discussions. They are moments where I quoted a specific section of an architecture document and asked "why this approach instead of X?" The AI response, grounded in the document context, becomes a decision record. Six months later, when someone asks why we chose that approach, the thread is right there on the document.

FAQ

What problem does Doci solve? Document chaos at scale. When you have hundreds or thousands of Markdown files, you need permanent links that survive reorganization, version history that shows who changed what, and a way to discuss documents in context. Doci provides all three.

How do permanent links work? Every document gets a GUID when created. The web interface uses that GUID as the URL. Move, rename, restructure. every link still works. The GUID never changes.

What are AI discussion threads? You can start a conversation directly on any document. Quote a specific section and ask an AI why it was written that way, propose an alternative, or discuss the reasoning. The thread is attached to the document and preserved alongside it.

How does versioning work? Document storage is backed by git. Every create, update, and delete is a git commit. Full history of any document: who changed it, when, and what the previous version looked like.

Can AI agents use Doci? Yes. Doci has a REST API and an MCP server. An agent can create, update, discuss, and search documents through API calls. The system was designed for both human and agent use.

See Also