
Deploy txtai
Embeddings database with semantic search, graph, RAG and an MCP server
Just deployed
/data
Deploy and Host txtai on Railway
txtai is an open-source, all-in-one embeddings database from NeuML. It combines a vector index, a SQLite content store and a semantic graph in one service, and serves semantic search, graph queries, retrieval augmented generation (RAG) and a Model Context Protocol (MCP) server through a single REST API.
About Hosting txtai
This template builds txtai 9.14.0 from the official neuml/txtai-cpu image, pinned by digest in a public GitHub repo, so you get an update notice when a new version is merged. It runs as one service with a volume at /data that holds the index, its content store and graph, and the downloaded embedding model, so restarts and redeploys keep your data. Upstream ships the API without authentication; here every route and the MCP endpoint need a bearer token that Railway generates at deploy, and the service refuses to start without one. Embeddings run on CPU inside the service, so indexing and search need no API key.
Common Use Cases
- Semantic search API for your app, docs or support tickets, without a separate vector database or an embeddings bill
- Long-term memory and knowledge search for AI agents over MCP (Claude Code, Cursor and other MCP clients that can send a header)
- RAG backend that answers questions from your own documents with any LiteLLM-supported model
- Exploring how documents relate: graph search returns the matching documents and the links between them
Dependencies for txtai Hosting
- txtai 9.14.0 (
neuml/txtai-cpu), built fromaalfath/txtai-railway-template - A Railway volume at
/datafor the index and model cache - Optional: an LLM provider key (OpenAI, Anthropic and others through LiteLLM) for
/rag
Deployment Dependencies
- txtai on GitHub: https://github.com/neuml/txtai
- txtai releases: https://github.com/neuml/txtai/releases
- API documentation: https://neuml.github.io/txtai/api/
- Configuration reference: https://neuml.github.io/txtai/api/configuration/
- Template repo: https://github.com/aalfath/txtai-railway-template
Implementation Details
After the deploy, copy API_TOKEN from the txtai service's Variables tab and send it as a bearer token:
URL=https://YOUR-DOMAIN; AUTH="Authorization: Bearer YOUR-API-TOKEN"
# Add documents, then build and save the index on the volume
curl -X POST "$URL/add" -H "$AUTH" -H "Content-Type: application/json" \
-d '[{"id": "ada", "text": "Ada Lovelace wrote the first program for the Analytical Engine."}]'
curl "$URL/upsert" -H "$AUTH"
# Semantic search, and the same search as a graph
curl -G "$URL/search" -d query=who+programmed+the+engine -d limit=3 -H "$AUTH"
curl -G "$URL/search" -d query=early+computers -d graph=true -H "$AUTH"
MCP. The endpoint is https://YOUR-DOMAIN/mcp (SSE transport) with the same header. In Claude Code: claude mcp add --transport sse txtai https://YOUR-DOMAIN/mcp --header "Authorization: Bearer YOUR-API-TOKEN".
RAG. To turn on GET /rag, add LLM_MODEL (any LiteLLM model, for example openai/gpt-4o-mini) and the matching provider key (OPENAI_API_KEY, ANTHROPIC_API_KEY, ...) to the service, then redeploy.
Your own config. Set CONFIG to a txtai YAML string to replace the generated configuration; keep path: under /data. EMBEDDINGS_MODEL picks the Hugging Face model; changing it after indexing means re-indexing. The interactive API docs are at /docs.
Why Deploy txtai 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 txtai 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

