This repository provides a sample of deploying LangGraph agents inside a monorepo structure, demonstrating how agents can access and utilize shared workspace packages. This approach enables code reuse and consistent dependencies across multiple agents while maintaining a clean monorepo architecture.
isaac-js-graph/
├── libs/
│ └── shared/ # Shared package with utilities
│ ├── package.json
│ ├── tsconfig.json
│ └── src/
│ ├── index.ts # Exported utilities
│ └── index.js
├── apps/
│ ├── agent1/
│ │ ├── langgraph.json # LangGraph configuration
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── src/
│ │ ├── graph.ts # LangGraph implementation
│ │ └── state.ts # State definitions
│ └── agent2/
│ ├── langgraph.json # LangGraph configuration
│ ├── package.json
│ ├── tsconfig.json
│ └── src/
│ ├── graph.ts # LangGraph implementation
│ └── state.ts # State definitions
├── package.json # Root workspace configuration
├── turbo.json # Turborepo configuration
├── tsconfig.json # Root TypeScript config
└── yarn.lock
- Multiple agents deployed within a single monorepo
- Shared workspace packages accessible by all agents
- Consistent dependency management across agents
Each agent can be run independently using the LangGraph CLI, and both will have access to the shared utility functions via the dependency configuration. For monorepo support, you can run your build command from the root, getting the benefits of the shared dependencies.
langgraph build -t js-monorepo-agent-1 --build-command "yarn run turbo build" -c apps/agent1/langgraph.json
langgraph build -t js-monorepo-agent-2 --build-command "yarn run turbo build" -c apps/agent2/langgraph.json