Qwen Cloud hackathon demo app that ingests text or PDFs, extracts a knowledge graph, persists it in Postgres, and renders the live graph with React Flow.
- Frontend: React, Vite, React Flow, dagre
- Backend: Node.js, Express
- Database: Supabase Postgres
- Realtime: Postgres
NOTIFY graph_updatedthrough the API SSE bridge, with optional Supabase Realtime subscription foringestion_loginserts - LLM: Qwen OpenAI-compatible chat completion endpoint
- Install dependencies:
npm install- Copy environment settings:
copy .env.example .env-
Set
DATABASE_URLin.envto your Supabase Postgres connection string. -
Run database/schema.sql in Supabase SQL editor before ingesting data.
-
Set
QWEN_API_KEYin.env. For an offline UI demo, setUSE_LOCAL_EXTRACTOR=true. -
Start the app:
npm run devFrontend: http://localhost:5173
API: http://localhost:8787
npm run lint
npm run build
npx tsc --noEmit --ignoreConfig --target ES2022 --module NodeNext --moduleResolution NodeNext --esModuleInterop --skipLibCheck server/index.ts- Duplicate uploads are skipped by SHA-256 hash in
ingestion_log. - Qwen output is validated with a strict schema before any database write.
- Node colors map directly to
status: active green, updated yellow, archived gray. - Time-lapse snapshots are reconstructed from
nodes,edges, andingestion_logtimestamps. - The optional
transition_node_statuses()function in the schema is intended to be scheduled with Supabasepg_cron.