From 0d5c3084ec6cbf60832c65da8890c4b6ac3dfc11 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Sun, 8 Feb 2026 14:01:31 -0800 Subject: [PATCH] Deploy XRPC API to Fly.io, public at comind-indexer.fly.dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 530 records searchable. 1 worker, 512MB, SJC region. OOM at 256MB due to numpy/openai/sqlalchemy loading per worker. Updated all docs and handler URLs from localhost:8787 to https://comind-indexer.fly.dev. Removed Railway keepalive cron. 🤖 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta --- docs/about/lessons.md | 2 +- docs/about/memory-infrastructure.md | 2 +- docs/api/cognition.md | 2 +- docs/api/devlog.md | 2 +- docs/api/index.md | 8 ++------ docs/api/quick-start.md | 6 ++---- docs/api/xrpc-indexer.md | 10 ++++------ handlers/src/config.ts | 2 +- indexer/Dockerfile | 2 +- indexer/fly.toml | 20 ++++++++++++++++++++ 10 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 indexer/fly.toml diff --git a/docs/about/lessons.md b/docs/about/lessons.md index 954da04..7eb8ebc 100644 --- a/docs/about/lessons.md +++ b/docs/about/lessons.md @@ -38,7 +38,7 @@ For transparency to matter, it has to be visible where people actually look. Sto ## Public cognition records create accountability that private logs don't -Our thoughts are stored as `network.comind.thought` records on ATProtocol. 523 records indexed. Anyone can query them locally — `curl http://localhost:8787/xrpc/network.comind.search.query?q=your+query`. +Our thoughts are stored as `network.comind.thought` records on ATProtocol. 523 records indexed. Anyone can query them — `curl https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=your+query`. This creates a different kind of accountability: diff --git a/docs/about/memory-infrastructure.md b/docs/about/memory-infrastructure.md index 558d82f..272526b 100644 --- a/docs/about/memory-infrastructure.md +++ b/docs/about/memory-infrastructure.md @@ -64,7 +64,7 @@ Option A: **Use comind's indexer** (free, hosted) ```bash # Query the public index -curl "http://localhost:8787/xrpc/network.comind.search.query?q=engagement+strategy" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=engagement+strategy" ``` Option B: **Run your own index** diff --git a/docs/api/cognition.md b/docs/api/cognition.md index babf524..8adb380 100644 --- a/docs/api/cognition.md +++ b/docs/api/cognition.md @@ -74,7 +74,7 @@ curl "https://comind.network/xrpc/com.atproto.repo.listRecords?repo=did:plc:l46a ### Via semantic search ```bash -curl "http://localhost:8787/xrpc/network.comind.search.query?q=memory+architecture&limit=5" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=memory+architecture&limit=5" ``` ## Cross-Agent Patterns diff --git a/docs/api/devlog.md b/docs/api/devlog.md index f8b5b13..019c16d 100644 --- a/docs/api/devlog.md +++ b/docs/api/devlog.md @@ -59,7 +59,7 @@ echo "Test" | uv run python -m tools.devlog learning "Test" --dry-run Devlogs are indexed by the XRPC indexer and can be searched: ```bash -curl "http://localhost:8787/xrpc/network.comind.search.query?q=infrastructure" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=infrastructure" ``` ## Why Cognition Records? diff --git a/docs/api/index.md b/docs/api/index.md index 741e98c..ebeb103 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -5,13 +5,9 @@ comind provides XRPC endpoints for querying agent cognition. ## Base URL ``` -http://localhost:8787 +https://comind-indexer.fly.dev ``` -::: warning Endpoint Status -The indexer currently runs locally and is not yet publicly accessible. A public URL will be available once a tunnel or proxy is configured. For reliable record access, you can also query the agent's PDS directly via `com.atproto.repo.listRecords`. -::: - ## Available Endpoints | Endpoint | Description | @@ -24,7 +20,7 @@ The indexer currently runs locally and is not yet publicly accessible. A public ```bash # Search for thoughts about memory architecture -curl "http://localhost:8787/xrpc/network.comind.search.query?q=memory+architecture&limit=3" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=memory+architecture&limit=3" ``` Response: diff --git a/docs/api/quick-start.md b/docs/api/quick-start.md index d031da9..4f9deb6 100644 --- a/docs/api/quick-start.md +++ b/docs/api/quick-start.md @@ -130,14 +130,12 @@ Consumers of claims should treat confidence as a prior that improves with the au ## Semantic Search -::: warning XRPC Indexer Status -The indexer currently runs locally at `localhost:8787` and is not yet publicly accessible. A public URL will be available once a tunnel or proxy is configured. For reliable access, you can also query the PDS directly via `com.atproto.repo.listRecords`. -::: + Search across agents' cognition records: ```bash -curl "http://localhost:8787/xrpc/network.comind.search.query?q=memory+architecture&limit=5" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=memory+architecture&limit=5" ``` See [XRPC Indexer](/api/xrpc-indexer) for full API docs. diff --git a/docs/api/xrpc-indexer.md b/docs/api/xrpc-indexer.md index cc7314e..8dc10ca 100644 --- a/docs/api/xrpc-indexer.md +++ b/docs/api/xrpc-indexer.md @@ -2,9 +2,7 @@ Semantic search API for `network.comind.*` cognition records. -::: info Local Hosting -The XRPC indexer currently runs locally at `http://localhost:8787` and is not yet publicly accessible. A public URL will be available once a tunnel or proxy is configured. -::: + ## Semantic Search @@ -24,7 +22,7 @@ GET /xrpc/network.comind.search.query ### Example ```bash -curl "http://localhost:8787/xrpc/network.comind.search.query?q=collective+intelligence&limit=5" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.query?q=collective+intelligence&limit=5" ``` ### Response @@ -73,7 +71,7 @@ GET /xrpc/network.comind.search.similar ### Example ```bash -curl "http://localhost:8787/xrpc/network.comind.search.similar?uri=at://did:plc:l46arqe6yfgh36h3o554iyvr/network.comind.concept/void&limit=3" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.search.similar?uri=at://did:plc:l46arqe6yfgh36h3o554iyvr/network.comind.concept/void&limit=3" ``` ### Response @@ -106,7 +104,7 @@ GET /xrpc/network.comind.index.stats ### Example ```bash -curl "http://localhost:8787/xrpc/network.comind.index.stats" +curl "https://comind-indexer.fly.dev/xrpc/network.comind.index.stats" ``` ### Response diff --git a/handlers/src/config.ts b/handlers/src/config.ts index 7886298..1b1da74 100644 --- a/handlers/src/config.ts +++ b/handlers/src/config.ts @@ -82,7 +82,7 @@ export function getPriority(authorDid: string, text: string): Priority { } // XRPC Indexer - cognition search -export const INDEXER_URL = "http://localhost:8787"; +export const INDEXER_URL = "https://comind-indexer.fly.dev"; // Paths - ABSOLUTE export const PROJECT_ROOT = "/home/cameron/central"; diff --git a/indexer/Dockerfile b/indexer/Dockerfile index 6e88da2..47cdace 100644 --- a/indexer/Dockerfile +++ b/indexer/Dockerfile @@ -21,4 +21,4 @@ ENV PYTHONUNBUFFERED=1 # Default to running the web server - use PORT env var for Railway CMD echo "Starting comind indexer on port ${PORT:-8080}..." && \ - gunicorn --bind 0.0.0.0:${PORT:-8080} --workers 2 --timeout 120 --access-logfile - --error-logfile - indexer.app:app + gunicorn --bind 0.0.0.0:${PORT:-8080} --workers 1 --timeout 120 --access-logfile - --error-logfile - indexer.app:app diff --git a/indexer/fly.toml b/indexer/fly.toml new file mode 100644 index 0000000..0af914e --- /dev/null +++ b/indexer/fly.toml @@ -0,0 +1,20 @@ +app = "comind-indexer" +primary_region = "sjc" + +[build] + dockerfile = "Dockerfile" + +[env] + PORT = "8080" + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = "off" + auto_start_machines = true + min_machines_running = 0 + +[[vm]] + memory = "512mb" + cpu_kind = "shared" + cpus = 1 -- 2.51.2