mirror of
https://github.com/langchain-ai/python-langraph-monorepo-example.git
synced 2026-08-24 14:33:08 -04:00
5bfbbc1c5e3645953d4781af206dca24f8b0cec2
Bumps the uv group with 1 update in the / directory: [langgraph](https://github.com/langchain-ai/langgraph). Updates `langgraph` from 0.6.6 to 1.0.10rc1 - [Release notes](https://github.com/langchain-ai/langgraph/releases) - [Commits](https://github.com/langchain-ai/langgraph/compare/0.6.6...1.0.10rc1) --- updated-dependencies: - dependency-name: langgraph dependency-version: 1.0.10rc1 dependency-type: direct:production dependency-group: uv ... Signed-off-by: dependabot[bot] <support@github.com>
LangGraph Monorepo Example
A Python monorepo example demonstrating LangGraph agents with shared packages.
Structure
python-monorepo-example/
├── libs/
│ ├── shared/ # Real package with pyproject.toml
│ │ ├── pyproject.toml
│ │ └── src/shared/
│ │ ├── __init__.py
│ │ └── utils.py # get_dummy_message(), get_shared_timestamp()
│ └── common/ # Faux package (no pyproject.toml)
│ ├── __init__.py
│ └── helpers.py # get_common_prefix()
├── apps/
│ ├── agent1/
│ │ ├── langgraph.json # deps: ["../../libs/shared", "../../libs/common"]
│ │ ├── pyproject.toml
│ │ └── src/agent1/
│ │ ├── __init__.py
│ │ ├── state.py
│ │ └── graph.py # Simple single-node LangGraph
│ └── agent2/
│ ├── langgraph.json # deps: ["../../libs/shared", "../../libs/common"]
│ ├── pyproject.toml
│ └── src/agent2/
│ ├── __init__.py
│ ├── state.py
│ └── graph.py # Simple single-node LangGraph
├── pyproject.toml # Root project with shared dependencies
├── .gitignore
└── README.md
Key Features
Shared Packages
libs/shared/: Real Python package withpyproject.toml, containing utility functionslibs/common/: Faux package (directory with Python files, nopyproject.toml)
Shared dependencies
- There is a root
pyproject.tomlthat contains shared dependencies for all your agents
Agent Configuration
- Each agent has
langgraph.jsonwith"dependencies": ["../../libs/shared", "../../libs/common", "."] - Each agent has its own
pyproject.tomlfor agent-specific dependencies
Usage
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.
Agent 1
langgraph build -t python-monorepo-agent-1 -c apps/agent1/langgraph.json
langgraph up -c apps/agent1/langgraph.json --image IMAGE_ID_GENERATED_ABOVE
Agent 2
langgraph build -t python-monorepo-agent-2 -c apps/agent2/langgraph.json
langgraph up -c apps/agent2/langgraph.json --image IMAGE_ID_GENERATED_ABOVE
Description
Languages
Python
100%