How langchain-ai/open-agent-platform works
Project type and purpose
• This is a TurboRepo monorepo containing two Next.js apps:
• apps/docs – a documentation site built in MDX/Next.js
• apps/web – the main Open Agent Platform (OAP) web application
• Purpose: a no-code, web-based platform for building, configuring, and interacting with LangGraph agents, with RAG integration, external tool connectivity (via MCP), agent supervision, and authentication.
Main system components
a. Presentation layer (apps/web/src/app & components):
– Next.js 13 React front-end using the App Router
– UI component library (apps/web/src/components/ui)
– Feature modules (agents, chat, rag, tools, auth, inbox)
b. API layer (apps/web/src/app/api):
– /api/auth – Supabase auth callback and session management
– /api/langgraph – Proxy for LangGraph GraphQL API
– /api/oap_mcp – Proxy to your MCP (external tool) servers
c. State & context providers (apps/web/src/providers):
– Auth, Agents, MCP contexts to supply data to the React tree
d. Data & services
– Supabase (authentication, user data)
– LangGraph Platform (agent definitions & deployments)
– LangConnect RAG server (separate RAG service)
– External MCP tool servers
e. Documentation site (apps/docs):
– MDX pages, custom agent guides, quickstart, setup instructions
f. CI/CD & build orchestration
– TurboRepo (turbo.json) building both apps
– GitHub Actions (ci.yml) running lint/tests
Relationships & data flows
• User’s browser → Next.js front-end (SSR/CSR components)
• Front-end calls Next.js API routes → these routes call external services
• Auth flows: front-end ↔ Supabase
• Agent management: API routes ↔ LangGraph API
• RAG features: API routes ↔ LangConnect server
• Tool execution: API routes ↔ MCP servers
• Documentation site is independently served (no backend calls beyond static content)
Architectural patterns & design principles
• Monorepo modularization via TurboRepo
• Full-stack Next.js (App Router + API routes = frontend + backend)
• React Context Providers for global state
• Proxy pattern for external service integration
• Config-driven UI (reads LangGraph’s x_oap_ui_config metadata)
• Separation of concerns: feature-based folders, shared UI library
Detail
• Call out the provider/context layer under the UI
• API routes by function
• That docs site is an isolated static deployment