React + FastAPI app to visually compose workflows (User Query → KnowledgeBase → LLM Engine → Output) and chat through the pipeline. Uses PostgreSQL for workflows and logs, ChromaDB for vector search, Gemini for LLM and embeddings, SerpAPI for optional web search, PyMuPDF for text extraction.
- Node 18+
- Python 3.10+
- PostgreSQL running and accessible
Backend:
GEMINI_API_KEY=your_gemini_key
SERPAPI_KEY=your_serpapi_key
DATABASE_URL=postgresql://user:password@localhost/workflow_builder
# Optional
GEMINI_EMBEDDING_MODEL=text-embedding-004
Frontend (optional):
REACT_APP_API_BASE=http://localhost:8000
Backend:
pip install -r backend/requirements.txt
uvicorn backend.app.main:app --reload --host 0.0.0.0 --port 8000Frontend:
cd frontend
npm install
npm start- Build Stack
- Drag components in the left panel onto the canvas, connect:
userQuery→knowledgeBase(optional) →llmEngine→output. - Configure nodes from the right panel.
- Click "Build Stack" to save the workflow. This assigns an ID.
- Upload Documents (optional)
- POST file to
/api/documents/upload/{workflow_id}. - The file text is extracted (PyMuPDF), chunked, embedded (Gemini), and stored in ChromaDB under
workflow_{id}collection.
- Chat with Stack
- Click "Chat with Stack" and ask questions. The app will follow your edges, optionally retrieve context from the knowledge base and web search, then answer with Gemini.
- Backend
- FastAPI routers:
workflows,documents,chat WorkflowExecutororchestrates nodes in orderDocumentProcessormanages extraction, embeddings, and ChromaDBGeminiClientfor LLM responses and embeddingsSearchServicefor SerpAPI web results
- FastAPI routers:
- Frontend
- React Flow builder with configurable node types
- Zustand store persists saved workflow ID for chat
- API base configurable via
REACT_APP_API_BASE
- ChromaDB persists to
./chroma_db. - Ensure you set
GEMINI_API_KEYandSERPAPI_KEYbefore running. - Saved workflow ID is required before chatting.
- Add auth, workflow versioning, execution logs, chat history views.