- JavaScript 45%
- TypeScript 43%
- HTML 9%
- CSS 3%
pensieve #
search everything on your PDS. sign in with your atproto account, pensieve walks your public repo, embeds text, images, and video thumbnails into one vector space, and gives you a single search box over all of it.
https://pensieve.waow.tech
how it works #
who are you? → atproto OAuth → build index → search → save to your PDS
- identity —
@atcute/oauth-node-clientas a discoverable public client. the session lives behind an opaque cookie; the stored OAuth session is used for exactly one write path: saving your own index to your own PDS (repo:tech.waow.pensieve.index+blob:*/*). sign-in and building are invite-only (ALLOWED_DIDSplus invites admins add from settings), because indexing is the only thing that spends money. - index — built by a durable object, so closing the tab never kills a
build.
com.atproto.sync.getRepo→@atcute/repoCAR walk → artifact inference (src/artifact.js) →voyage-multimodal-3.5→ turbopuffer, one namespace per DID, one vector column for text and media. images are embedded by URL via the bsky CDN thumbnail (460k px, ~$0.0003 each); video contributes its poster frame; gifs come straight from the PDS blob because the CDN renders them blank. likes, follows, reposts, and blocks are skipped. - freshness — an unchanged, complete index with the current model/pipeline
and no failed media verifies the repo revision and stored row count, then
skips the CAR download and manifest scan. Other builds re-walk the repo and
diff
(id, cid)against what turbopuffer already holds, so only new or changed records are embedded and deleted ones are pruned. blob rows are content-addressed and never re-embed./api/mecompares the stored rev togetLatestCommitso the UI can offer a refresh only when the repo actually moved. - search — query embedded with the same model, ANN + BM25 in parallel, reciprocal-rank fused. Search excludes stored vectors from returned results; optional collection filters apply before candidate selection. A media row and its parent record collapse into one result carrying the thumbnail, and constellation backlinks show who referenced a result.
- memory — your index can be saved to your own PDS as a
tech.waow.pensieve.indexrecord (int8 vectors + pointers, chunked blobs): anyone could compute it from your public repo, saving it just spares them the cost. design and the private/shared half: docs/memory.md.
measured #
on did:plc:xbtmt2zjwlrfegqvch7fboei (29,695 records, 16 MB CAR), apple m-series,
scripts/bench.mjs:
| stage | number |
|---|---|
| CAR walk | 29,695 scanned → 9,370 kept + 869 media in 234 ms |
voyage images, image_url, batch 16 |
0.86 Mpx/s at conc 1 → 2.85 Mpx/s at conc 4, flat past 4 |
| voyage text, 96 inputs | ~2.2–3.0 s (voyage-4-lite was ~0.5 s; unified space costs that) |
| turbopuffer upsert | ~1.2 s / 96 rows, ~2.1 s / 256 rows |
| turbopuffer query | ~75 ms |
the pipeline runs 4 embed→upsert tasks concurrently (workers allow 6 outbound
connections). a full first build of that repo is ~$0.35 of voyage. An unchanged
healthy index needs a getLatestCommit call, a KV metadata read, and one small
storage query; it makes no embedding or write calls. Failed, partial, outdated,
or missing indexes take the normal diff/retry path.
The shared-backend contract describes reusable query preparation, collection scoping, provider billing, and the remaining work before operator-funded search can use Pensieve as its private backend. The existing Character service binding keeps its current access rules.
develop #
Repository instructions live in AGENTS.md. Shared skills live in
.agents/skills/, discovered directly by Pi and Codex, with compatibility
symlinks in .claude/skills/ for Claude Code.
npm install
cp .dev.vars.example .dev.vars # VOYAGE_API_KEY, TURBOPUFFER_API_KEY
npm run dev # open http://127.0.0.1:8787 — not localhost,
# the loopback OAuth client needs the IP
node scripts/bench.mjs --did did:plc:... --passes 5
VOYAGE_API_KEY=... node scripts/bench.mjs --did did:plc:... --embed 96 --conc 4
to map what an account posts about, the way atlas maps the network:
npm run atlas -- --actor someone.bsky.social
it indexes the account into pensieve (diffing like any build, so a current
index costs nothing), embeds each post's own words, lays them out with umap,
and writes a self-contained page to atlas/. name the regions by filling in
label in atlas/<handle>.clusters.json and re-running with --no-index.
see docs/OPERATIONS.md for deploy, secrets, and KV.
project map #
src/worker.js routes: oauth, /api/me, /api/index, /api/build, /api/search
src/auth.js oauth client, kv stores, cookie session
src/build.js build orchestration: lease, slices, cancel, stall detection
src/builder.js the IndexBuilder durable object (thin shell over build.js)
src/index.js walk → diff → embed → upsert pipeline, search fusion
src/artifact.js record → {title, body, url, media} inference
src/pack.js tech.waow.pensieve.index chunks: int8 vectors, cbor entries
src/publish.js writes the index record + blobs to the owner's PDS
src/public/ static front end (html, css, js — no build step)
lexicons/ tech.waow.pensieve.{index,memory,memoryAccess}
scripts/bench.mjs reproducible pipeline numbers
scripts/atlas.mjs a 2D map of one account's posts (scripts/atlas.html)
Character consumer #
CharacterMemory is a named Worker entrypoint for the Character app's private
service binding. It exports bounded pages of existing text vectors and source
metadata for current members of Character's invitation database, checked through
the CHARACTER_DB D1 binding on every call. Its private POST /ensure route
reuses complete indexes or schedules a missing index through IndexBuilder;
running builds return progress and failed builds require an explicit retry.
It has no public HTTP or publication route. The caller authenticates its session and chooses that session's
DID. Active builds and changed index revisions prevent consuming mixed snapshots.
Character verifies sources against the CAR and caches its own derived analysis;
it never receives Pensieve's provider credentials. Existing build permissions
and the public-index publishing flow are independent of this grant.
Character previews may include an explicit requester DID on the private binding. The requester must be a current, unblocked Character admin; this grant only reads or prepares the target's public index. It grants no target session or publication rights. Character cold-index starts share a D1 ceiling of 10 per UTC day; active or complete indexes do not consume another start. Both normal and preview reads respect Character's app-local block list for the requesting account.