Railway

Deploy Follow The Thread

AI Powered Multi Threaded Research Agent

Deploy Follow The Thread

Agentfield Control Plane

Just deployed

/var/lib/postgresql/data

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

Deploy and Host follow-the-thread on Railway

Follow The Thread is an open-source AI deep-research platform. You give it a research question or a reusable "brief"; AI agents run multi-step web research — parallel search, full-page source reading, synthesis — and produce structured, cited research documents you can explore, share publicly, and refresh on a schedule. Bring an OpenRouter API key for LLMs and a Jina AI key for web search — both have free/low-cost tiers.

About Hosting follow-the-thread

The template deploys the full five-service stack, wired together over Railway's private network: a Next.js application (UI, API, and Postgres-backed research state), the AgentField control plane that orchestrates agent execution and stores RAG vectors, a Go deep-research agent that performs the actual searching and synthesis, and two PostgreSQL databases — a standard one for the app and a pgvector-enabled one required by the control plane's vector store. Database schemas migrate automatically on first boot, all internal secrets are auto-generated, and authentication defaults to Better Auth (self-hosted email/password on your own Postgres — no third-party auth account needed). You supply exactly two values at deploy time: an OpenRouter API key and a Jina AI API key.

Common Use Cases

  • Self-hosted research assistant that turns a question into a cited, structured research document — company and market research, due diligence, technical literature scans — with your data on your own infrastructure
  • Recurring research briefs from the built-in marketplace (e.g. signals radar, bear/bull analysis, thesis stress-testing) that refresh on a schedule and notify you of changes
  • Research over your own knowledge: upload documents or connect data sources (Snowflake, Databricks) and let the agent combine them with live web research via RAG

Dependencies for follow-the-thread Hosting

  • An OpenRouter API key — LLM inference and embeddings (required)
  • A Jina AI API key — web search and full-page content reading during research (required; free tier available)
  • Optional: an additional search provider key (Exa, Tavily, Firecrawl, or Serper) to extend the search chain

Implementation Details

The five services and how they connect:

ServiceSourceRole
follow-the-threadThis repo, Dockerfile.prodNext.js app; public domain; runs migrations on boot
deep-research-agentThis repo, /agents/general-deep-research-goGo research agent; private-network only
control-planeagentfield/control-plane imageAgent orchestration + vector store
FTT-DBRailway PostgreSQLApplication database
Postgrespgvector/pgvector:pg17Control-plane storage (pgvector required)

Worth knowing after you deploy:

  • NEXT_PUBLIC_* variables are baked in at build time. If you attach a custom domain later, update NEXT_PUBLIC_APP_URL and redeploy (rebuild) the app service.
  • The agent registers with the control plane once at boot. If you redeploy the control plane, redeploy the agent afterwards so it re-registers.
  • To use Clerk instead of the default Better Auth, set NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY on the app service and remove the AUTH_PROVIDER / NEXT_PUBLIC_AUTH_PROVIDER / BETTER_AUTH_SECRET variables, then redeploy. Google/GitHub social sign-in for Better Auth lights up when you add each provider's OAuth client id and secret.
  • Search quality scales with keys: Jina (required) covers search plus full-page reading; adding Exa, Tavily, Firecrawl, or Serper extends the provider chain, and a per-provider circuit breaker skips any that fail.
  • A fresh deploy typically converges within a few minutes: databases first, then the control plane migrates its schema, the agent waits for it before registering, and the app applies its migrations after its server starts.

Full per-service configuration reference: RAILWAY.md in the repository.

Why Deploy follow-the-thread on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying follow-the-thread on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
3
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
63