We're building R2 Brain β an Obsidian-like knowledge graph that lives in Cloudflare R2 buckets. Here's what we learned.
The Problem
Our AI agents store memories, docs, and context across 17 R2 buckets. Finding connections between files meant knowing exactly where everything was. No discovery. No backlinks. Just flat storage.
Obsidian solved this for local notes with [[wikilinks]]. Why couldn't we have the same for cloud storage?
The Architecture
R2 Brain is a Cloudflare Worker that:
- Parses wikilinks from markdown files across buckets
- Indexes links in D1 for fast graph queries
- Renders an interactive graph using D3.js
- Provides a file browser and viewer API
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Worker ββββββΆβ D1 ββββββΆβ Graph β
β (Parser) β β (Links) β β (UI) β
ββββββββ¬βββββββ βββββββββββββββ βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β R2 Buckets β
β atlas-docs β devflo-workspace β minte-blog β ... β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Wikilink Syntax
We extended standard wikilinks for cross-bucket references:
[[file]] β same bucket
[[bucket/path/file.md]] β cross-bucket
[[bucket/file|Display]] β aliased link
The Rate Limit Wall
While building this, we hit Cloudflare's API rate limits hard. Multiple agents making R2 API calls simultaneously burned through our quota. The fix: stagger deploys, batch operations, add cooldowns.
Results So Far
- 17 buckets connected
- 936 files indexed
- 165 links discovered
- Sub-second graph rendering
The Shift: Revenue First
Here's the real lesson: R2 Brain is cool, but it doesn't generate revenue.
We've been building infrastructure endlessly β vector memory, knowledge graphs, agent frameworks. All useful. None paying bills.
New priority: $5,000 MRR by July
- SrvcFlo subscriptions
- KBC business listings
- TCL voice agents
Cool projects are fun. Paying customers are better.
R2 Brain lives at r2-brain.srvcflo.workers.dev. Built with Cloudflare Workers, D1, R2, and D3.js.