How xianjianlf2/mindgeniusai works
MindGenius AI is a self-hosted document-to-mind-map workbench. A user chats with the Hermas agent, which can retrieve passages from attached PDFs, generate a new map, expand branches, or propose node-ID edits; streamed results and edits update the browser’s editable canvas. The web app also supports manual editing, saved maps, document management, import/export, and multi-provider model keys. Groupings reflect the web workbench, server agent, document retrieval, and shared protocol. Some subsystem links are based on README documentation because their implementation excerpts were not provided.
Main entry points: App.tsx Workbench shell · chatStore.ts Chat state · tools.ts Agent tools · agent.ts Agent API route
Components 20
Web workbench
- Workbench shell
apps/web/src/App.tsx - Chat interface
apps/web/src/components/Conversation.tsx - Chat state
apps/web/src/stores/chatStore.ts - HTTP and SSE
apps/web/src/api/requests.ts - Map canvas
apps/web/src/components/MindMapCanvas.tsx - Canvas renderer
apps/web/src/mindmap/controller.ts - Map state and edits
apps/web/src/stores/nodeStore.ts - Document drawer
apps/web/src/components/SourcesDrawer.tsx - Command palette
apps/web/src/components/CommandPalette.tsx - Import and export
apps/web/src/utils/import.ts
Agent and models
- Agent API route
apps/server/src/routes/agent.ts - Hermas orchestration
apps/server/src/agent/hermas.ts - Agent tools
apps/server/src/agent/tools.ts - Prompt templates
apps/server/src/prompts/index.ts - Model provider
apps/server/src/llm/provider.ts
Document retrieval
- Document API
apps/server/src/routes/documents.ts - PDF indexing and retrieval
apps/server/src/services/rag.ts
Shared contracts
- Agent and SSE protocol
packages/shared/src/protocol.ts
Other components
- Knowledge worker
- LLM provider service
Connections 26
- Knowledge worker → Workbench shell: uses
README.md - Workbench shell → Chat interface: shows
apps/web/src/App.tsx - Workbench shell → Map canvas: shows
apps/web/src/App.tsx - Workbench shell → Document drawer: shows
apps/web/src/App.tsx - Workbench shell → Command palette: shows
apps/web/src/App.tsx - Chat interface → Chat state: submits messages
- Chat state → HTTP and SSE: sends requests
apps/web/src/stores/chatStore.ts - HTTP and SSE → Agent API route: streams agent request
README.md - Agent API route → Hermas orchestration: invokes
apps/server/src/routes/agent.ts - Hermas orchestration → Agent tools: runs tool loop
apps/server/src/agent/hermas.ts - Agent tools → Prompt templates: builds prompts
apps/server/src/agent/tools.ts - Agent tools → Model provider: requests models
apps/server/src/agent/tools.ts - Model provider → LLM provider service: calls
README.md - Agent tools → PDF indexing and retrieval: retrieves passages
apps/server/src/agent/tools.ts - Knowledge worker → Document drawer: attaches PDFs
README.md - Document drawer → Document API: uploads and indexes
README.md - Document API → PDF indexing and retrieval: indexes and queries
apps/server/src/routes/documents.ts - Hermas orchestration → Agent and SSE protocol: emits agent events
apps/server/src/agent/hermas.ts - Agent API route → Agent and SSE protocol: streams events
apps/server/src/routes/agent.ts - Chat state → Agent and SSE protocol: handles events
apps/web/src/stores/chatStore.ts - Chat state → Map state and edits: applies map results
- Map canvas → Canvas renderer: renders map
apps/web/src/mindmap/controller.ts - Map state and edits → Canvas renderer: provides tree
apps/web/src/mindmap/controller.ts - Knowledge worker → Map canvas: edits manually
README.md - Knowledge worker → Import and export: imports or exports
README.md - Knowledge worker → Command palette: searches maps and docs
README.md