featherweight 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. featherweight-0.1.0/LICENSE +202 -0
  2. featherweight-0.1.0/PKG-INFO +155 -0
  3. featherweight-0.1.0/README.md +107 -0
  4. featherweight-0.1.0/pyproject.toml +127 -0
  5. featherweight-0.1.0/setup.cfg +4 -0
  6. featherweight-0.1.0/src/featherweight/__init__.py +216 -0
  7. featherweight-0.1.0/src/featherweight/adapters/__init__.py +10 -0
  8. featherweight-0.1.0/src/featherweight/adapters/agui.py +61 -0
  9. featherweight-0.1.0/src/featherweight/adapters/errors.py +5 -0
  10. featherweight-0.1.0/src/featherweight/adapters/vercel.py +245 -0
  11. featherweight-0.1.0/src/featherweight/background.py +178 -0
  12. featherweight-0.1.0/src/featherweight/client.py +161 -0
  13. featherweight-0.1.0/src/featherweight/context.py +34 -0
  14. featherweight-0.1.0/src/featherweight/db.py +372 -0
  15. featherweight-0.1.0/src/featherweight/discovery.py +102 -0
  16. featherweight-0.1.0/src/featherweight/errors.py +10 -0
  17. featherweight-0.1.0/src/featherweight/events.py +156 -0
  18. featherweight-0.1.0/src/featherweight/fingerprint.py +125 -0
  19. featherweight-0.1.0/src/featherweight/jobs.py +430 -0
  20. featherweight-0.1.0/src/featherweight/log.py +23 -0
  21. featherweight-0.1.0/src/featherweight/mcp.py +113 -0
  22. featherweight-0.1.0/src/featherweight/mcp_connections.py +239 -0
  23. featherweight-0.1.0/src/featherweight/mcp_tools.py +132 -0
  24. featherweight-0.1.0/src/featherweight/messages.py +144 -0
  25. featherweight-0.1.0/src/featherweight/migrations.py +201 -0
  26. featherweight-0.1.0/src/featherweight/model_settings.py +223 -0
  27. featherweight-0.1.0/src/featherweight/models.py +330 -0
  28. featherweight-0.1.0/src/featherweight/observers.py +459 -0
  29. featherweight-0.1.0/src/featherweight/otel.py +397 -0
  30. featherweight-0.1.0/src/featherweight/postgres.py +488 -0
  31. featherweight-0.1.0/src/featherweight/py.typed +0 -0
  32. featherweight-0.1.0/src/featherweight/queue.py +217 -0
  33. featherweight-0.1.0/src/featherweight/registry.py +100 -0
  34. featherweight-0.1.0/src/featherweight/results.py +79 -0
  35. featherweight-0.1.0/src/featherweight/runner.py +1488 -0
  36. featherweight-0.1.0/src/featherweight/search.py +48 -0
  37. featherweight-0.1.0/src/featherweight/skills.py +153 -0
  38. featherweight-0.1.0/src/featherweight/sqlite.py +526 -0
  39. featherweight-0.1.0/src/featherweight/sse.py +67 -0
  40. featherweight-0.1.0/src/featherweight/store.py +34 -0
  41. featherweight-0.1.0/src/featherweight/stream_events.py +270 -0
  42. featherweight-0.1.0/src/featherweight/streaming.py +132 -0
  43. featherweight-0.1.0/src/featherweight/testing.py +884 -0
  44. featherweight-0.1.0/src/featherweight/tools.py +176 -0
  45. featherweight-0.1.0/src/featherweight/worker.py +339 -0
  46. featherweight-0.1.0/src/featherweight.egg-info/PKG-INFO +155 -0
  47. featherweight-0.1.0/src/featherweight.egg-info/SOURCES.txt +96 -0
  48. featherweight-0.1.0/src/featherweight.egg-info/dependency_links.txt +1 -0
  49. featherweight-0.1.0/src/featherweight.egg-info/requires.txt +27 -0
  50. featherweight-0.1.0/src/featherweight.egg-info/top_level.txt +1 -0
  51. featherweight-0.1.0/tests/test_agui.py +132 -0
  52. featherweight-0.1.0/tests/test_background_agents.py +496 -0
  53. featherweight-0.1.0/tests/test_background_events.py +357 -0
  54. featherweight-0.1.0/tests/test_background_results.py +372 -0
  55. featherweight-0.1.0/tests/test_book.py +103 -0
  56. featherweight-0.1.0/tests/test_calc_date_tools.py +175 -0
  57. featherweight-0.1.0/tests/test_cancel.py +408 -0
  58. featherweight-0.1.0/tests/test_client.py +314 -0
  59. featherweight-0.1.0/tests/test_concurrency.py +34 -0
  60. featherweight-0.1.0/tests/test_db.py +119 -0
  61. featherweight-0.1.0/tests/test_discovery.py +238 -0
  62. featherweight-0.1.0/tests/test_events.py +341 -0
  63. featherweight-0.1.0/tests/test_examples.py +390 -0
  64. featherweight-0.1.0/tests/test_fingerprint.py +250 -0
  65. featherweight-0.1.0/tests/test_job_class.py +178 -0
  66. featherweight-0.1.0/tests/test_job_decorator.py +106 -0
  67. featherweight-0.1.0/tests/test_job_lease.py +266 -0
  68. featherweight-0.1.0/tests/test_job_observers.py +305 -0
  69. featherweight-0.1.0/tests/test_job_timeout.py +273 -0
  70. featherweight-0.1.0/tests/test_jobs.py +258 -0
  71. featherweight-0.1.0/tests/test_limits.py +141 -0
  72. featherweight-0.1.0/tests/test_log.py +26 -0
  73. featherweight-0.1.0/tests/test_mcp.py +567 -0
  74. featherweight-0.1.0/tests/test_messages.py +248 -0
  75. featherweight-0.1.0/tests/test_migrations.py +256 -0
  76. featherweight-0.1.0/tests/test_model_settings.py +212 -0
  77. featherweight-0.1.0/tests/test_models.py +86 -0
  78. featherweight-0.1.0/tests/test_observers.py +285 -0
  79. featherweight-0.1.0/tests/test_otel.py +461 -0
  80. featherweight-0.1.0/tests/test_package.py +54 -0
  81. featherweight-0.1.0/tests/test_postgres.py +286 -0
  82. featherweight-0.1.0/tests/test_queue.py +198 -0
  83. featherweight-0.1.0/tests/test_registry.py +81 -0
  84. featherweight-0.1.0/tests/test_release.py +103 -0
  85. featherweight-0.1.0/tests/test_results.py +228 -0
  86. featherweight-0.1.0/tests/test_resume.py +341 -0
  87. featherweight-0.1.0/tests/test_runner.py +337 -0
  88. featherweight-0.1.0/tests/test_search.py +44 -0
  89. featherweight-0.1.0/tests/test_skill_package.py +101 -0
  90. featherweight-0.1.0/tests/test_skills.py +323 -0
  91. featherweight-0.1.0/tests/test_store.py +39 -0
  92. featherweight-0.1.0/tests/test_stream_events.py +259 -0
  93. featherweight-0.1.0/tests/test_streaming.py +413 -0
  94. featherweight-0.1.0/tests/test_subagents.py +399 -0
  95. featherweight-0.1.0/tests/test_takeover.py +260 -0
  96. featherweight-0.1.0/tests/test_tools.py +119 -0
  97. featherweight-0.1.0/tests/test_vercel.py +359 -0
  98. featherweight-0.1.0/tests/test_worker.py +412 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: featherweight
3
+ Version: 0.1.0
4
+ Summary: An opinionated agent harness where Pydantic is the specification: typed agents, sub-agents and skills, with retries, failures as values, and a trace of every attempt.
5
+ Author: Aadhithya
6
+ Author-email: Claude <noreply@anthropic.com>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/aadhithya/featherweight
9
+ Project-URL: Documentation, https://github.com/aadhithya/featherweight/blob/main/docs/README.md
10
+ Project-URL: Repository, https://github.com/aadhithya/featherweight
11
+ Project-URL: Issues, https://github.com/aadhithya/featherweight/issues
12
+ Project-URL: Changelog, https://github.com/aadhithya/featherweight/blob/main/CHANGELOG.md
13
+ Keywords: agents,llm,pydantic,langchain,langgraph,mcp,streaming,ag-ui
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Framework :: AsyncIO
16
+ Classifier: Framework :: Pydantic :: 2
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.12
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: ag-ui-protocol>=1.0
27
+ Requires-Dist: aiosqlite
28
+ Requires-Dist: fakeredis
29
+ Requires-Dist: jsonschema
30
+ Requires-Dist: langchain
31
+ Requires-Dist: langchain-google-genai
32
+ Requires-Dist: langgraph
33
+ Requires-Dist: pydantic>=2
34
+ Requires-Dist: pyyaml
35
+ Provides-Extra: mcp
36
+ Requires-Dist: langchain-mcp-adapters>=0.3.2; extra == "mcp"
37
+ Provides-Extra: anthropic
38
+ Requires-Dist: langchain-anthropic>=1.7; extra == "anthropic"
39
+ Provides-Extra: openai
40
+ Requires-Dist: langchain-openai>=1.8; extra == "openai"
41
+ Provides-Extra: postgres
42
+ Requires-Dist: psycopg[binary]>=3.2; extra == "postgres"
43
+ Provides-Extra: otel
44
+ Requires-Dist: opentelemetry-api>=1.30; extra == "otel"
45
+ Provides-Extra: all
46
+ Requires-Dist: featherweight[anthropic,mcp,openai,otel,postgres]; extra == "all"
47
+ Dynamic: license-file
48
+
49
+ # featherweight [ftw.]
50
+
51
+ [![PyPI](https://img.shields.io/pypi/v/featherweight)](https://pypi.org/project/featherweight/)
52
+ [![Python](https://img.shields.io/pypi/pyversions/featherweight)](https://pypi.org/project/featherweight/)
53
+ [![License](https://img.shields.io/pypi/l/featherweight)](https://github.com/aadhithya/featherweight/blob/main/LICENSE)
54
+ [![tests](https://github.com/aadhithya/featherweight/actions/workflows/test.yml/badge.svg)](https://github.com/aadhithya/featherweight/actions/workflows/test.yml)
55
+
56
+ **An opinionated agent harness. Pydantic is the spec. Everything else follows.**
57
+
58
+ An agent is a typed class. Its input, output, tools, skills and subagents are declared right there and enforced, not hoped for.
59
+ The boilerplate every agent project ends up writing (retries, limits, failures, tracing, delegation, workers, resume) is already
60
+ written. You write the pipeline. That's the part that's yours.
61
+
62
+ A malformed agent never reaches the model. A running one has a known input and a known output. No guessing.
63
+
64
+ It has opinions. Take them, or fork off.
65
+
66
+ And there's a skill, so your coding agent can build with it from the first prompt.
67
+
68
+ > Designed by a human. Implemented by Claude.
69
+ >
70
+ > **Alpha.** The API can still change before 1.0.
71
+
72
+ ## Built on LangChain, on purpose
73
+
74
+ featherweight doesn't replace LangChain. It sits on it.
75
+
76
+ - **Your tools are LangChain tools.** Write one with `@tool`, or take one from the LangChain ecosystem.
77
+ - **MCP goes through LangChain's MCP adapters.** Stdio or HTTP servers, declared on the agent.
78
+ - **Models are LangChain chat models underneath**, behind settings classes that are checked when the agent is built.
79
+
80
+ So what LangChain already gives you, a pile of integrations and adapters, can plug into agents that are typed, bounded and run on workers.
81
+ We test the providers and tools featherweight ships with. Other LangChain integrations go into the same slots, but we haven't verified them one by one.
82
+
83
+ ## What you get
84
+
85
+ | | |
86
+ |---|---|
87
+ | **Typed, declared, enforced** | An agent is a class. What goes in and what comes out is a schema. A bad declaration fails when it is written, a bad answer is caught and retried before your code ever sees it. |
88
+ | **Least privilege** | Everything is an allow-list. A capability an agent has is one the developer gave it, on purpose. |
89
+ | **Plain Python, failures as values** | Order, loops and branching are `if` and `for`: no graph, no workflow engine. A failed run hands you the error and a status, not an exception. |
90
+ | **Agents that delegate** | Subagents on a leash, only the ones allowed, only so deep. Or background agents: one starts another and goes on, and the result comes back when it is ready. |
91
+ | **Resume instead of rerun** | A pipeline that dies halfway picks up where it stopped, without paying for the steps that worked. |
92
+ | **Workers, and a lost worker is fine** | Submit a job from your API, run it on workers, follow it live, cancel it. Lose a worker mid-job and another takes over. |
93
+ | **Streams to your UI** | Chat answers and job status stream over standard protocols (AG-UI, the Vercel AI SDK, SSE), so a browser can listen as is. |
94
+ | **See what it did** | OpenTelemetry traces of jobs, attempts, model calls and tool calls, in the format observability and evaluation platforms already read. Content stays off unless you turn it on. |
95
+ | **Any model, any tool** | Gemini, Gemma, Claude, OpenAI or your own. MCP servers and skills plug in and stay out of the context until needed. |
96
+ | **Your data, your storage** | The framework stores metadata and nothing else. Databases, result stores, queues and observers are interfaces: implement one, run the kit that checks it. `SqliteDatabase` for local work and `PostgresDatabase` for deployment both ship, to get you going. |
97
+
98
+ ## What you don't get
99
+
100
+ | | |
101
+ |---|---|
102
+ | **A workflow engine** | No graph to draw, no nodes and edges. Order is `if` and `for`, and you already know those. |
103
+ | **A server or a UI** | We stream, you serve. Bring your own API and frontend: it speaks AG-UI, the Vercel AI SDK and SSE. |
104
+ | **Your data** | No stored conversations, no stored outputs. Metadata only. What happens to the rest is your call, and your problem. |
105
+ | **An evaluation platform** | We don't score anything. We emit traces your platform already reads, and it does the judging. |
106
+ | **A way around the rules** | An agent that doesn't declare itself properly doesn't run. These are opinions. Take them, or fork off. |
107
+
108
+ Want durable execution or built-in evals? Pydantic AI. Want a graph that pauses and resumes? LangGraph. Want typed, bounded agents on
109
+ workers, in plain Python? Here.
110
+
111
+ ## Built for agentic coding
112
+
113
+ There is a skill. Plug it into your favourite coding agent and it already knows how to build with featherweight: the typed agent, the rules,
114
+ the patterns, and the whole book. You start building in your editor, not in a docs tab.
115
+
116
+ In Claude Code:
117
+
118
+ ```
119
+ /plugin marketplace add aadhithya/featherweight
120
+ /plugin install featherweight@featherweight
121
+ ```
122
+
123
+ OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI and the other tools that read Agent Skills: install it with the [`skills`](https://github.com/vercel-labs/skills) CLI,
124
+ which puts it where each tool looks (it needs Node.js).
125
+
126
+ ```
127
+ npx skills add aadhithya/featherweight # asks which tools to install it for
128
+ npx skills add aadhithya/featherweight -a codex # or name one: codex, cursor, claude-code, ...
129
+ ```
130
+
131
+ Or copy [`skills/featherweight`](https://github.com/aadhithya/featherweight/blob/main/skills/featherweight) into the tool's skills folder yourself. There is also an
132
+ [`AGENTS.md`](https://github.com/aadhithya/featherweight/blob/main/AGENTS.md) at the root, for the tools that read that.
133
+
134
+ ## Getting started
135
+
136
+ The quickest way in is [the book](https://github.com/aadhithya/featherweight/blob/main/docs/book/README.md): a tiny incident report
137
+ assistant that grows from a first agent to workers, chapter by chapter, with code that runs in a container.
138
+
139
+ ```
140
+ pip install featherweight
141
+ pip install 'featherweight[all]' # or just: mcp, anthropic, openai, postgres, otel
142
+ ```
143
+
144
+ Python 3.12 or later. Import what you use: `from featherweight import AgentBase, AgentRunner`. (`import featherweight as ftw` works too, as a joke.)
145
+
146
+ ## Read more
147
+
148
+ - [**The book**](https://github.com/aadhithya/featherweight/blob/main/docs/book/README.md): build something step by step, from a first agent to workers
149
+ - [**A production stack**](https://github.com/aadhithya/featherweight/blob/main/docs/production-stack.md): what to use where, with Postgres, your queue and your result store
150
+ - [**The guides**](https://github.com/aadhithya/featherweight/blob/main/docs/README.md), [**the specs**](https://github.com/aadhithya/featherweight/blob/main/docs/specs/README.md) (what each part does, and why) and [**the examples**](https://github.com/aadhithya/featherweight/blob/main/examples/README.md)
151
+ - [**Development**](https://github.com/aadhithya/featherweight/blob/main/docs/development.md) and the [**changelog**](https://github.com/aadhithya/featherweight/blob/main/CHANGELOG.md)
152
+
153
+ ## License
154
+
155
+ Apache License 2.0. See [LICENSE](https://github.com/aadhithya/featherweight/blob/main/LICENSE).
@@ -0,0 +1,107 @@
1
+ # featherweight [ftw.]
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/featherweight)](https://pypi.org/project/featherweight/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/featherweight)](https://pypi.org/project/featherweight/)
5
+ [![License](https://img.shields.io/pypi/l/featherweight)](https://github.com/aadhithya/featherweight/blob/main/LICENSE)
6
+ [![tests](https://github.com/aadhithya/featherweight/actions/workflows/test.yml/badge.svg)](https://github.com/aadhithya/featherweight/actions/workflows/test.yml)
7
+
8
+ **An opinionated agent harness. Pydantic is the spec. Everything else follows.**
9
+
10
+ An agent is a typed class. Its input, output, tools, skills and subagents are declared right there and enforced, not hoped for.
11
+ The boilerplate every agent project ends up writing (retries, limits, failures, tracing, delegation, workers, resume) is already
12
+ written. You write the pipeline. That's the part that's yours.
13
+
14
+ A malformed agent never reaches the model. A running one has a known input and a known output. No guessing.
15
+
16
+ It has opinions. Take them, or fork off.
17
+
18
+ And there's a skill, so your coding agent can build with it from the first prompt.
19
+
20
+ > Designed by a human. Implemented by Claude.
21
+ >
22
+ > **Alpha.** The API can still change before 1.0.
23
+
24
+ ## Built on LangChain, on purpose
25
+
26
+ featherweight doesn't replace LangChain. It sits on it.
27
+
28
+ - **Your tools are LangChain tools.** Write one with `@tool`, or take one from the LangChain ecosystem.
29
+ - **MCP goes through LangChain's MCP adapters.** Stdio or HTTP servers, declared on the agent.
30
+ - **Models are LangChain chat models underneath**, behind settings classes that are checked when the agent is built.
31
+
32
+ So what LangChain already gives you, a pile of integrations and adapters, can plug into agents that are typed, bounded and run on workers.
33
+ We test the providers and tools featherweight ships with. Other LangChain integrations go into the same slots, but we haven't verified them one by one.
34
+
35
+ ## What you get
36
+
37
+ | | |
38
+ |---|---|
39
+ | **Typed, declared, enforced** | An agent is a class. What goes in and what comes out is a schema. A bad declaration fails when it is written, a bad answer is caught and retried before your code ever sees it. |
40
+ | **Least privilege** | Everything is an allow-list. A capability an agent has is one the developer gave it, on purpose. |
41
+ | **Plain Python, failures as values** | Order, loops and branching are `if` and `for`: no graph, no workflow engine. A failed run hands you the error and a status, not an exception. |
42
+ | **Agents that delegate** | Subagents on a leash, only the ones allowed, only so deep. Or background agents: one starts another and goes on, and the result comes back when it is ready. |
43
+ | **Resume instead of rerun** | A pipeline that dies halfway picks up where it stopped, without paying for the steps that worked. |
44
+ | **Workers, and a lost worker is fine** | Submit a job from your API, run it on workers, follow it live, cancel it. Lose a worker mid-job and another takes over. |
45
+ | **Streams to your UI** | Chat answers and job status stream over standard protocols (AG-UI, the Vercel AI SDK, SSE), so a browser can listen as is. |
46
+ | **See what it did** | OpenTelemetry traces of jobs, attempts, model calls and tool calls, in the format observability and evaluation platforms already read. Content stays off unless you turn it on. |
47
+ | **Any model, any tool** | Gemini, Gemma, Claude, OpenAI or your own. MCP servers and skills plug in and stay out of the context until needed. |
48
+ | **Your data, your storage** | The framework stores metadata and nothing else. Databases, result stores, queues and observers are interfaces: implement one, run the kit that checks it. `SqliteDatabase` for local work and `PostgresDatabase` for deployment both ship, to get you going. |
49
+
50
+ ## What you don't get
51
+
52
+ | | |
53
+ |---|---|
54
+ | **A workflow engine** | No graph to draw, no nodes and edges. Order is `if` and `for`, and you already know those. |
55
+ | **A server or a UI** | We stream, you serve. Bring your own API and frontend: it speaks AG-UI, the Vercel AI SDK and SSE. |
56
+ | **Your data** | No stored conversations, no stored outputs. Metadata only. What happens to the rest is your call, and your problem. |
57
+ | **An evaluation platform** | We don't score anything. We emit traces your platform already reads, and it does the judging. |
58
+ | **A way around the rules** | An agent that doesn't declare itself properly doesn't run. These are opinions. Take them, or fork off. |
59
+
60
+ Want durable execution or built-in evals? Pydantic AI. Want a graph that pauses and resumes? LangGraph. Want typed, bounded agents on
61
+ workers, in plain Python? Here.
62
+
63
+ ## Built for agentic coding
64
+
65
+ There is a skill. Plug it into your favourite coding agent and it already knows how to build with featherweight: the typed agent, the rules,
66
+ the patterns, and the whole book. You start building in your editor, not in a docs tab.
67
+
68
+ In Claude Code:
69
+
70
+ ```
71
+ /plugin marketplace add aadhithya/featherweight
72
+ /plugin install featherweight@featherweight
73
+ ```
74
+
75
+ OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI and the other tools that read Agent Skills: install it with the [`skills`](https://github.com/vercel-labs/skills) CLI,
76
+ which puts it where each tool looks (it needs Node.js).
77
+
78
+ ```
79
+ npx skills add aadhithya/featherweight # asks which tools to install it for
80
+ npx skills add aadhithya/featherweight -a codex # or name one: codex, cursor, claude-code, ...
81
+ ```
82
+
83
+ Or copy [`skills/featherweight`](https://github.com/aadhithya/featherweight/blob/main/skills/featherweight) into the tool's skills folder yourself. There is also an
84
+ [`AGENTS.md`](https://github.com/aadhithya/featherweight/blob/main/AGENTS.md) at the root, for the tools that read that.
85
+
86
+ ## Getting started
87
+
88
+ The quickest way in is [the book](https://github.com/aadhithya/featherweight/blob/main/docs/book/README.md): a tiny incident report
89
+ assistant that grows from a first agent to workers, chapter by chapter, with code that runs in a container.
90
+
91
+ ```
92
+ pip install featherweight
93
+ pip install 'featherweight[all]' # or just: mcp, anthropic, openai, postgres, otel
94
+ ```
95
+
96
+ Python 3.12 or later. Import what you use: `from featherweight import AgentBase, AgentRunner`. (`import featherweight as ftw` works too, as a joke.)
97
+
98
+ ## Read more
99
+
100
+ - [**The book**](https://github.com/aadhithya/featherweight/blob/main/docs/book/README.md): build something step by step, from a first agent to workers
101
+ - [**A production stack**](https://github.com/aadhithya/featherweight/blob/main/docs/production-stack.md): what to use where, with Postgres, your queue and your result store
102
+ - [**The guides**](https://github.com/aadhithya/featherweight/blob/main/docs/README.md), [**the specs**](https://github.com/aadhithya/featherweight/blob/main/docs/specs/README.md) (what each part does, and why) and [**the examples**](https://github.com/aadhithya/featherweight/blob/main/examples/README.md)
103
+ - [**Development**](https://github.com/aadhithya/featherweight/blob/main/docs/development.md) and the [**changelog**](https://github.com/aadhithya/featherweight/blob/main/CHANGELOG.md)
104
+
105
+ ## License
106
+
107
+ Apache License 2.0. See [LICENSE](https://github.com/aadhithya/featherweight/blob/main/LICENSE).
@@ -0,0 +1,127 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.setuptools.packages.find]
6
+ where = ["src"]
7
+
8
+ [tool.setuptools.package-data]
9
+ featherweight = ["py.typed"] # the package is typed
10
+
11
+ [project]
12
+ name = "featherweight"
13
+ version = "0.1.0"
14
+ description = "An opinionated agent harness where Pydantic is the specification: typed agents, sub-agents and skills, with retries, failures as values, and a trace of every attempt."
15
+ readme = "README.md"
16
+ license = "Apache-2.0"
17
+ requires-python = ">=3.12"
18
+ authors = [{ name = "Aadhithya" }, { name = "Claude", email = "noreply@anthropic.com" }]
19
+ keywords = ["agents", "llm", "pydantic", "langchain", "langgraph", "mcp", "streaming", "ag-ui"]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Framework :: AsyncIO",
23
+ "Framework :: Pydantic :: 2",
24
+ "Intended Audience :: Developers",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed",
30
+ ]
31
+ dependencies = [
32
+ "ag-ui-protocol>=1.0",
33
+ "aiosqlite",
34
+ "fakeredis",
35
+ "jsonschema",
36
+ "langchain",
37
+ "langchain-google-genai",
38
+ "langgraph",
39
+ "pydantic>=2",
40
+ "pyyaml",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/aadhithya/featherweight"
45
+ Documentation = "https://github.com/aadhithya/featherweight/blob/main/docs/README.md"
46
+ Repository = "https://github.com/aadhithya/featherweight"
47
+ Issues = "https://github.com/aadhithya/featherweight/issues"
48
+ Changelog = "https://github.com/aadhithya/featherweight/blob/main/CHANGELOG.md"
49
+
50
+ [project.optional-dependencies]
51
+ mcp = [
52
+ "langchain-mcp-adapters>=0.3.2",
53
+ ]
54
+ anthropic = [
55
+ "langchain-anthropic>=1.7",
56
+ ]
57
+ openai = [
58
+ "langchain-openai>=1.8",
59
+ ]
60
+ postgres = [
61
+ "psycopg[binary]>=3.2",
62
+ ]
63
+ otel = [
64
+ "opentelemetry-api>=1.30",
65
+ ]
66
+ all = [
67
+ "featherweight[mcp,anthropic,openai,postgres,otel]",
68
+ ]
69
+
70
+ [dependency-groups]
71
+ dev = [
72
+ "fastapi>=0.165.0",
73
+ "httpx>=0.28.1",
74
+ "langchain-anthropic>=1.7",
75
+ "langchain-mcp-adapters>=0.3.2",
76
+ "langchain-openai>=1.8",
77
+ "opentelemetry-api>=1.30",
78
+ "opentelemetry-sdk>=1.30",
79
+ "pre-commit>=4.7.0",
80
+ "psycopg[binary]>=3.2",
81
+ "pytest",
82
+ "pytest-asyncio",
83
+ "ruff>=0.17.5",
84
+ "ty>=0.0.105",
85
+ "uvicorn>=0.54.0",
86
+ ]
87
+
88
+ [tool.uv]
89
+ package = false
90
+
91
+ [tool.pytest.ini_options]
92
+ pythonpath = ["src", "tests", "examples/doclearn"]
93
+ testpaths = ["tests"]
94
+ asyncio_mode = "auto"
95
+ asyncio_default_fixture_loop_scope = "function"
96
+ markers = ["e2e: real Gemini calls on the small fixtures and the examples; run with `make e2e`, excluded from `make test`"]
97
+ addopts = "-m 'not e2e'"
98
+
99
+ [tool.ruff]
100
+ line-length = 120
101
+ target-version = "py312"
102
+
103
+ [tool.ruff.lint]
104
+ select = ["E", "F", "I", "UP", "B"]
105
+ ignore = [
106
+ "E501", # line length: the formatter owns code; long strings (prompts, docstrings) are fine
107
+ "UP046", # keep `Generic[T]` on the pydantic generic models rather than PEP 695 syntax
108
+ "UP047",
109
+ ]
110
+
111
+ [tool.ty.environment]
112
+ extra-paths = ["src", "tests", "examples/doclearn", "examples/chat"]
113
+
114
+ # `ty` is strict on the harness (src/) and the small examples. The tests and the doclearn example read `result.output`
115
+ # after checking `result.status`, which `ty` cannot narrow (they are separate fields), and doclearn's agents override
116
+ # `check_output` with their own input and output types. Those rules are relaxed there, and only there.
117
+ [[tool.ty.overrides]]
118
+ include = ["tests/**", "examples/doclearn/**"]
119
+
120
+ [tool.ty.overrides.rules]
121
+ missing-union-attribute = "ignore"
122
+ missing-attribute = "ignore"
123
+ invalid-argument-type = "ignore"
124
+ invalid-explicit-return = "ignore"
125
+ unsupported-operator = "ignore"
126
+ incompatible-attribute-override = "ignore"
127
+ invalid-assignment = "ignore"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+