{"id":31803882,"url":"https://github.com/webup/langgraph-up-monorepo","last_synced_at":"2025-10-11T01:48:28.636Z","repository":{"id":315399740,"uuid":"1059315992","full_name":"webup/langgraph-up-monorepo","owner":"webup","description":"A batteries-included monorepo framework for building sophisticated LangGraph applications","archived":false,"fork":false,"pushed_at":"2025-10-08T05:14:45.000Z","size":376,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T05:39:46.552Z","etag":null,"topics":["langchain","langchain-python","langgraph","langgraph-python","langgraph-supervisor-py","langsmith"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T09:29:17.000Z","updated_at":"2025-10-08T05:14:49.000Z","dependencies_parsed_at":"2025-09-18T12:26:26.884Z","dependency_job_id":"cba35f56-46dc-40c4-a6c7-094cd0cd1b8f","html_url":"https://github.com/webup/langgraph-up-monorepo","commit_stats":null,"previous_names":["webup/langgraph-up-monorepo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webup/langgraph-up-monorepo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webup%2Flanggraph-up-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webup%2Flanggraph-up-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webup%2Flanggraph-up-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webup%2Flanggraph-up-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webup","download_url":"https://codeload.github.com/webup/langgraph-up-monorepo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webup%2Flanggraph-up-monorepo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005943,"owners_count":26083987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["langchain","langchain-python","langgraph","langgraph-python","langgraph-supervisor-py","langsmith"],"created_at":"2025-10-11T01:48:23.653Z","updated_at":"2025-10-11T01:48:28.628Z","avatar_url":"https://github.com/webup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 LangGraph-UP Monorepo\n\n**LangGraph-UP Monorepo** showcases how to build production-ready LangGraph agents using the latest **LangChain \u0026 LangGraph** V1 ecosystem, organized in a clean monorepo structure with shared libraries and multiple agent applications.\n\n[![Version](https://img.shields.io/badge/version-v0.2.0-blue.svg)](https://github.com/webup/langgraph-up-monorepo/releases/tag/v0.2.0)\n[![LangChain](https://img.shields.io/badge/LangChain-v1alpha-blue.svg)](https://github.com/langchain-ai/langchain)\n[![LangGraph](https://img.shields.io/badge/LangGraph-v1alpha-blue.svg)](https://github.com/langchain-ai/langgraph)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/badge/PyPI-langgraph--up--devkits-blue.svg)](https://test.pypi.org/project/langgraph-up-devkits/)\n[![Twitter](https://img.shields.io/twitter/follow/zhanghaili0610?style=social)](https://twitter.com/zhanghaili0610)\n\n## ✨ Key Features\n\n- 🌐 **Universal Model Loading** - OpenRouter, Qwen, QwQ, SiliconFlow with automatic registration\n- 🤖 **Multi-Agent Orchestration** - Supervisor \u0026 deep research patterns with specialized sub-agents\n- 🛠 **Custom Middleware** - Model switching, file masking, summarization, and state management\n- 🧪 **Developer Experience** - Hot reload, comprehensive testing, strict linting, PyPI publishing\n- 🚀 **Deployment Ready** - LangGraph Cloud configurations included\n- 🌍 **Global Ready** - Region-based provider configuration (PRC/International)\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Install UV package manager\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Clone and setup\ngit clone https://github.com/webup/langgraph-up-monorepo.git\ncd langgraph-up-monorepo\nuv sync --dev\n```\n\n### 30-Second Demo\n\n```python\nfrom langgraph_up_devkits import load_chat_model\n\n# Zero-setup model loading across providers\nmodel = load_chat_model(\"openrouter:anthropic/claude-sonnet-4\")\n# model = load_chat_model(\"qwen:qwen-flash\")\n# model = load_chat_model(\"siliconflow:Qwen/Qwen3-8B\")\n\n# Start building your agent\nfrom sample_agent import make_graph\n\napp = make_graph()\nresult = await app.ainvoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's 25 * 4?\"}]})\n```\n\n### Sample Agents\n\nThis monorepo includes two complete agent examples demonstrating different patterns:\n\n#### 🤖 sample-agent: Supervisor Pattern\nMulti-agent system with a coordinator that delegates to specialized sub-agents.\n\n```bash\nmake dev sample-agent\n```\n\n**Features:**\n- Supervisor-based coordination\n- Math expert (add, multiply operations)\n- Research expert (web search capabilities)\n- Cross-agent handoffs\n\n#### 🔬 sample-deep-agent: Deep Research Pattern\nAdvanced research workflow with virtual file system and structured planning.\n\n```bash\nmake dev sample-deep-agent\n```\n\n**Features:**\n- Deep web search with content extraction\n- Virtual file system for document management\n- Think tool for strategic TODO planning\n- Research \u0026 critique sub-agents\n- FileSystemMaskMiddleware to optimize token usage\n\n## 🏗 Architecture\n\n### Monorepo Structure\n\n```\nlanggraph-up-monorepo/\n├── libs/\n│   ├── shared/                    # Shared utilities\n│   ├── common/                    # Common helper functions\n│   └── langgraph-up-devkits/      # 🎯 Core framework (published to PyPI)\n│       ├── utils/providers.py     #   → Multi-provider model loading\n│       ├── middleware/            #   → Custom middleware (model, file, summary)\n│       ├── tools/                 #   → Web search, deep search, MCP integration\n│       └── context/               #   → Context schemas \u0026 aware prompts\n├── apps/\n│   ├── sample-agent/              # 🤖 Supervisor pattern (math + research agents)\n│   │   ├── src/sample_agent/\n│   │   │   ├── graph.py           #   → Main supervisor graph\n│   │   │   ├── subagents/         #   → Math \u0026 research experts\n│   │   │   └── tools/             #   → Agent-specific tools\n│   │   └── langgraph.json         #   → Deployment config\n│   └── sample-deep-agent/         # 🔬 Deep research pattern (VFS + think tool)\n│       ├── src/sample_deep_agent/\n│       │   ├── graph.py           #   → Deep agent with research workflow\n│       │   ├── subagents.py       #   → Research \u0026 critique experts\n│       │   └── prompts.py         #   → Structured TODO planning prompts\n│       └── langgraph.json         #   → Deployment config\n├── pyproject.toml                 # Root dependencies\n├── Makefile                       # Development commands\n├── PUBLISHING.md                  # PyPI publishing guide\n└── .github/workflows/             # CI/CD pipeline\n```\n\n### Core Components\n\n#### 🌐 Universal Model Loading\n\nAutomatic provider registration with fallback support:\n\n```python\nfrom langgraph_up_devkits import load_chat_model\n\n# Anthropic via OpenRouter (preferred)\nmodel = load_chat_model(\"openrouter:anthropic/claude-sonnet-4\")\n\n# Qwen models (PRC/International regions)\nmodel = load_chat_model(\"qwen:qwen-flash\")\n\n# SiliconFlow models\nmodel = load_chat_model(\"siliconflow:Qwen/Qwen3-8B\")\n\n# With configuration\nmodel = load_chat_model(\n    \"openrouter:anthropic/claude-sonnet-4\",\n    temperature=0.7,\n    max_tokens=1000\n)\n```\n\n#### 🤖 Multi-Agent Patterns\n\n```python\nfrom sample_agent.subagents import math, research\nfrom sample_agent.tools import create_handoff_tool\n\n# Create specialized agents\nmath_agent = math.make_graph()\nresearch_agent = research.make_graph()\n\n# Enable handoffs between agents\nmath_to_research = create_handoff_tool(\"research_expert\")\nresearch_to_math = create_handoff_tool(\"math_expert\")\n```\n\n#### 🔧 Custom Middleware (LangChain v1)\n\nBuilt-in middleware for dynamic model switching, state management, and behavior modification:\n\n```python\nfrom langchain.agents import create_agent\nfrom langgraph_up_devkits import (\n    ModelProviderMiddleware,\n    FileSystemMaskMiddleware,\n    load_chat_model\n)\n\n# Model provider middleware for automatic switching\nmodel_middleware = ModelProviderMiddleware()\n\n# File system middleware to mask large file content from LLM context\nfs_middleware = FileSystemMaskMiddleware()\n\nagent = create_agent(\n    model=load_chat_model(\"openrouter:gpt-4o\"),  # Fallback model\n    tools=[web_search, deep_web_search],\n    middleware=[model_middleware, fs_middleware]\n)\n\n# Context specifies different model - middleware switches automatically\ncontext = {\"model\": \"siliconflow:Qwen/Qwen3-8B\"}\nresult = await agent.ainvoke(messages, context=context)\n```\n\n**Available Middleware:**\n- `ModelProviderMiddleware` - Dynamic model switching based on context\n- `FileSystemMaskMiddleware` - Masks virtual file systems from LLM to save tokens\n- `SummarizationMiddleware` - Automatic message summarization for long conversations\n\nFor detailed documentation on additional features like middleware, tools, and utilities, see:\n\n- **Framework Documentation**: [`libs/langgraph-up-devkits/README.md`](libs/langgraph-up-devkits/README.md)\n- **Agent Examples**: [`apps/sample-agent/README.md`](apps/sample-agent/README.md)\n\n## 🛠 Development\n\n### Commands\n\nSee the [Makefile](Makefile) for complete command reference.\n\n```bash\n# Testing\nmake test                    # Run all tests\nmake test_libs              # Test libraries only\nmake test_apps              # Test applications only\nmake unit sample-agent      # Test specific app\n\n# Code Quality\nmake lint                   # Run linters (ruff + mypy)\nmake format                 # Format code\n\n# Development\nmake dev sample-agent                    # Start dev server with browser\nmake dev sample-agent -- --no-browser   # Start without browser\nmake dev sample-agent -- --host 0.0.0.0 --port 3000  # Custom host/port\n\n# Publishing (langgraph-up-devkits)\nmake build_devkits                       # Build distribution packages\nmake check_devkits                       # Validate package\nmake release_test_devkits               # Build and publish to Test PyPI\nmake release_devkits                     # Build and publish to PyPI\n```\n\nSee [PUBLISHING.md](PUBLISHING.md) for detailed publishing guide.\n\n### Project Structure Guidelines\n\n- **`libs/`** - Reusable packages shared across agents\n- **`apps/`** - Individual agent implementations\n- **Shared dependencies** - Managed in root `pyproject.toml`\n- **Agent-specific deps** - In app-level `pyproject.toml`\n\n### Creating New Agents\n\n```bash\n# Copy sample agent structure\ncp -r apps/sample-agent apps/my-agent\n\n# Update configuration\n# Edit apps/my-agent/langgraph.json\n# Edit apps/my-agent/pyproject.toml\n# Implement apps/my-agent/src/my_agent/graph.py\n```\n\n## 🧪 Testing\n\n```bash\n# Run all tests (126+ tests in libs, 10+ in apps)\nmake test\n\n# Run tests for specific components\nmake test_libs              # Test libraries only\nmake test_apps              # Test applications only\nmake unit sample-agent      # Test specific app\n```\n\n## 🔧 Troubleshooting\n\nCommon issues and detailed troubleshooting guides are available in:\n\n- **Setup Issues**: [`libs/langgraph-up-devkits/README.md#troubleshooting`](libs/langgraph-up-devkits/README.md#troubleshooting)\n- **Agent Issues**: [`apps/sample-agent/README.md#troubleshooting`](apps/sample-agent/README.md#troubleshooting)\n\n## 🤝 Contributing\n\n### Development Setup\n\n```bash\ngit clone https://github.com/your-org/langgraph-up-monorepo.git\ncd langgraph-up-monorepo\nuv sync\nmake lint  # Ensure code quality\nmake test  # Run test suite\n```\n\n### Code Standards\n\n- **Type Safety** - Strict mypy checking enabled\n- **Code Style** - Ruff formatting and linting\n- **Testing** - High test coverage required\n- **Documentation** - Comprehensive docstrings\n\n### Submission Process\n\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/amazing-feature`)\n3. Ensure tests pass (`make test`)\n4. Ensure linting passes (`make lint`)\n5. Commit changes (`git commit -m 'Add amazing feature'`)\n6. Push to branch (`git push origin feature/amazing-feature`)\n7. Open Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n### Core Frameworks\n- **[LangGraph](https://github.com/langchain-ai/langgraph)** - Agent orchestration framework\n- **[LangChain](https://github.com/langchain-ai/langchain)** - Foundation for agent components\n\n### Development Tools\n- **[UV](https://github.com/astral-sh/uv)** - Fast Python package management\n- **[langchain-dev-utils](https://github.com/TBice123123/langchain-dev-utils)** - Development utilities for LangChain\n\n### Model Providers\n- **[OpenRouter](https://openrouter.ai/)** - Multi-provider model access\n\n---\n\n**Built with ❤️ for the LangGraph community**\n\nReady to build production-grade agents? [Get started →](#-quick-start)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebup%2Flanggraph-up-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebup%2Flanggraph-up-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebup%2Flanggraph-up-monorepo/lists"}