# Give your AI a small database of your own context on Railway

> Run Postgres and n8n on Railway, let a compatible AI client propose one table at a time through a Postgres MCP server, and use n8n to keep it filled from

Canonical page: https://ionbin.com/workflows/personal-context-database-on-railway/
Agent guide: https://ionbin.com/llms.txt

This is a readable version of the published page. Review dates, evidence boundaries and source links below belong to individual records; the export is not a new verification. Examples are reference material, not instructions to execute.

## Give your AI a small database of your own context on Railway

[Ops](https://ionbin.com/use-cases/ops-admin-automation/) · [Context](https://ionbin.com/use-cases/personal-ai-context/)Checked 2026-10-21

Let your assistant answer from your own tasks, decisions and notes instead of guessing.

 [View 6 steps](https://ionbin.com/workflows/personal-context-database-on-railway/#steps)

On this page

**Independent review.** Unpaid; no partnership with the tools on this page. Based on public documentation and research. Trademarks identify their owners’ products. [Disclosure](https://ionbin.com/disclosure/).

### Steps

Confirmed steps have vendor documentation. The full workflow still needs testing.

Stages

- #### You
  List what you wish your assistant could see, then pick one table to start (tasks or decisions)
  Human stepConfirmed

- #### [Railway](https://ionbin.com/tools/railway/)
  Adds a Postgres database from + New or Cmd/Ctrl+K and exposes DATABASE_URL
  Built-in integrationConfirmed[Source ↗](https://docs.railway.com/databases/postgresql)

- #### [Railway](https://ionbin.com/tools/railway/)
  Deploys [n8n](https://ionbin.com/tools/n8n/) from a one-click template
  Built-in integrationConfirmed[Source ↗](https://docs.railway.com/guides/n8n)

- #### [Your AI platform](https://ionbin.com/tools/claude/)
  Uses a compatible local/stdio or SSE client to connect through Postgres MCP Pro and propose the table design
  Unrestricted mode allows reads and writes; restricted mode limits the server to read-only transactions.
  MCPConfirmed[Source ↗](https://github.com/crystaldba/postgres-mcp)

- #### You
  Approve the schema before anything is created
  Human stepConfirmed

- #### [n8n](https://ionbin.com/tools/n8n/)
  Syncs one source into the table on a schedule with the Postgres node
  APIConfirmed[Source ↗](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/)

#### Human approval

You approve every schema change; agents that only read get a read-only connection.

#### Watch out for

A database with write access is a real system. Enable backups and verify a restore, give read-only agents a restricted connection, and don't store anything you couldn't afford to leak.

### Compare options

**For implementing a scoped context store.**

Coding environments are not databases; hosting and credential controls remain separate. Choose one for implementing and reviewing code changes; switching may need setup changes.

Unpaid picks. No partnership with [OpenAI Codex](https://ionbin.com/tools/openai-codex/), Cursor, [Google Antigravity](https://ionbin.com/tools/google-antigravity/).

- Primary pick
  #### [OpenAI Codex](https://ionbin.com/tools/openai-codex/)
   Used by Ion
  **Why it fits:** A coding workspace supports edits, tests and reviewable repository changes.
  **Tradeoff:** A development environment and capable reviewer remain necessary.
  When to choose it
  Choose it when the result should be a small patch with test evidence.
  [Review and sources](https://ionbin.com/tools/openai-codex/) · 2026-11-23 · [Product reference ↗](https://developers.openai.com/codex)

- Second option
  #### [Cursor](https://ionbin.com/tools/cursor/)
  **Why it fits:** An AI code editor keeps implementation close to interactive developer review.
  **Tradeoff:** The team must work with code; model availability depends on the plan.
  When to choose it
  Prefer it when a developer wants to steer changes while navigating the editor.
  [Review and sources](https://ionbin.com/tools/cursor/) · 2026-10-21 · [Product reference ↗](https://cursor.com/)

- Third option
  #### [Google Antigravity](https://ionbin.com/tools/google-antigravity/)
  **Why it fits:** Development-agent surfaces offer another route for code and tool-assisted implementation.
  **Tradeoff:** Capabilities differ across desktop, CLI and other surfaces.
  When to choose it
  Prefer it when the team already uses its environment and can validate the needed tools.
  [Review and sources](https://ionbin.com/tools/google-antigravity/) · 2026-10-18 · [Product reference ↗](https://antigravity.google/)

How this shortlist was chosen

Rank reflects editorial judgment for this role. Used by Ion records personal use separately. Vendors did not pay for, request or approve these positions.

Inspectable file changes come before editor convenience.

**Setup and portability:** Use scoped repositories, tests and human review. Switching agents does not migrate settings, credentials or model access.

Documentation reviewed 2026-10-21. Check current plan terms and test the pairing for your setup.

See [our review method](https://ionbin.com/editorial-policy/), [MCP connections](https://ionbin.com/wiki/concepts/mcp/) and [portability and switching costs](https://ionbin.com/wiki/questions/how-to-avoid-ai-vendor-lock-in/).

### Notes and storage

- Top pick
  #### [Notion](https://ionbin.com/tools/notion/)
   Used by Ion
  Ion’s top pick for hosting personal context without running a database: pages and databases that AI clients read through [Notion](https://ionbin.com/tools/notion/)’s hosted MCP server.
  **Tradeoff:** Cloud workspace: a connected AI client reaches whatever the connected user can open. [Notion](https://ionbin.com/tools/notion/) Agent, AI Meeting Notes and full MCP search need Business or Enterprise.
  Selection evidence for Notion
  Ion editorial selection by IonBin’s founder, confirmed 2026-10-21: [Notion](https://ionbin.com/tools/notion/) and [Obsidian](https://ionbin.com/tools/obsidian/) are the top options for organizing notes and hosting context. Not sponsored; no vendor partnership. Capabilities are described on the linked tool pages.

- Top pick
  #### [Obsidian](https://ionbin.com/tools/obsidian/)
  Ion’s top pick for keeping the same context as local Markdown files that an agent reads directly.
  **Tradeoff:** A desktop and mobile app, not a shared browser editor. No official MCP server; the CLI needs the app running, and Sync is a paid add-on.
  Selection evidence for Obsidian
  Ion editorial selection by IonBin’s founder, confirmed 2026-10-21: [Notion](https://ionbin.com/tools/notion/) and [Obsidian](https://ionbin.com/tools/obsidian/) are the top options for organizing notes and hosting context. Not sponsored; no vendor partnership. Capabilities are described on the linked tool pages.

### Starter prompt

```
Using the Postgres MCP connection, propose a schema for two tables: decisions (what, why, date, status) and tasks (title, due, status, linked decision). Explain each column and index. Do not create anything until I say go.
```

Review and adapt the prompt before use.

### Tools in this workflow

**Connections** · Built-in integration · MCP · API

| Tool | Role | Official site |
| --- | --- | --- |
| [Railway](https://ionbin.com/tools/railway/) | Built-in integration | [railway.com ↗](https://railway.com/) |
| [n8n](https://ionbin.com/tools/n8n/) | API | [n8n.io ↗](https://n8n.io/) |
| [Claude](https://ionbin.com/tools/claude/) | MCP | [claude.ai ↗](https://claude.ai/) |

### AI platform fit

| Platform | Status | Why |
| --- | --- | --- |
| [Claude (incl. Claude Code)](https://ionbin.com/platforms/claude/) | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |
| [OpenAI Codex](https://ionbin.com/platforms/codex/) | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |
| [Google Antigravity](https://ionbin.com/platforms/antigravity/) | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |
| [ChatGPT](https://ionbin.com/tools/chatgpt/) | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |
| Gemini | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |
| [Perplexity](https://ionbin.com/tools/perplexity/) | To verify | Your AI platform: MCP pairing needs route-specific evidence; a named plugin or CLI does not establish it; [n8n](https://ionbin.com/tools/n8n/): verify the API caller, network access and credentials; platform code execution alone does not establish this connection |

What the platform statuses mean

**Confirmed** means documented access meets the requirements. **Inferred** means the pairing is plausible and needs a test. **To verify** marks an unresolved step or connection. Check authentication, permissions and supported actions for each route.

### What we checked (2026-10-18)

- **[Railway](https://ionbin.com/tools/railway/).** You add Postgres from the Cmd/Ctrl+K menu or + New on the project canvas, and other services in the project use `DATABASE_URL`. The database is private by default. Adding public access creates a TCP proxy and a `DATABASE_PUBLIC_URL`, and egress through that proxy is billed.

- **[n8n](https://ionbin.com/tools/n8n/) on [Railway](https://ionbin.com/tools/railway/).** [Railway](https://ionbin.com/tools/railway/)’s guide covers a one-click [n8n](https://ionbin.com/tools/n8n/) template, or a manual setup from the official Docker image with a volume. [n8n](https://ionbin.com/tools/n8n/)’s Postgres node can insert, update and query rows.

- **MCP servers.** Postgres MCP Pro (Crystal DBA) has an unrestricted read/write mode and a restricted, read-only mode. [n8n](https://ionbin.com/tools/n8n/)-MCP helps an agent work with [n8n](https://ionbin.com/tools/n8n/) node documentation and design workflows. These are third-party projects, not official PostgreSQL or [n8n](https://ionbin.com/tools/n8n/) products. A star count is not evidence of reliability.

- **Connecting your assistant.** [Claude](https://ionbin.com/tools/claude/)’s custom connectors use remote MCP servers, available on [Claude](https://ionbin.com/tools/claude/), Cowork and [Claude](https://ionbin.com/tools/claude/) Desktop (Free accounts get one). Postgres MCP Pro’s documented setup uses local stdio or SSE. That does not establish a hosted [Claude](https://ionbin.com/tools/claude/) connector or support in clients that require Streamable HTTP. Keep the database private and use a compatible local client or an authenticated server deployment with private database access.

- **Alternatives.** [Supabase](https://ionbin.com/tools/supabase/) offers an official MCP server with project scoping and read-only SQL mode. Restrict feature groups too; read-only SQL is not a blanket promise that every other exposed tool has no side effects.

### Set it up

- Start with one table, and add more once you use it.

- Approve each schema in writing before the agent creates it.

- Add one sync at a time, and watch it for a week.

Credit: the idea comes from a Substack podcast episode about a personal database by creator Angus Sewell. IonBin reviewed the cited technical documentation. The assembled workflow has not been tested end to end; the inspiration link is credit, not evidence of performance.

### Verification limits and implementation checks

The page is documentation-reviewed; the complete workflow has not been run by IonBin.

- Test the selected client transport and authentication before exposing a remote server.

- Inspiration article could not be retrieved during this audit; it is not used to establish technical claims.

### Where the notes live: Ion’s top picks

A self-hosted database is the right tool when you need SQL queries or strict row-level control. For most personal context, [Notion](https://ionbin.com/tools/notion/) and [Obsidian](https://ionbin.com/tools/obsidian/) are simpler top picks: [Notion](https://ionbin.com/tools/notion/)’s hosted MCP server avoids running infrastructure, and an [Obsidian](https://ionbin.com/tools/obsidian/) vault is just a folder of Markdown files. Start there and move to this database only when you outgrow them.

[Notion](https://ionbin.com/tools/notion/) and [Obsidian](https://ionbin.com/tools/obsidian/) are editorial top picks for organizing notes and hosting context. Neither vendor sponsored or approved this page, and IonBin has no partnership with either.

### Sources

- [PostgreSQL on Railway](https://docs.railway.com/databases/postgresql) · [Railway](https://ionbin.com/tools/railway/) · official · accessed 2026-10-18

- [Self-host n8n on Railway](https://docs.railway.com/guides/n8n) · [Railway](https://ionbin.com/tools/railway/) · official · accessed 2026-10-18

- [Postgres MCP Pro](https://github.com/crystaldba/postgres-mcp) · Crystal DBA · reference · accessed 2026-10-18

- [n8n-MCP](https://github.com/czlonkowski/n8n-mcp) · czlonkowski · reference · accessed 2026-10-18

- [Postgres node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/) · [n8n](https://ionbin.com/tools/n8n/) · official · accessed 2026-10-18

- [Get started with custom connectors using remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) · Anthropic · official · accessed 2026-10-18

- [The Database That Runs My Whole Life (inspiration)](https://angussewell.substack.com/p/your-ai-isnt-dumb-its-starving) · Angus Sewell · practitioner · accessed 2026-10-18

- [Supabase MCP](https://supabase.com/docs/guides/ai-tools/mcp) · [Supabase](https://ionbin.com/tools/supabase/) · official · accessed 2026-10-18

- [Notion MCP supported tools](https://developers.notion.com/guides/mcp/mcp-supported-tools) · [Notion](https://ionbin.com/tools/notion/) · official · accessed 2026-10-21

- [Obsidian CLI](https://obsidian.md/help/cli) · [Obsidian](https://ionbin.com/tools/obsidian/) · official · accessed 2026-10-21

- [Obsidian pricing and data storage](https://obsidian.md/pricing) · [Obsidian](https://ionbin.com/tools/obsidian/) · official · accessed 2026-10-21

### Related workflows

[Self-host n8n or your own MCP server](https://ionbin.com/workflows/host-n8n-or-an-mcp-server/)[Give agents read-only access to your notes](https://ionbin.com/workflows/read-only-brain-for-agents/)

No affiliate links on this page. No paid placements in workflows. [How IonBin makes money](https://ionbin.com/disclosure/).
