Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
The mapper was producing garbage connections (e.g. "checkin" daily note
matched to mental health vertices) because it used raw keyword overlap
on vault note content. Carry already exports structured semantic triples
via `carry query --format json`.
Changes:
- Install carry binary in container (patchelf for Nix→Debian compat)
- Run `carry query` during sync to export JSON (entities, citations,
connections) — always runs, not just after git pull
- Rewrite mapper to use carry structured data:
1. Carry connections: match by URL overlap with island vertices,
resolve entity names to URLs via carry entity index
2. Carry entities/citations: match by TF-IDF name similarity
3. D1 carry data: same structured matching
- Remove vault note content matching entirely
- Remove Letta URL discovery (carry records already have URLs)
- Add TF-IDF weighting with IDF computed across carry + island corpus
- Expand stop words to filter common vault noise
- Add connections to D1 getCarryData (worker reads connection records)
- Remove Letta env vars from worker/container
Performance: 301-vertex island analysis drops from 3.5min to 0.26s.
Quality: all connections are real semantic triples, no more noise.
Tested locally with `docker run -v carry-vault:/data/carry`.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <noreply@letta.com>
The O(n*m) keyword overlap between vault/carry notes and island
vertices was too slow for the full 301-vertex island. Now precomputes
token sets once and reuses them across all comparisons.
- tokenize() returns Set<string> for fast membership checks
- keywordOverlap(setA, textB) takes a precomputed set
- keywordOverlapSets(setA, setB) for set-set intersection
- findBestVertexMatch accepts precomputed vertexTokenSets
- All callers updated to pass precomputed sets
Full island analysis (301 vertices, 654 vault notes, 42 carry notes):
completes in ~3.5min (dominated by 10 Letta API calls for URL discovery).
Matching itself is now sub-second.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <noreply@letta.com>
When a carry or vault note has no https:// URL, the analysis now calls
the Letta API (url-discoverer agent with tavily_search tool) to find
the canonical URL. This ensures all connection records have valid
https:// targets.
- Created url-discoverer agent (agent-36607e8a) on Letta Cloud
- Container calls Letta API for notes lacking URLs during analysis
- Secrets: LETTA_API_KEY, LETTA_AGENT_ID in Cloudflare
- Fixed async/await for findFilesystemTouchpoints (was returning Promise)
- Health endpoint shows lettaKeySet and lettaAgentId
Test: 14 connections found for single-vertex island, all with https://
targets discovered via Letta web search.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <noreply@letta.com>
carry:// and vault:// URI schemes are not valid connection targets.
The graph only deals with https:// URLs.
- Filesystem touchpoints: extract the https:// URL from each carry/vault
note and use it as the target. Notes without URLs are skipped.
- D1 carry touchpoints: use the carry record url field (not atUri) as
the target for entities and reasonings. Citations already used url.
- Deleted 41 garbage connection records from PDS (carry://, vault://,
and at:// targets).
- Removed temporary cleanupConnections endpoint.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <noreply@letta.com>
Container now syncs both vault (ob sync) and carry (git pull) on startup:
- Fixed obsidian-cli → obsidian-headless (correct npm package name)
- Fixed ob sync path syntax (--path flag, not positional arg)
- Container writes auth token + vault config to ~/.config/obsidian-headless/
- Secrets: OBSIDIAN_AUTH_TOKEN, OBSIDIAN_ENCRYPTION_KEY, OBSIDIAN_ENCRYPTION_SALT
- Container health endpoint shows vaultFiles, carryFiles, token status
- Sync endpoint returns vault/carry log output for debugging
Result: 654 vault files + 42 carry files synced in container.
Analysis now finds 279 touchpoints (vault + carry) against island vertices.
👾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta Code <noreply@letta.com>