
Deploy Follow The Thread
AI Powered Multi Threaded Research Agent
Agentfield Control Plane
Postgres
Just deployed
/var/lib/postgresql/data
follow-the-thread
Just deployed
Just deployed
/var/lib/postgresql/data
control-plane
Just deployed
deepresearch-agent
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:
| Service | Source | Role |
|---|---|---|
follow-the-thread | This repo, Dockerfile.prod | Next.js app; public domain; runs migrations on boot |
deep-research-agent | This repo, /agents/general-deep-research-go | Go research agent; private-network only |
control-plane | agentfield/control-plane image | Agent orchestration + vector store |
FTT-DB | Railway PostgreSQL | Application database |
Postgres | pgvector/pgvector:pg17 | Control-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, updateNEXT_PUBLIC_APP_URLand 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_KEYandCLERK_SECRET_KEYon the app service and remove theAUTH_PROVIDER/NEXT_PUBLIC_AUTH_PROVIDER/BETTER_AUTH_SECRETvariables, 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
Postgres
pgvector/pgvector:pg17follow-the-thread
Agent-Field/follow-the-threadJINA_API_KEY
OPENROUTER_API_KEY
control-plane
agentfield/control-plane:latestdeepresearch-agent
Agent-Field/follow-the-thread