An AI-powered agent that generates complete solution architectures from application documentation. Built with Claude (Anthropic), Supabase (pgvector RAG), and Streamlit.
User Input (PDF/DOCX/text)
↓
[1] Requirements Extraction ← Claude claude-sonnet-4-6
↓
[2] Platform Search ← pgvector similarity search (Supabase)
↓
[3] Architecture Composition ← Claude claude-sonnet-4-6
↓
[4] Diagram Generation ← Claude claude-sonnet-4-6
↓
Streamlit UI: Architecture Doc + Mermaid Diagram
Stack:
| Component | Service | Cost |
|---|---|---|
| AI Reasoning | Anthropic Claude API | ~$0.05–0.15/run |
| Vector DB / RAG | Supabase (free tier) | Free |
| Embeddings | OpenAI text-embedding-3-small | ~$0.02/M tokens |
| UI | Streamlit (local or Community Cloud) | Free |
- Python 3.11+
- A Supabase account (free): https://supabase.com
- An Anthropic API key: https://console.anthropic.com
- An OpenAI API key (embeddings only): https://platform.openai.com
git clone <this-repo>
cd solution-architect-agent
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .envEdit .env and fill in your API keys:
ANTHROPIC_API_KEY=sk-ant-...
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key
OPENAI_API_KEY=sk-...
Finding your Supabase credentials:
- Go to https://supabase.com → your project → Settings → API
SUPABASE_URL= Project URLSUPABASE_KEY=anonpublickey
- Go to your Supabase project → SQL Editor
- Paste the contents of
supabase_schema.sql - Click Run
This creates:
platformstable with pgvector columnreference_architecturestablegenerated_architecturestable (history)search_platforms()RPC functionsearch_reference_architectures()RPC function
python seed_catalog.pyThis populates 25 platforms across 10 categories with embeddings. Takes ~1 minute and costs < $0.01.
streamlit run app.pyUse the sidebar to load one of three pre-built demo scenarios:
- Customer Portal — SaaS integration with Salesforce + ServiceNow
- ERP Upgrade — Oracle EBS on-prem with HA/DR
- IoT Data Pipeline — Smart meter ingestion at scale
Click "Generate Solution Architecture" and wait ~30–60 seconds.
Option A: Upload a document
- PDF, DOCX, or TXT file containing application requirements, vendor specs, or project documentation
Option B: Paste requirements Include in your text:
- What the application does
- How many users / what access types
- Integration points (what systems it connects to)
- Availability requirements (SLA, RTO, RPO)
- Data characteristics (relational, NoSQL, size)
- Any special requirements
The agent produces:
- Requirements Summary — extracted structured requirements
- Platform Candidates — ranked platforms from your catalog
- Architecture Document — full markdown architecture doc with justifications
- Mermaid Diagram — interactive diagram (also editable at mermaid.live)
- Download — Markdown file download
Edit seed_catalog.py → add entries to the PLATFORMS list → re-run:
python seed_catalog.pyAdd to the refs list in seed_catalog.py → re-run the seeder.
You can chunk existing architecture documents and add them to reference_architectures table directly.
- Push this repo to GitHub (remove
.env, add.env.example) - Go to https://share.streamlit.io
- Connect your repo
- Add secrets in Streamlit Cloud settings (Settings → Secrets) matching your
.envkeys - Deploy — free public URL
| Activity | Est. Cost |
|---|---|
| One-time catalog seeding (embeddings) | < $0.01 |
| Per architecture generation | $0.05 – $0.20 |
| 100 demo runs | $5 – $20 |
Set a spend limit: Anthropic Console → Billing → Monthly spend limit ($25 is plenty for a demo)
solution-architect-agent/
├── app.py # Streamlit UI (main entry point)
├── seed_catalog.py # One-time DB seeder
├── supabase_schema.sql # Run once in Supabase SQL Editor
├── requirements.txt
├── .env.example
├── agent/
│ ├── __init__.py
│ └── pipeline.py # Core 4-step agent pipeline
└── utils/
├── __init__.py
└── doc_parser.py # PDF/DOCX/TXT parser
pgvector extension error in Supabase
→ Run create extension if not exists vector; in the SQL Editor first (already in the schema file).
search_platforms function not found
→ Make sure you ran the full supabase_schema.sql in SQL Editor, not just the table creation.
Mermaid diagram not rendering → The Mermaid CDN requires internet access in your browser. If working offline, diagram source is available to copy to mermaid.live.
Empty platform results
→ Confirm you ran seed_catalog.py and it completed without errors. Check Supabase Table Editor to confirm rows exist in platforms.
OpenAI API key not needed after seeding?
→ Correct! OpenAI is only used during seed_catalog.py (one-time) and at query time to embed the search query. If you want to eliminate OpenAI entirely, you can swap in a local embedding model via sentence-transformers — see the comment in pipeline.py.