How cloudgeometry/langbuilder works
Project type and purpose
• This is a full-stack, self-hostable AI workflow builder and execution platform (“LangBuilder”), derived from LangFlow.
• It combines a React/TypeScript visual flow editor (frontend), a Python-based API & orchestration engine (backend), background workers (Celery), and a suite of deployment/infrastructure scripts.
High-level file structure
• Top level:
• src/frontend – React + Vite + ReactFlow editor, UI components, API hooks
• src/backend – Python package “langflow” with submodules: API routes, services (database, cache, chat, storage, task queue, telemetry), core, CLI, server, Celery app
• scripts/ – IaC and deployment helpers (AWS CDK, GCP, CI)
• docker/ & deploy/ – Dockerfiles and docker-compose configs for each service
• docs/ – Docusaurus site for user & dev guides
README insights
• Three layers:
1. Visual IDE (frontend + ReactFlow)
2. Programmable framework (backend API, LCEL orchestration, Python components)
3. Deployment & management (Celery, Docker, CDK, Kubernetes, CI/CD)
• Core technologies: Python 3.10+, uvicorn/uv, FastAPI-style routing, SQLAlchemy + Alembic migrations, Celery, Redis/RabbitMQ (for task queue), React, TypeScript, Vite, Docker, AWS CDK / GCP scripts
Main components & interactions (
A. Frontend application
• React/Vite SPA
• ReactFlow-based visual editor & playground
• API client layer (REST + WebSocket)
B. Backend API server
• Uvicorn/uv entrypoint (server.py)
• FastAPI-style routers under api/v1 & api/v2
• Authentication, authorization, feature-flags
• Control-plane (flow definitions) and data-plane (runtime events)
C. Background worker
• Celery app (celery_app.py + celeryconfig.py)
• Executes long-running flows, asynchronous tasks, callbacks
D. Data stores
• Relational DB (PostgreSQL, MySQL, etc. via SQLAlchemy + Alembic)
• Cache / message broker (Redis or RabbitMQ)
• Object storage (local disk or S3)
E. External services
• LLM providers (OpenAI, Anthropic, Bedrock, local models)
• Vector DBs (Chroma, Pinecone, Redis, Milvus, etc.)
• Third-party connectors (Notion, Gmail, Slack, etc.)
F. Infrastructure & deployment
• Dockerized microservices (API server, Celery worker, Redis, DB)
• Docker-compose and Kubernetes configurations
• AWS CDK (scripts/aws) and GCP scripts
• Frontend → HTTP/WS → Backend API
• Backend API → SQLAlchemy → Relational DB
• Backend API → Celery → Message Broker
• Celery Worker → executes tasks, writes results → DB / Storage
• Backend & Worker → integrate with external LLM & Vector services
• Admin CLI & scripts → deploy via Docker / CDK
Important architectural patterns
• Layered architecture: UI layer, API layer, service layer, data layer
• Service-oriented design within a monorepo (services/* factories)
• Repository/Factory patterns for database models, storage, caching
• Task queue pattern with Celery for asynchronous orchestration
• Plugin pattern for components and connectors (dynamic import, custom components)
Detail level
• Essential elements (UI, API, services, DB, queues, external)
• Avoid over-splitting; group similar connectors into “Component Plugins”
• Both synchronous (HTTP) and asynchronous (message queue) flows
• Deployment artifacts (Docker, CDK) as infrastructure notes or a footer layer