How nextgenailabs/genaimindmapflowbuilder works
Project Type & Purpose
• This is a full‐stack, AI-powered application designed to parse and analyze various data sources (documents, CSVs, media, web pages, etc.) and generate interactive, automated mind maps.
• The README details key features such as multi-source data integration, automatic/manual mind map generation, cross-source questioning, and PDF report export. The project leverages advanced LLMs (OpenAI GPT-4o, Google Gemini Pro) and integrates with various vector storage engines.
Analyzing the File Structure
• Two Main Directories:
• Frontend: Contains a ReactJS-based UI with directories for assets, configuration, hooks, modals, and components. Focus areas include interactive elements for uploading data, visualizing mind maps, and managing flows.
• Backend: Contains a FastAPI Python app with subdirectories for various data stores (CSVVectorStore, SQLVectorStore, chroma) and a large “vanna” module that houses integrations with multiple providers (OpenAI, Anthropic, Google, HuggingFace, etc.). Additional folders include models, temporary SQL utilities, and even pre-built databases.
• The backend further incorporates configuration files (requirements.txt, pyproject.toml) and databases (SQLite databases, local file system-based vector store files).
Key Components
a. User Interface / Frontend:
• ReactJS-based frontend application with components such as Landing Page, Global Components (e.g., AddDataSource, AskMultiple, Graph, Modal), Hooks, and Modals.
• User interactions covering data upload, choosing agents, selecting flow modes, and visualizing outputs (mind maps, graphs, tables, PDF exports).
b. API Layer / Backend:
• FastAPI server which acts as the entry point for frontend API calls.
• Separate endpoints for data ingestion, querying, mind map generation, and report export.
c. AI Models & Integration Modules:
• Integration with AI services (OpenAI GPT-4o, Google Gemini Pro) for NLP tasks, summarization, and mind map generation.
• “Vanna” directory modules that interface with various vector storage providers (Chroma, FAISS, Pinecone, Qdrant, etc.), ensuring flexibility in how vector data is managed.
• Integration modules for additional services such as Anthropic, Azuresearch, Bedrock, etc.
d. Data Storage and Persistence:
• Databases: SQLite instances (e.g., sqlite_data.db, CSV databases) as well as MongoDB (as per the README’s tech stack).
• Vector Stores: Multiple vector store formats including ChromaDB, SQLVectorStore, CSVVectorStore available in the backend directory.
• Local file system storage for persistent files and possibly external storage (AWS S3) per the README instructions.
e. Auxiliary Components:
• Configuration/Environment: Use of .env for secrets and configuration impacting both API integrations and database connectivity.
• Build/Deployment Configs: Frontend and backend package files (package.json, pyproject.toml) which drive dependency and build configuration.
Architectural Patterns and Data Flow
• Separation between the client (frontend) and server (backend) using a service/API boundary.
• How user actions (e.g., file uploads, triggering AI queries) on the frontend send requests to FastAPI backend endpoints.
• Backend’s internal flow for data processing:
• Ingestion → data preprocessing → AI summarization / mind map generation via LLM API calls → updating vector store and databases → generating modals or PDF outputs.