Skip to content

misbah7172/Agent-Mind-Map

Repository files navigation

MemoryAgent

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.

Stack

  • Frontend: React, Vite, React Flow, dagre
  • Backend: Node.js, Express
  • Database: Supabase Postgres
  • Realtime: Postgres NOTIFY graph_updated through the API SSE bridge, with optional Supabase Realtime subscription for ingestion_log inserts
  • LLM: Qwen OpenAI-compatible chat completion endpoint

Setup

  1. Install dependencies:
npm install
  1. Copy environment settings:
copy .env.example .env
  1. Set DATABASE_URL in .env to your Supabase Postgres connection string.

  2. Run database/schema.sql in Supabase SQL editor before ingesting data.

  3. Set QWEN_API_KEY in .env. For an offline UI demo, set USE_LOCAL_EXTRACTOR=true.

  4. Start the app:

npm run dev

Frontend: http://localhost:5173

API: http://localhost:8787

Verification

npm run lint
npm run build
npx tsc --noEmit --ignoreConfig --target ES2022 --module NodeNext --moduleResolution NodeNext --esModuleInterop --skipLibCheck server/index.ts

Notes

  • 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, and ingestion_log timestamps.
  • The optional transition_node_statuses() function in the schema is intended to be scheduled with Supabase pg_cron.

About

MemoryAgent is a local Qwen Cloud knowledge-graph demo that lets a user paste text or upload a PDF, sends the content to Qwen for structured node-and-edge extraction, validates the JSON, stores the graph in Supabase Postgres, and visualizes it as a live React Flow mind map

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors