AI diagram workspace for turning rough ideas into editable Mermaid diagrams.
Built with Cowork for teams that need architecture, process, and product diagrams to stay editable after the first draft.
Why · Features · Quick Start · Configuration · API · Development
Graphini is an open-source AI diagram workspace. Describe a system, workflow, schema, or handoff in plain English, then edit the generated Mermaid source beside the rendered diagram.
Unlike image-first diagram tools, Graphini keeps the diagram as text. That means you can repair it, diff it, save it with project docs, export it for slides or tickets, and keep iterating after the first AI draft.
Most AI diagram tools produce a picture. Pictures are easy to share, but hard to review, version, or regenerate from source.
Graphini is built for the messy middle between "we should diagram this" and "this belongs in docs":
Use Graphini when you want a diagram that can be generated quickly, edited precisely, and handed off as code.
| Layer | Technology |
|---|---|
| Framework | SvelteKit 2, Svelte 5, Vite 7, TypeScript 5 |
| UI | Tailwind CSS 4, bits-ui, Lucide, Font Awesome, Iconify |
| Editor and rendering | Mermaid 11, CodeMirror, Monaco, svg-pan-zoom |
| AI | Vercel AI SDK 6, OpenAI, Anthropic, OpenRouter, Gemini |
| Data | PostgreSQL, Neon serverless driver, Drizzle ORM |
| Auth | Magnova Auth cookie flow plus local/dev session fallback |
| Testing | Vitest, Playwright, coverage-v8 |
| Deployment | SvelteKit Vercel adapter |
24+10+OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, or GEMINI_API_KEYgit clone https://github.com/omkarbhad/graphini.git
cd graphini
pnpm install
cp .env.example .env
Fill in DATABASE_URL, COOKIE_SECRET, and whichever provider keys you want to use.
Apply the checked-in schema and migrations:
psql "$DATABASE_URL" -f database/schema.sql
psql "$DATABASE_URL" -f database/v2-schema.sql
psql "$DATABASE_URL" -f database/add-app-settings.sql
psql "$DATABASE_URL" -f database/add-admin-settings.sql
psql "$DATABASE_URL" -f database/add-files-persistence.sql
psql "$DATABASE_URL" -f database/add-files-support.sql
psql "$DATABASE_URL" -f database/add-user-memories.sql
psql "$DATABASE_URL" -f database/add-gemini-provider.sql
psql "$DATABASE_URL" -f database/performance-indexes.sql
pnpm dev
Open http://localhost:3000. Localhost development automatically enables the dev auth bypass unless you configure auth differently.
Typical .env:
# Auth
MAGNOVA_AUTH_URL=https://auth.magnova.ai
COOKIE_SECRET=replace-with-a-long-random-secret
DEV_BYPASS_AUTH=true
# Database
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=require
# AI providers
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4o
ANTHROPIC_API_KEY=
ANTHROPIC_AUTH_TOKEN=
OPENROUTER_API_KEY=
GEMINI_API_KEY=
# Admin
ADMIN_SECRET_KEY=replace-with-admin-secret
[email protected]
See .env.example for all supported variables.
Graphini ships an OpenAPI 3 spec at api/openapi.yaml. It documents auth, chat, model settings, workspaces, documents, diagram generation, audio/upload conversion, collaborators, credits, admin operations, and MCP tool discovery.
Useful API groups:
| Area | Endpoints |
|---|---|
| Auth | /api/auth/login, /api/auth/register, /api/auth/me, /api/auth/logout |
| Chat | /api/chat, /api/conversations, /api/conversations/messages |
| Workspaces | /api/workspaces, /api/workspaces/{id}, /api/workspaces/{id}/document |
| Diagrams | /api/diagram/generate, /api/diagram/generate-stream, /api/diagram/analyze-error |
| Settings | /api/app-settings, /api/models, /api/model-lab, /api/admin |
| Integrations | /api/upload, /api/audio, /api/mcp/tools |
pnpm dev # Vite dev server
pnpm build # Production build
pnpm preview # Preview production build
pnpm lint # Prettier + ESLint
pnpm lint:fix # Format and autofix lint issues
pnpm test:unit # Vitest
pnpm test:unit:coverage # Vitest with coverage
pnpm test:e2e # Playwright
pnpm test # Unit + E2E
The predev, prebuild, and prepreview hooks run scripts/build-aws-icon-pack.mjs so the icon pack is available to the app.
Graphini includes a benchmark harness for natural-language-to-Mermaid sequence diagrams:
pnpm bench:mermaid-seq -- --validate-dataset
OPENROUTER_API_KEY=... pnpm bench:mermaid-seq -- --limit 3
OPENROUTER_API_KEY=... pnpm bench:mermaid-seq -- --model openrouter:nvidia/nemotron-3-super-120b-a12b:free --judge-model openrouter:openai/gpt-oss-120b
Runs are written to tests/logs/mermaid-seq-bench/.
graphini/
├── api/ # OpenAPI spec
├── database/ # PostgreSQL schema and migrations
├── docs/ # Project docs, security, code of conduct
├── scripts/ # Icon-pack build and benchmark scripts
├── src/
│ ├── lib/
│ │ ├── components/ # Shared UI and shell components
│ │ ├── features/
│ │ │ ├── chat/ # AI chat UI and artifacts
│ │ │ ├── diagram/ # Mermaid rendering and diagram state
│ │ │ ├── editor/ # Desktop/mobile editor surfaces
│ │ │ ├── history/ # Diagram history utilities
│ │ │ └── icons/ # Icon metadata and lookup
│ │ ├── server/ # Auth, database, agents, chat, admin, rate limits
│ │ ├── stores/ # Svelte stores
│ │ └── util/ # Client/server helpers
│ └── routes/ # SvelteKit pages and API routes
├── static/ # Logo, screenshots, favicons, icon assets
├── tests/ # Unit and Playwright tests
├── package.json
├── svelte.config.js
└── vite.config.js
git checkout -b feature/your-changepnpm lint and the relevant testsSee docs/CODE_OF_CONDUCT.md and docs/SECURITY.md.