Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
The mapper was still trying to TF-IDF match carry entity names to
island vertex titles, producing garbage like "Vect" matching
"disinformation vector". The fundamental problem: carry entity URLs
and island vertex URLs have zero overlap — they track different things
(homepages vs articles).
Solution: follow carry semantics directly. A carry connection is
source → relation → target. If one side is in the island, create a
bridge. If neither side is in the island, emit as a "nearby" connection
that expands the knowledge graph. No keyword matching at all.
Changes:
- Remove TF-IDF scoring, tokenization, findBestVertexMatch
- Remove keywordOverlapSets, computeIdf, tfidfScore
- matchCarryData now only checks URL overlap and emits carry triples
- Fix synthesis to use deduped count (was showing 53, now shows 20)
Result: 20 connections, all real carry semantic triples:
- Cosmik Network → built → Semble
- Dialog DB → related-to → Ink and Switch
- Astera Institute → related-to → Arcadia Science
etc.
None bridge to the island (zero URL overlap) — honest result.
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 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>