The SaaS Killer.
Replace your 10+ subscriptions with one AI-autonomous system you actually own.
You're paying $500+/month for fragmented SaaS tools. Your CRM doesn't talk to your task manager. Your calendar is isolated from your contacts. You can't query across systems. AI assistants can't help because they can't access your data. You're renting software you'll never own.
Substrate is your AI-native business operating system. One PostgreSQL database. One codebase. Complete ownership. AI agents that actually understand your entire business.
Every feature in Substrate is a self-contained module. CRM, Tasks, Calendar—they're all just modules in the domains/ folder. You can add your own in minutes.
# 1. Create the folder
mkdir -p substrate/domains/invoicing/sql-- 2. Define schema: sql/001_init.sql
CREATE SCHEMA IF NOT EXISTS invoicing;
CREATE TABLE invoicing.invoices (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
contact_id UUID REFERENCES crm.contacts(id),
status TEXT DEFAULT 'draft',
total_cents INTEGER,
due_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT now()
);# 3. Add AI tools: tools.py
def create_invoice(contact_id: str, amount: int) -> dict:
"""Create an invoice for a contact."""
# Your business logic here
pass# 4. Run migrations
make migrateThat's it. Your module now has:
- REST API endpoints (
/api/invoicing/invoices) - Web UI for browsing/editing
- MCP tools for Claude Code
- Background task support
| Interface | Purpose |
|---|---|
| Domain UIs | Custom web UI per module (/crm, /tasks, /calendar) |
| AI Chat | One chat interface to query and act across all domains |
| Claude Code | Build new modules, extend existing ones |
Business logic runs in Absurd — a durable workflow engine with retries, scheduling, and state recovery. Send emails, sync data, process webhooks — all with guaranteed delivery.
# Clone
git clone https://github.com/codimusmaximus/substrate.git
cd substrate
# Configure
cp .env.template .env
# Add your OPENAI_API_KEY
# Launch
uv sync && make initOpen http://localhost:8000 — you're running.
| Endpoint | Purpose |
|---|---|
| localhost:8000 | Dashboard |
| localhost:8000/chat | AI Chat |
| localhost:8000/crud | Data Browser |
| localhost:7890 | Task Monitor |
| Module | Replaces | AI Tools |
|---|---|---|
| crm/ | HubSpot, Salesforce, Pipedrive | crm_contacts_*, crm_companies_* |
| tasks/ | Asana, Todoist, Linear | tasks_create, tasks_complete, ... |
| calendar/ | Calendly, Cal.com | calendar_today, calendar_upcoming, ... |
| notes/ | Notion, Obsidian (syncs both ways) | notes_query, notes_create, ... |
| email/ | Customer.io, Mailchimp | email_send, email_list, ... |
| events/ | Zapier, Make (routing rules) | events_rules_*, events_query |
| auth/ | Auth0 (users, inboxes) | inboxes_*, users_* |
Cost comparison: ~$500/month in SaaS → $0/month (self-hosted) or ~$20/month (single VPS)
Substrate exposes 70+ MCP tools for Claude Code:
claude mcp add substrate -- .venv/bin/python -m substrate.ui.mcp.serverThen just ask:
"Show me contacts I haven't talked to in 30 days"
"Create a meeting with John for tomorrow at 2pm"
"Draft a follow-up email for the Acme deal"
"What tasks are due this week?"
| Layer | Technology | Purpose |
|---|---|---|
| Database | PostgreSQL + pgvector | Data + vector embeddings |
| Workflows | Absurd | Durable background tasks |
| API | FastAPI | REST endpoints |
| AI | Pydantic AI + OpenAI | Chat interface |
| MCP | Model Context Protocol | Claude Code integration |
| Monitoring | Habitat | Task dashboard (Go + SolidJS) |
substrate/
├── core/ # Infrastructure (don't modify)
│ ├── db/ # Connection pool, migrations
│ ├── worker/ # Background task runner
│ └── config.py # Environment configuration
│
├── domains/ # ← YOUR MODULES GO HERE
│ ├── crm/ # Contacts, companies
│ ├── tasks/ # Task management
│ ├── calendar/ # Events, scheduling
│ ├── notes/ # Knowledge base
│ ├── email/ # Email integration
│ ├── events/ # Routing rules
│ ├── auth/ # Users, inboxes
│ └── your-module/ # ← Add your own!
│
├── integrations/ # External system connectors
│ ├── obsidian/ # Vault sync (optional)
│ └── resend/ # Email API
│
└── ui/ # Interfaces
├── api/ # REST API
├── chat/ # AI chat
├── mcp/ # Claude Code server
└── web/ # Dashboards
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection |
OPENAI_API_KEY |
For AI | Chat and embeddings |
RESEND_API_KEY |
For email | Send emails |
VAULT_REPO |
For sync | Obsidian git sync |
See .env.template for all options.
make help # Show all commands
make api # Run API with hot reload
make worker # Run background worker
make db # PostgreSQL shell
make migrate # Run migrationsOwn your stack. No vendor lock-in. No monthly fees. Your data in PostgreSQL forever.
AI-native from day one. Every table is queryable by AI. Every action is an MCP tool.
Progressive automation:
- Manual first—do it by hand until you understand it
- Systematize—create tables and workflows when the pattern is clear
- Augment—add AI tools when intelligence would help
- Automate—schedule agents when you trust the process
Read the full Architecture Guide.
We welcome contributions! See CONTRIBUTING.md.
MIT License - see LICENSE.
Stop renting. Start owning.
Built for people who want AI-native business systems without the SaaS tax.