Commit 605e311
feat: rewrite deep agents on top of
* feat: migrate to createAgent API and middleware architecture
BREAKING CHANGE: Major refactor from custom LangGraph implementation to new langchain createAgent API
**Architecture Migration:**
- Replace createReactAgent with createAgent API from langchain package
- Migrate from custom state management to middleware-based architecture
- Remove custom DeepAgentState and model configuration in favor of built-in patterns
**Package Updates:**
- Upgrade to @langchain/anthropic@alpha, @langchain/langgraph@next
- Add langchain package as main dependency with createAgent support
- Update @langchain/core to local development version
**Code Reorganization:**
- Move tools from src/tools.ts to modular middleware pattern (src/middleware/)
- Simplify type definitions in src/types.ts with Zod schema validation
- Refactor src/subAgent.ts to use createAgent with middleware integration
- Update src/graph.ts and src/index.ts for new API patterns
**Removed Files:**
- src/state.ts: Custom state management no longer needed
- src/model.ts: Default model configuration handled by createAgent
- src/interrupt.ts: Interrupt handling integrated into middleware
**New Middleware System:**
- src/middleware/fs.ts: File system operations middleware
- src/middleware/todo.ts: Todo management middleware
- src/middleware/index.ts: Middleware exports and configuration
**Configuration:**
- Fix tsconfig.json extends path for @tsconfig/recommended
- Update examples/research/research-agent.ts for new API
- Upgrade TypeScript ESLint and other dev dependencies
This migration provides a more maintainable architecture with better separation of concerns
and aligns with the latest LangChain patterns for agent development.
* consolidate imports
* progress
* push remaining update
* fix ci
* cr
* fix
* add anthropicPromptCachingMiddleware
* prettier
* prettier
* allow sub agents to have middleware
* prettier
* Merge pull request #37 from wuchangming/cb/createAgent-migration
feat: Add a name property value to ToolMessage
* fix types
* First stab at porting deepagents
* Cleanup
* wip: middleware review
* Fix to work on LSD
* Use Zod 4
* Revert "Use Zod 4"
This reverts commit 2292cd2.
* fix: use store from runnable config
* Exclude `jumpTo` from subgraph state
* Auto-infer filesystem middleware
* Include `strict` in tests
* Further cleanup of test files
* Remove any, remove only
* Fix invalid types for filesystem
* Fix invalid condition
* Fix file system tests, make those concurrent
* Replace _getType with type
* Remove Annotation
* Cleanup rest of test files
* Bump to 1.0.0
* Use PNPM
* Fix scripts
* Build using tsdown
* Bump to 1.0.0-beta.1
* Update CI
* Update again
* Fix formatting
* Add stub prettierrc for VSCode
* Add pluggable filesystem
* linting
* Full test coverage
* Add coerce option
* Bump to 1.0.0-beta.2
* Bump to 1.0.0-beta.3
* Add windows to matrix
* Address comments
* Add examples
* tweak prompt
* Linting
* Remove checkpointer=False
* Add missing env files
* Update README
* add missing dev deps
* add lockfile
* Fix broken test
* Normalize paths for linux
* Fix tests to be OS agnostic
* Normalize for glob search
---------
Co-authored-by: Christian Bromann <git@bromann.dev>
Co-authored-by: Wu Changming <wuchangmingnice@163.com>
Co-authored-by: Nick Huang <nick@langchain.dev>
Co-authored-by: Hunter Lovell <hunter@hntrl.io>createAgent (#42)1 parent 3a830fa commit 605e311
File tree
48 files changed
+13232
-3423
lines changed- .github/workflows
- .vscode
- examples
- backends
- research
- src
- backends
- middleware
- tests
- integration
- unit
- backends
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+13232
-3423
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | | - | |
33 | | - | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | | - | |
| 39 | + | |
36 | 40 | | |
37 | | - | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | | - | |
50 | | - | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | | - | |
| 60 | + | |
53 | 61 | | |
54 | | - | |
| 62 | + | |
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| |||
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
63 | | - | |
64 | | - | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 74 | + | |
| 75 | + | |
81 | 76 | | |
82 | 77 | | |
83 | | - | |
84 | | - | |
| 78 | + | |
| 79 | + | |
85 | 80 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
89 | 84 | | |
90 | 85 | | |
91 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | | - | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
| 38 | + | |
35 | 39 | | |
36 | | - | |
| 40 | + | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments