Repository navigation
chore: fix langgraph quickstart - #2341
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
WalkthroughAdds an editable-install note to the LangGraph quickstart docs, updates example Python project dependencies (version bumps, loosened pins, added langchain-openai), pins example UI CopilotKit packages to 1.10.2, and rewires the example FastAPI demo to use LangGraphAGUIAgent with add_langgraph_fastapi_endpoint. Changes
Sequence Diagram(s)sequenceDiagram
participant DevApp as FastAPI app
participant Registrar as add_langgraph_fastapi_endpoint
participant Agent as LangGraphAGUIAgent
participant AGUI as LangGraph AG-UI
rect rgba(200,230,255,0.4)
DevApp->>Registrar: register(agent, path="/")
Registrar->>Agent: attach endpoint handlers
end
rect rgba(220,255,220,0.4)
DevApp->>Agent: HTTP request (user interacts)
Agent->>AGUI: stream/dispatch events
AGUI-->>Agent: responses/events
Agent-->>DevApp: HTTP response
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
examples/coagents-starter/agent-py/pyproject.toml (1)
28-32: Align LangChain and langchain-openai versions in pyproject.tomlLangchain-openai 0.3.30 doesn’t explicitly require langchain ≥0.3.30, but the two packages are tightly coupled and minor-version mismatches can lead to subtle runtime errors. For maximum stability:
• File: examples/coagents-starter/agent-py/pyproject.toml (lines 28–32, 36)
– Update
diff - langchain = "0.3.21" + langchain = "0.3.30"
– Ensure your langchain-openai entry (if present) also reads:
toml langchain-openai = "0.3.30"
• If upgrading langchain isn’t feasible, pin langchain-openai back to 0.3.21 to match core.
• In either scenario, add or extend end-to-end tests around the LangChain ↔ OpenAI integration to catch any compatibility issues.examples/coagents-starter/agent-py/requirements.txt (1)
4-12: Keep this file auto-synced from Poetry to avoid version skew.This matches the current intent, but manual updates drift over time—especially with dual version sources in pyproject.toml.
Export from Poetry instead of hand-maintaining:
- Command: poetry export -f requirements.txt --without-hashes -o examples/coagents-starter/agent-py/requirements.txt
- Consider wiring a CI check to fail if export diff is non-empty.
Optional: consider retaining upper bounds for servers (e.g., uvicorn, fastapi) to avoid unplanned breaking changes in a starter.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
examples/coagents-starter/agent-py/poetry.lockis excluded by!**/*.lockexamples/coagents-starter/ui/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
docs/content/docs/langgraph/quickstart.mdx(1 hunks)examples/coagents-starter/agent-py/pyproject.toml(2 hunks)examples/coagents-starter/agent-py/requirements.txt(1 hunks)examples/coagents-starter/ui/package.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
examples/*/ui/**
📄 CodeRabbit Inference Engine (.cursor/rules/examples-and-demos.mdc)
Frontend applications in examples should be implemented as Next.js applications inside the 'ui/' directory.
Files:
examples/coagents-starter/ui/package.json
examples/coagents-starter/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
Check [coagents-starter/] for basic multi-agent system setup
Files:
examples/coagents-starter/ui/package.jsonexamples/coagents-starter/agent-py/requirements.txtexamples/coagents-starter/agent-py/pyproject.toml
docs/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
Check [docs/] for documentation site
Files:
docs/content/docs/langgraph/quickstart.mdx
docs/content/docs/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
See [docs/content/docs/] for markdown documentation files
Files:
docs/content/docs/langgraph/quickstart.mdx
examples/*/{agent,agent-py}/**
📄 CodeRabbit Inference Engine (.cursor/rules/examples-and-demos.mdc)
Backend agent implementations should be placed in 'agent/' (for JavaScript/TypeScript) or 'agent-py/' (for Python) directories within each example project.
Files:
examples/coagents-starter/agent-py/requirements.txtexamples/coagents-starter/agent-py/pyproject.toml
examples/coagents-starter/agent-py/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
Check [coagents-starter/agent-py/] for Python agent example
Files:
examples/coagents-starter/agent-py/requirements.txtexamples/coagents-starter/agent-py/pyproject.toml
🧠 Learnings (11)
📚 Learning: 2025-07-04T14:02:44.814Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/quick-reference.mdc:0-0
Timestamp: 2025-07-04T14:02:44.814Z
Learning: Applies to CopilotKit/package.json : Review [CopilotKit/package.json] for workspace setup
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-04T14:02:44.814Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/quick-reference.mdc:0-0
Timestamp: 2025-07-04T14:02:44.814Z
Learning: Applies to CopilotKit/package.json : Use [CopilotKit/package.json] for workspace setup
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-18T15:02:56.788Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/agent-development.mdc:0-0
Timestamp: 2025-07-18T15:02:56.788Z
Learning: Applies to **/agent-js/package.json : Install 'copilotkit/sdk-js' package for JavaScript agents.
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-18T15:03:09.674Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/copilotkit-architecture.mdc:0-0
Timestamp: 2025-07-18T15:03:09.674Z
Learning: Applies to CopilotKit/package.json : Workspace configuration should be managed in CopilotKit/package.json
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-04T14:02:44.814Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/quick-reference.mdc:0-0
Timestamp: 2025-07-04T14:02:44.814Z
Learning: Applies to CopilotKit/packages/react-core/**/* : Use [react-core/] for basic integration when building a simple Copilot
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-04T14:02:44.814Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/quick-reference.mdc:0-0
Timestamp: 2025-07-04T14:02:44.814Z
Learning: Applies to CopilotKit/packages/react-ui/**/* : Add [react-ui/] for pre-built components when building a simple Copilot or customizing UI components
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-18T15:03:09.673Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/copilotkit-architecture.mdc:0-0
Timestamp: 2025-07-18T15:03:09.673Z
Learning: Applies to CopilotKit/packages/react-core/** : Core React components and hooks for CopilotKit should be placed in CopilotKit/packages/react-core/
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-18T15:03:09.673Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/copilotkit-architecture.mdc:0-0
Timestamp: 2025-07-18T15:03:09.673Z
Learning: Applies to CopilotKit/packages/react-ui/** : UI components for copilot interfaces should be placed in CopilotKit/packages/react-ui/
Applied to files:
examples/coagents-starter/ui/package.json
📚 Learning: 2025-07-18T15:02:56.788Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/agent-development.mdc:0-0
Timestamp: 2025-07-18T15:02:56.788Z
Learning: Applies to **/{agent,agent-py}/**/*.py : Import from the 'copilotkit' package in Python agent code.
Applied to files:
examples/coagents-starter/agent-py/requirements.txtexamples/coagents-starter/agent-py/pyproject.toml
📚 Learning: 2025-07-04T14:02:44.814Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/quick-reference.mdc:0-0
Timestamp: 2025-07-04T14:02:44.814Z
Learning: Applies to sdk-python/copilotkit/agent.py : Check [copilotkit/agent.py] for main agent class when developing Python agents
Applied to files:
examples/coagents-starter/agent-py/pyproject.toml
📚 Learning: 2025-07-18T15:02:56.788Z
Learnt from: CR
PR: CopilotKit/CopilotKit#0
File: .cursor/rules/agent-development.mdc:0-0
Timestamp: 2025-07-18T15:02:56.788Z
Learning: Applies to **/pyproject-template.toml : Configure pyproject-template.toml for Python agent projects.
Applied to files:
examples/coagents-starter/agent-py/pyproject.toml
🔇 Additional comments (1)
examples/coagents-starter/ui/package.json (1)
12-15: CopilotKit v1.10.2 is compatible with React 19; Next.js 15 support is implied but not yet officially declared
Peer dependencies across@copilotkit/react-core,@copilotkit/react-ui,@copilotkit/runtime, and@copilotkit/runtime-client-gqlv1.10.2 includereact ^18 || ^19, so React 19.0.0 installs cleanly. There’s no explicit “Next.js 15” claim in the release notes, but no breaking issues have been reported. If you encounter peer-dependency warnings duringnpm install, using--legacy-peer-depswill bypass them. Locking these versions in examples/coagents-starter/ui/package.json (lines 12–15) is safe.
| When using the langgraph CLI, since it uses the system python environment, you also need to run | ||
| ```bash | ||
| pip install -e . | ||
| ``` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Clarify the editable install to avoid environment confusion.
The note is helpful, but people may still install into the wrong interpreter. Recommend specifying the interpreter and offering the Poetry-driven alternative.
Apply this diff to clarify:
-When using the langgraph CLI, since it uses the system python environment, you also need to run
-```bash
-pip install -e .
-```
+When using the `langgraph` CLI outside of Poetry, ensure your agent package is available to the interpreter that runs `langgraph`:
+```bash
+python3 -m pip install -e .
+```
+Alternatively, run the CLI inside Poetry so environments stay consistent:
+```bash
+poetry run langgraph dev
+```🤖 Prompt for AI Agents
In docs/content/docs/langgraph/quickstart.mdx around lines 177 to 180, the
editable install note is ambiguous about which Python interpreter is used;
change the wording to instruct users to install into the interpreter that will
run the langgraph CLI by using python3 -m pip install -e . when running the CLI
outside of Poetry, and also add an alternative recommending running the CLI
inside Poetry (poetry run langgraph dev) so environments remain consistent.
There was a problem hiding this comment.
the cli cannot run inside of poetry with poetry run...
| [project] | ||
| name = "agent" | ||
| version = "0.1.0" | ||
| description = "" | ||
| requires-python = ">=3.10" | ||
| dependencies = [ |
There was a problem hiding this comment.
Python version mismatch between sections will cause setup inconsistencies.
[project] allows 3.13+, but [tool.poetry.dependencies] restricts to <3.13. Users on 3.13 will succeed with pip but fail with poetry.
Align the constraints. Suggested fix:
-[project]
-name = "agent"
-version = "0.1.0"
-description = ""
-requires-python = ">=3.10"
+[project]
+name = "agent"
+version = "0.1.0"
+description = ""
+requires-python = ">=3.10,<3.13"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [project] | |
| name = "agent" | |
| version = "0.1.0" | |
| description = "" | |
| requires-python = ">=3.10" | |
| dependencies = [ | |
| [project] | |
| name = "agent" | |
| version = "0.1.0" | |
| description = "" | |
| requires-python = ">=3.10,<3.13" | |
| dependencies = [ |
🤖 Prompt for AI Agents
In examples/coagents-starter/agent-py/pyproject.toml around lines 1 to 6, the
[project] requires-python value allows Python 3.13+ while
[tool.poetry.dependencies] restricts Python to <3.13 causing mismatch; update
the file so both sections use the same constraint (e.g., change [project]
requires-python to ">=3.10,<3.13" or relax the poetry constraint to ">=3.10" /
">=3.10,<4.0" depending on supported versions) and ensure both the top-level
requires-python and the poetry dependencies section match exactly.
| dependencies = [ | ||
| "copilotkit==0.1.60", | ||
| "langchain==0.3.21", | ||
| "langgraph>=0.6.5", | ||
| "langsmith>=0.3.45", | ||
| "openai>=1.68.2", | ||
| "fastapi>=0.115.5", | ||
| "uvicorn>=0.29.0", | ||
| "python-dotenv>=1.0.0", | ||
| "langchain-openai>=0.3.30" | ||
| ] |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Duplicate dependency sources create drift between pip and Poetry installs.
Dependencies are declared in both [project].dependencies and [tool.poetry.dependencies] with different version specs (e.g., langgraph >=0.6.5 vs 0.6.5). With poetry-core as backend, pip install -e . uses Poetry metadata; the [project] deps aren’t needed and increase maintenance risk.
Simplest path: remove [project].dependencies and keep a single source of truth under [tool.poetry.dependencies].
[project]
name = "agent"
version = "0.1.0"
description = ""
requires-python = ">=3.10,<3.13"
-dependencies = [
- "copilotkit==0.1.60",
- "langchain==0.3.21",
- "langgraph>=0.6.5",
- "langsmith>=0.3.45",
- "openai>=1.68.2",
- "fastapi>=0.115.5",
- "uvicorn>=0.29.0",
- "python-dotenv>=1.0.0",
- "langchain-openai>=0.3.30"
-]If you keep both, ensure all specs match exactly to avoid conflicting resolution.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| dependencies = [ | |
| "copilotkit==0.1.60", | |
| "langchain==0.3.21", | |
| "langgraph>=0.6.5", | |
| "langsmith>=0.3.45", | |
| "openai>=1.68.2", | |
| "fastapi>=0.115.5", | |
| "uvicorn>=0.29.0", | |
| "python-dotenv>=1.0.0", | |
| "langchain-openai>=0.3.30" | |
| ] | |
| [project] | |
| name = "agent" | |
| version = "0.1.0" | |
| description = "" | |
| requires-python = ">=3.10,<3.13" |
🤖 Prompt for AI Agents
In examples/coagents-starter/agent-py/pyproject.toml around lines 6 to 16, there
are duplicate dependency declarations under [project].dependencies that conflict
with [tool.poetry.dependencies]; remove the entire [project].dependencies
section so Poetry (poetry-core backend) remains the single source of truth, or
alternatively make both blocks identical if you must keep both, ensuring exact
matching version specs to avoid resolution drift between pip and Poetry
installs.
⏭️ Changeset Not RequiredLatest commit: 9db98e8 No changes in this PR affected the Changeset is not required for this PR. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/coagents-starter/agent-py/sample_agent/demo.py (1)
18-26: Consider mounting the agent under a subpath instead of “/”Mounting at root can shadow other routes and sometimes conflicts with docs or health endpoints. Using a dedicated base path (e.g., “/agent” or “/langgraph”) tends to be safer for examples and aligns better with typical UI expectations.
Apply this minimal change:
- path="/", + path="/agent",If the UI is served from a different origin, you may also need CORS. Add this near app creation (outside the selected lines):
from fastapi.middleware.cors import CORSMiddleware app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:3000"], # adjust to your UI origin(s) allow_credentials=True, allow_methods=["*"], allow_headers=["*"], )
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
examples/coagents-starter/agent-py/sample_agent/demo.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/{agent,agent-py}/**/*.py
📄 CodeRabbit Inference Engine (.cursor/rules/agent-development.mdc)
**/{agent,agent-py}/**/*.py: Python agents should be placed in folders named 'agent-py/' or 'agent/' and use the sdk-python package.
Import from the 'copilotkit' package in Python agent code.
Define actions and agent logic in Python agent code.
Files:
examples/coagents-starter/agent-py/sample_agent/demo.py
examples/*/{agent,agent-py}/**
📄 CodeRabbit Inference Engine (.cursor/rules/examples-and-demos.mdc)
Backend agent implementations should be placed in 'agent/' (for JavaScript/TypeScript) or 'agent-py/' (for Python) directories within each example project.
Files:
examples/coagents-starter/agent-py/sample_agent/demo.py
examples/coagents-starter/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
Check [coagents-starter/] for basic multi-agent system setup
Files:
examples/coagents-starter/agent-py/sample_agent/demo.py
examples/coagents-starter/agent-py/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)
Check [coagents-starter/agent-py/] for Python agent example
Files:
examples/coagents-starter/agent-py/sample_agent/demo.py
🧬 Code Graph Analysis (1)
examples/coagents-starter/agent-py/sample_agent/demo.py (1)
sdk-python/copilotkit/langgraph_agui_agent.py (1)
LangGraphAGUIAgent(46-181)
🔇 Additional comments (3)
examples/coagents-starter/agent-py/sample_agent/demo.py (3)
13-26: LGTM: Refactor aligns with the new LangGraph AGUI integrationSwitching to
LangGraphAGUIAgentandadd_langgraph_fastapi_endpointsimplifies the setup and matches the updated quickstart. Nice cleanup.
13-14: Manual verification required: validate external API exportsThe example imports reference symbols that weren’t found in this repo. Before running the demo, please ensure:
add_langgraph_fastapi_endpointis defined and exported by the ag_ui_langgraph package (or update the import to its actual submodule path).LangGraphAGUIAgentis re-exported at the top level of copilotkit (or adjust the import to point to its real location).Files to check:
• examples/coagents-starter/agent-py/sample_agent/demo.py (lines 13–14)
20-24: ConfirmedgraphIs Already Compiled
sample_agent/agent.pyinvokesworkflow.compile()(lines 122 and 127), so thegraphpassed intoLangGraphAGUIAgentis already a compiled LangGraph. No changes needed here.
|
Preview environments destroyed for this pull request. |
Test ResultsStatus: ❌ Failed (View Run) Commit: 31ca17f Duration: 990.5s Total Tests: 37 Pass Rate: 35.1% Failed Tests: 24 ❌ Failed Tests
🔍 Detailed Resultscoagents-research-canvasCoAgents Research Canvas (UI) - Local Depenencies
coagents-qa-nativeCoAgents QA Native (UI) - Local
coagents-qa-textCoAgents QA Text (UI) - Local
coagents-routingCoAgents Routing (UI) - Local
next-openaiNext OpenAI - Self Hosted
|
Missing dependencies and lacking instructions makes our quickstart for langgraph fail for users.
This PR attempts a fix at that
Summary by CodeRabbit
Documentation
Chores