intagrin 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 (171) hide show
  1. intagrin-0.1.0/LICENSE +201 -0
  2. intagrin-0.1.0/PKG-INFO +350 -0
  3. intagrin-0.1.0/README.md +316 -0
  4. intagrin-0.1.0/pyproject.toml +84 -0
  5. intagrin-0.1.0/setup.cfg +4 -0
  6. intagrin-0.1.0/src/intagrin/__init__.py +3 -0
  7. intagrin-0.1.0/src/intagrin/cli.py +2484 -0
  8. intagrin-0.1.0/src/intagrin/compiler/__init__.py +3 -0
  9. intagrin-0.1.0/src/intagrin/compiler/exporter.py +251 -0
  10. intagrin-0.1.0/src/intagrin/compiler/parser.py +117 -0
  11. intagrin-0.1.0/src/intagrin/compiler/reverse.py +180 -0
  12. intagrin-0.1.0/src/intagrin/compiler/verifier.py +470 -0
  13. intagrin-0.1.0/src/intagrin/config/__init__.py +19 -0
  14. intagrin-0.1.0/src/intagrin/config/json_schema.py +54 -0
  15. intagrin-0.1.0/src/intagrin/config/orchestration_guide.py +114 -0
  16. intagrin-0.1.0/src/intagrin/config/reference.py +133 -0
  17. intagrin-0.1.0/src/intagrin/config/schema.py +1020 -0
  18. intagrin-0.1.0/src/intagrin/db_migrations/README +1 -0
  19. intagrin-0.1.0/src/intagrin/db_migrations/alembic.ini +149 -0
  20. intagrin-0.1.0/src/intagrin/db_migrations/auto_migrate.py +55 -0
  21. intagrin-0.1.0/src/intagrin/db_migrations/env.py +76 -0
  22. intagrin-0.1.0/src/intagrin/db_migrations/script.py.mako +28 -0
  23. intagrin-0.1.0/src/intagrin/db_migrations/versions/6308869d7c5d_initial_schema.py +35 -0
  24. intagrin-0.1.0/src/intagrin/db_migrations/versions/ccfa6ed12026_add_run_logs.py +44 -0
  25. intagrin-0.1.0/src/intagrin/db_migrations/versions/d1a2b3c4e5f6_add_run_logs_index.py +34 -0
  26. intagrin-0.1.0/src/intagrin/errors.py +347 -0
  27. intagrin-0.1.0/src/intagrin/runtime/__init__.py +4 -0
  28. intagrin-0.1.0/src/intagrin/runtime/engine.py +3416 -0
  29. intagrin-0.1.0/src/intagrin/runtime/episodic_memory.py +294 -0
  30. intagrin-0.1.0/src/intagrin/runtime/mcp_client.py +71 -0
  31. intagrin-0.1.0/src/intagrin/runtime/memory.py +431 -0
  32. intagrin-0.1.0/src/intagrin/runtime/model_info.py +20 -0
  33. intagrin-0.1.0/src/intagrin/runtime/rag.py +199 -0
  34. intagrin-0.1.0/src/intagrin/runtime/rate_limiter.py +127 -0
  35. intagrin-0.1.0/src/intagrin/runtime/router.py +256 -0
  36. intagrin-0.1.0/src/intagrin/runtime/run_logger.py +152 -0
  37. intagrin-0.1.0/src/intagrin/runtime/sandbox.py +117 -0
  38. intagrin-0.1.0/src/intagrin/runtime/schema_loader.py +36 -0
  39. intagrin-0.1.0/src/intagrin/runtime/session_locks.py +37 -0
  40. intagrin-0.1.0/src/intagrin/runtime/shared_memory.py +128 -0
  41. intagrin-0.1.0/src/intagrin/runtime/shared_resources.py +108 -0
  42. intagrin-0.1.0/src/intagrin/runtime/state_reconstruction.py +169 -0
  43. intagrin-0.1.0/src/intagrin/runtime/tool_runner.py +64 -0
  44. intagrin-0.1.0/src/intagrin/runtime/tools_loader.py +73 -0
  45. intagrin-0.1.0/src/intagrin/runtime/worker.py +251 -0
  46. intagrin-0.1.0/src/intagrin/server/__init__.py +1 -0
  47. intagrin-0.1.0/src/intagrin/server/api.py +1189 -0
  48. intagrin-0.1.0/src/intagrin/server/error_handlers.py +22 -0
  49. intagrin-0.1.0/src/intagrin/server/monitor.py +1091 -0
  50. intagrin-0.1.0/src/intagrin/server/static/logo1.png +0 -0
  51. intagrin-0.1.0/src/intagrin/server/static/logo3.png +0 -0
  52. intagrin-0.1.0/src/intagrin/server/templates/monitor.html +2136 -0
  53. intagrin-0.1.0/src/intagrin/templates/ai.schema.json +1653 -0
  54. intagrin-0.1.0/src/intagrin/templates/copilot/architect_instructions.md +48 -0
  55. intagrin-0.1.0/src/intagrin/templates/copilot/compile_skill.md +21 -0
  56. intagrin-0.1.0/src/intagrin/templates/copilot/cursor_mdc.md +5 -0
  57. intagrin-0.1.0/src/intagrin/templates/copilot/docs/01_Getting_Started.md +171 -0
  58. intagrin-0.1.0/src/intagrin/templates/copilot/docs/02_The_AI_YAML_Blueprint.md +92 -0
  59. intagrin-0.1.0/src/intagrin/templates/copilot/docs/03_Agent_Handoffs_and_Routing.md +96 -0
  60. intagrin-0.1.0/src/intagrin/templates/copilot/docs/03_Choosing_an_Orchestration_Primitive.md +90 -0
  61. intagrin-0.1.0/src/intagrin/templates/copilot/docs/03_Dynamic_Agent_Spawning.md +193 -0
  62. intagrin-0.1.0/src/intagrin/templates/copilot/docs/03_Tools_and_Actions.md +61 -0
  63. intagrin-0.1.0/src/intagrin/templates/copilot/docs/04_Production_Deployment.md +88 -0
  64. intagrin-0.1.0/src/intagrin/templates/copilot/docs/04_Shared_State_Redux.md +125 -0
  65. intagrin-0.1.0/src/intagrin/templates/copilot/docs/05_Custom_Tools_and_MCP.md +54 -0
  66. intagrin-0.1.0/src/intagrin/templates/copilot/docs/05_Example_Coding_Agent.md +30 -0
  67. intagrin-0.1.0/src/intagrin/templates/copilot/docs/06_Advanced_RAG_and_HyDE.md +44 -0
  68. intagrin-0.1.0/src/intagrin/templates/copilot/docs/06_Example_SOC_Analyst.md +8 -0
  69. intagrin-0.1.0/src/intagrin/templates/copilot/docs/07_Example_Voice_Agent.md +9 -0
  70. intagrin-0.1.0/src/intagrin/templates/copilot/docs/07_Human_In_The_Loop.md +145 -0
  71. intagrin-0.1.0/src/intagrin/templates/copilot/docs/08_Security_Audit.md +65 -0
  72. intagrin-0.1.0/src/intagrin/templates/copilot/docs/08_Security_and_Reliability.md +91 -0
  73. intagrin-0.1.0/src/intagrin/templates/copilot/docs/09_API_and_Streaming.md +116 -0
  74. intagrin-0.1.0/src/intagrin/templates/copilot/docs/10_AIToolkit_and_Copilots.md +43 -0
  75. intagrin-0.1.0/src/intagrin/templates/copilot/docs/11_IntaGrin_Studio.md +17 -0
  76. intagrin-0.1.0/src/intagrin/templates/copilot/docs/14_Episodic_Memory.md +64 -0
  77. intagrin-0.1.0/src/intagrin/templates/copilot/docs/index.md +113 -0
  78. intagrin-0.1.0/src/intagrin/templates/copilot/frontmatter/antigravity.md +13 -0
  79. intagrin-0.1.0/src/intagrin/templates/copilot/frontmatter/claude.md +7 -0
  80. intagrin-0.1.0/src/intagrin/templates/copilot/frontmatter/copilot.md +11 -0
  81. intagrin-0.1.0/src/intagrin/templates/copilot/frontmatter/factory.md +7 -0
  82. intagrin-0.1.0/src/intagrin/templates/copilot/implement_skill_body.md +41 -0
  83. intagrin-0.1.0/src/intagrin/templates/copilot/implement_skill_frontmatter.md +5 -0
  84. intagrin-0.1.0/src/intagrin/templates/copilot/reference_architecture.md +41 -0
  85. intagrin-0.1.0/src/intagrin/templates/copilot/reference_config.md +290 -0
  86. intagrin-0.1.0/src/intagrin/templates/copilot/reference_error_codes.md +55 -0
  87. intagrin-0.1.0/src/intagrin/testing/__init__.py +1 -0
  88. intagrin-0.1.0/src/intagrin/testing/eval_runner.py +131 -0
  89. intagrin-0.1.0/src/intagrin/testing/evaluator.py +70 -0
  90. intagrin-0.1.0/src/intagrin/testing/fuzzer.py +390 -0
  91. intagrin-0.1.0/src/intagrin/testing/icu.py +192 -0
  92. intagrin-0.1.0/src/intagrin/testing/simulator.py +403 -0
  93. intagrin-0.1.0/src/intagrin/testing/synthesizer.py +124 -0
  94. intagrin-0.1.0/src/intagrin/testing/tuner.py +166 -0
  95. intagrin-0.1.0/src/intagrin/tracing/__init__.py +3 -0
  96. intagrin-0.1.0/src/intagrin/tracing/console.py +298 -0
  97. intagrin-0.1.0/src/intagrin.egg-info/PKG-INFO +350 -0
  98. intagrin-0.1.0/src/intagrin.egg-info/SOURCES.txt +169 -0
  99. intagrin-0.1.0/src/intagrin.egg-info/dependency_links.txt +1 -0
  100. intagrin-0.1.0/src/intagrin.egg-info/entry_points.txt +2 -0
  101. intagrin-0.1.0/src/intagrin.egg-info/requires.txt +21 -0
  102. intagrin-0.1.0/src/intagrin.egg-info/top_level.txt +1 -0
  103. intagrin-0.1.0/tests/test_agent_spawning.py +1062 -0
  104. intagrin-0.1.0/tests/test_agent_spawning_schema.py +61 -0
  105. intagrin-0.1.0/tests/test_ai_schema_freshness.py +25 -0
  106. intagrin-0.1.0/tests/test_api_advanced.py +1218 -0
  107. intagrin-0.1.0/tests/test_approval_exemption_scoping.py +163 -0
  108. intagrin-0.1.0/tests/test_architecture_reference_freshness.py +70 -0
  109. intagrin-0.1.0/tests/test_auto_migrate.py +32 -0
  110. intagrin-0.1.0/tests/test_auto_migrate_postgres.py +80 -0
  111. intagrin-0.1.0/tests/test_available_when.py +215 -0
  112. intagrin-0.1.0/tests/test_checkpoint_ordering.py +96 -0
  113. intagrin-0.1.0/tests/test_cli.py +355 -0
  114. intagrin-0.1.0/tests/test_compile.py +620 -0
  115. intagrin-0.1.0/tests/test_config_reference.py +34 -0
  116. intagrin-0.1.0/tests/test_config_reference_freshness.py +32 -0
  117. intagrin-0.1.0/tests/test_copilot.py +101 -0
  118. intagrin-0.1.0/tests/test_cost_trace.py +105 -0
  119. intagrin-0.1.0/tests/test_delegation.py +79 -0
  120. intagrin-0.1.0/tests/test_delegation_isolation.py +419 -0
  121. intagrin-0.1.0/tests/test_docs_feature_coverage.py +72 -0
  122. intagrin-0.1.0/tests/test_dynamic_approval.py +353 -0
  123. intagrin-0.1.0/tests/test_engine_advanced.py +196 -0
  124. intagrin-0.1.0/tests/test_engine_multimodal.py +143 -0
  125. intagrin-0.1.0/tests/test_episodic_memory.py +257 -0
  126. intagrin-0.1.0/tests/test_error_docs_freshness.py +44 -0
  127. intagrin-0.1.0/tests/test_errors.py +63 -0
  128. intagrin-0.1.0/tests/test_eval_pipeline.py +89 -0
  129. intagrin-0.1.0/tests/test_exporter.py +123 -0
  130. intagrin-0.1.0/tests/test_fuzzer.py +262 -0
  131. intagrin-0.1.0/tests/test_guardrails.py +137 -0
  132. intagrin-0.1.0/tests/test_icu.py +109 -0
  133. intagrin-0.1.0/tests/test_memory.py +39 -0
  134. intagrin-0.1.0/tests/test_memory_checkpointer.py +93 -0
  135. intagrin-0.1.0/tests/test_memory_compression.py +243 -0
  136. intagrin-0.1.0/tests/test_memory_integration.py +240 -0
  137. intagrin-0.1.0/tests/test_model_variants.py +130 -0
  138. intagrin-0.1.0/tests/test_monitor.py +537 -0
  139. intagrin-0.1.0/tests/test_multi_approver.py +184 -0
  140. intagrin-0.1.0/tests/test_orchestration_guide_freshness.py +32 -0
  141. intagrin-0.1.0/tests/test_packaging.py +56 -0
  142. intagrin-0.1.0/tests/test_parser.py +59 -0
  143. intagrin-0.1.0/tests/test_rag.py +57 -0
  144. intagrin-0.1.0/tests/test_rag_disk_cache.py +110 -0
  145. intagrin-0.1.0/tests/test_rate_limiter.py +132 -0
  146. intagrin-0.1.0/tests/test_rate_limiter_api.py +98 -0
  147. intagrin-0.1.0/tests/test_replay_router_trace.py +123 -0
  148. intagrin-0.1.0/tests/test_router.py +495 -0
  149. intagrin-0.1.0/tests/test_run_logs.py +70 -0
  150. intagrin-0.1.0/tests/test_runtime_controls.py +160 -0
  151. intagrin-0.1.0/tests/test_sandbox.py +196 -0
  152. intagrin-0.1.0/tests/test_schema_validation.py +147 -0
  153. intagrin-0.1.0/tests/test_shared_memory.py +167 -0
  154. intagrin-0.1.0/tests/test_shared_resources.py +144 -0
  155. intagrin-0.1.0/tests/test_simulate_cli.py +113 -0
  156. intagrin-0.1.0/tests/test_simulator.py +179 -0
  157. intagrin-0.1.0/tests/test_state_reconstruction.py +195 -0
  158. intagrin-0.1.0/tests/test_streaming_turn.py +164 -0
  159. intagrin-0.1.0/tests/test_studio.py +104 -0
  160. intagrin-0.1.0/tests/test_swarm_and_reducers.py +150 -0
  161. intagrin-0.1.0/tests/test_synthesizer.py +48 -0
  162. intagrin-0.1.0/tests/test_tool_call_durability.py +245 -0
  163. intagrin-0.1.0/tests/test_tool_runner_debounce.py +100 -0
  164. intagrin-0.1.0/tests/test_tools_loader.py +41 -0
  165. intagrin-0.1.0/tests/test_tracing.py +140 -0
  166. intagrin-0.1.0/tests/test_tuner.py +142 -0
  167. intagrin-0.1.0/tests/test_untrusted_content_tracking.py +207 -0
  168. intagrin-0.1.0/tests/test_verifier.py +770 -0
  169. intagrin-0.1.0/tests/test_vote_workflow.py +209 -0
  170. intagrin-0.1.0/tests/test_worker_pooling.py +55 -0
  171. intagrin-0.1.0/tests/test_worker_queue.py +53 -0
intagrin-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 IntaGrin Team
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,350 @@
1
+ Metadata-Version: 2.4
2
+ Name: intagrin
3
+ Version: 0.1.0
4
+ Summary: The definitive Python framework for enterprise AI agents and autonomous swarms.
5
+ Author-email: Anoop P S <hello@intagrin.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/intagrin/intagrin
8
+ Project-URL: Documentation, https://docs.intagrin.com/
9
+ Project-URL: Repository, https://github.com/intagrin/intagrin
10
+ Project-URL: Issues, https://github.com/intagrin/intagrin/issues
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: typer>=0.12.0
15
+ Requires-Dist: rich>=13.7.0
16
+ Requires-Dist: pydantic>=2.7.0
17
+ Requires-Dist: litellm>=1.35.0
18
+ Requires-Dist: mcp>=1.0.0
19
+ Requires-Dist: ruamel.yaml>=0.18.6
20
+ Requires-Dist: opentelemetry-sdk>=1.24.0
21
+ Requires-Dist: opentelemetry-api>=1.24.0
22
+ Requires-Dist: Jinja2>=3.1.3
23
+ Requires-Dist: python-dotenv>=1.0.1
24
+ Requires-Dist: fastapi>=0.100.0
25
+ Requires-Dist: uvicorn>=0.23.0
26
+ Requires-Dist: gunicorn>=21.2.0
27
+ Requires-Dist: alembic>=1.13.0
28
+ Requires-Dist: sqlalchemy>=2.0.0
29
+ Provides-Extra: postgres
30
+ Requires-Dist: psycopg[binary,pool]>=3.1.0; extra == "postgres"
31
+ Provides-Extra: redis
32
+ Requires-Dist: redis>=5.0.0; extra == "redis"
33
+ Dynamic: license-file
34
+
35
+ <p align="center">
36
+ <img src="https://raw.githubusercontent.com/intagrin/intagrin/main/docs/assets/logo3.png" alt="IntaGrin Logo" width="200"/>
37
+ </p>
38
+
39
+ <p align="center">
40
+ <b>A declarative framework for building multi-agent LLM systems in YAML</b>
41
+ </p>
42
+
43
+ <p align="center">
44
+ <img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version 0.1.0"/>
45
+ <a href="./LICENSE">
46
+ <img src="https://img.shields.io/badge/License-Apache%202.0-success.svg" alt="License"/>
47
+ </a>
48
+ <img src="https://img.shields.io/badge/status-active-brightgreen.svg" alt="Active"/>
49
+ </p>
50
+
51
+ > **Status:** IntaGrin is under active development.
52
+
53
+ ## ๐ŸŽฏ Why IntaGrin?
54
+
55
+ - **Declarative, not programmatic.** Routing, guardrails, and memory live in `ai.yaml`, not in
56
+ hand-wired Python graph code or agent/crew objects. Less boilerplate to write and review โ€” and,
57
+ increasingly relevant, easier for an AI coding assistant to generate and validate than a
58
+ sprawling graph definition, since the whole surface is a schema-checked config file instead of
59
+ arbitrary code.
60
+ - **Governance built in, not bolted on.** Circuit breakers with an honest bounded/unbounded cost
61
+ accounting, human-in-the-loop approval scoped to the exact call that needs it (not just the
62
+ tool), a content-provenance guardrail for the "lethal trifecta" pattern (untrusted input +
63
+ data access + a way to exfiltrate), and sandboxed code execution โ€” all declared in config, not
64
+ assembled by hand from separate libraries.
65
+ - **Static verification before runtime.** `inta verify` catches routing cycles, unbounded cost
66
+ paths, and misconfigured guardrails before you ever run the agent โ€” and tells you exactly which
67
+ parts of your graph it *can't* verify (semantic routing, dynamic agent spawning), instead of a
68
+ blanket "all good."
69
+ - **Honesty over marketing.** Every tool in this repo says what it doesn't cover, not just what it
70
+ does โ€” the fuzzer calls its own checks "keyword-heuristic," the sandbox tool documents that it
71
+ isn't a filesystem/network security boundary. A claim only ships if the code actually backs it.
72
+
73
+ ## Summary
74
+
75
+ **IntaGrin** is a declarative framework for building multi-agent LLM systems. Instead of wiring
76
+ routing logic in Python (as you would with a hand-built graph), you describe agents, handoffs,
77
+ tools, and guardrails in a single `ai.yaml` file, and the runtime engine executes that
78
+ configuration directly.
79
+
80
+ It includes a static verifier for the parts of your routing graph that *are* statically
81
+ analyzable (handoffs and deterministic routers), circuit breakers for cost/loop protection,
82
+ Pydantic-backed schema validation for shared state and structured agent output, an adversarial
83
+ prompt fuzzer, and a diagnostics command that runs real test batches and reports the metrics it
84
+ actually measured. Where a mechanism has real limits โ€” semantic (LLM-routed) handoffs can't be
85
+ statically verified, the fuzzer's defense checks are keyword-heuristic rather than a full security
86
+ audit โ€” the tool says so directly rather than rounding up.
87
+
88
+ ---
89
+
90
+ ## ๐ŸŒŸ Core Capabilities
91
+
92
+ ### 1. Spec-Driven Architecture (Natural Language to Production)
93
+ Describe the desired swarm topology in a plain-English `blueprint.md` file, then run `inta compile`
94
+ to generate a structured `ai.yaml` from it. This is meant to reduce hand-wiring routing logic in
95
+ Python for common patterns โ€” it's a starting point to review and edit, not a black box.
96
+
97
+ ### 2. Argument & Schema Self-Healing
98
+ When a tool call arrives with malformed JSON or arguments that fail validation, IntaGrin retries by
99
+ asking a fast corrector model to fix the arguments (up to 2 attempts) before surfacing the error.
100
+ The same mechanism validates structured agent responses against a `response_schema` and shared
101
+ state writes against a `state_schema` โ€” both are real Pydantic models loaded and validated at
102
+ runtime, not just declared. Healing is scoped to fixing arguments/output in memory; it never
103
+ modifies source code, prompts, or your declared routing.
104
+
105
+ ### 3. Reducing Tool-Schema Bloat
106
+ `lazy_load_tools: true` on an agent uses a fast model call to select which tool schemas are
107
+ actually relevant to the current conversation before sending them to the primary model โ€” useful
108
+ when an agent has many tools but only needs a few per turn. That selection call is debounced: an
109
+ unchanged recent-message trajectory reuses the last selection instead of re-querying the router
110
+ model every tool-call round. Building the `ai.yaml`/prompt/tool-file structure with an AI coding
111
+ assistant also tends to need less back-and-forth than wiring the same logic in a general-purpose
112
+ graph framework, since there's less boilerplate to review.
113
+
114
+ ### 4. Static Verification & Adversarial Fuzzing
115
+ `inta verify` performs real cycle detection across declared handoffs and deterministic routers,
116
+ reports delegation depth/turn bounds, and gives an explicit worst-case cost accounting that lists
117
+ which cost paths are bounded and which aren't. Self-healing retries, memory-compression input
118
+ size, and per-turn parallel tool calls are all capped by dedicated `circuit_breakers` settings
119
+ (`max_corrector_tokens`, `max_compression_batch_messages`, `max_parallel_tool_calls_per_turn`) โ€”
120
+ the report shows their configured bound rather than a blanket "unbounded."
121
+ Semantic (`auto_route`) handoffs are an LLM decision at runtime and are reported separately as
122
+ non-deterministic, bounded only by the hard turn cap, not by graph acyclicity. `inta fuzz` generates
123
+ adversarial prompts (prompt injection, PII extraction, boundary overflows) and runs them against
124
+ your live agents; its pass/fail check is keyword-heuristic today, so treat the score as a smoke test
125
+ rather than a substitute for a real security review.
126
+
127
+ ### 5. Observability & Diagnostics
128
+ `inta monitor` launches a local SSE-backed dashboard showing live agent handoffs, tool calls, and
129
+ token/cost telemetry as your swarm runs. `inta diagnose` runs a batch of real requests โ€” your
130
+ `tests/evals.yaml` if present, or a small generated probe battery otherwise โ€” and reports metrics
131
+ computed from those actual runs: context-window utilization, tool error rate, cost, and latency,
132
+ with a rules-based explanation of whichever metric crossed its threshold.
133
+
134
+ ---
135
+
136
+ ## ๐Ÿ› ๏ธ The AI-Native Developer Experience
137
+
138
+ IntaGrin provides a unified, deeply integrated Command Line Interface (CLI) that manages the entire lifecycle of an AI application.
139
+
140
+ ### Project Initialization & Compilation
141
+ * `inta new` (or `init`) โ€” Scaffold a new IntaGrin project structure.
142
+ * `inta compile` โ€” Compile a natural language `blueprint.md` into a diff-merged `ai.yaml` configuration.
143
+ * `inta import` โ€” Import an OpenAPI/Swagger spec and generate a starting `ai.yaml` with tools wired to its endpoints.
144
+ * `inta copilot` โ€” Generate IDE rule/skill files (e.g. `.cursor/rules/`) describing IntaGrin's conventions to your AI coding assistant.
145
+ * `inta architect` โ€” Launch a built-in AI assistant to iteratively refactor and modify your swarm architecture directly from the terminal.
146
+
147
+ ### Quality Assurance & Security
148
+ * `inta fuzz` โ€” Generates adversarial prompts (prompt injection, PII extraction, boundary overflows) and runs them against your live agents. Pass/fail detection is keyword-heuristic โ€” a useful smoke test, not a substitute for a real security review.
149
+ * `inta verify` โ€” Static cycle detection across handoffs and deterministic routers, delegation depth/turn bounds, and an explicit worst-case cost accounting that lists what's bounded vs. not.
150
+ * `inta simulate --config <candidate.yaml>` โ€” Shadow Replay: re-evaluates a candidate `ai.yaml`'s routers, circuit breakers, and `requires_approval` flags against real checkpointed sessions โ€” zero new LLM calls, zero re-executed tools โ€” and reports what would actually change before you deploy it. Limited to config changes that can't alter what the LLM itself generates (prompts/models/tool identity); anything else is reported as not-yet-simulatable rather than guessed at.
151
+ * `inta synth` โ€” Generates boundary-case test inputs (numeric/string edge cases, handoff transitions) from your tool signatures and agent config into `tests/evals.yaml`.
152
+ * `inta eval` โ€” Runs the cases in `tests/evals.yaml` against your live agents and checks expected agent/tool/output assertions, with optional LLM-as-judge scoring.
153
+ * `inta tune` โ€” Iteratively repairs failing prompts against `tests/evals.yaml`. Snapshots every prompt it touches first and rolls back to the original if it doesn't converge within the iteration limit.
154
+
155
+ ### Runtime, Debugging, & Observability
156
+ * `inta dev` โ€” Launch the local developer environment with hot-reloading.
157
+ * `inta run <workflow>` โ€” Execute a named autonomous workflow directly from the terminal.
158
+ * `inta monitor` โ€” Launch the local Web Dashboard to watch agent handoffs, tool calls, and token/cost telemetry live over SSE.
159
+ * `inta diagnose` โ€” Run a batch of real requests (your `tests/evals.yaml`, or a small generated probe battery) and report computed metrics: context-window utilization, tool error rate, cost, and latency.
160
+ * `inta replay` โ€” Rewind and replay the recorded sequence of events from a past checkpointed session.
161
+
162
+ ### Deployment
163
+ * `inta export` โ€” Export your default agent's prompt and local tools (with a real tool-calling loop) to a standalone FastAPI application with no IntaGrin runtime dependency. Single-agent scope โ€” handoffs, routers, guardrails, and HITL aren't reproduced; keep using `inta serve` for the full swarm.
164
+ * `inta deploy` โ€” Generate a `Dockerfile` and `docker-compose.yml` for the project, running as a non-root user.
165
+ * `inta worker` โ€” Start a background worker that pulls jobs from a local SQLite queue (atomic, concurrency-safe) or a Redis queue if `--redis-url` is configured. Tool connections and the RAG index are built once and reused across every job, not rebuilt per job.
166
+ * `inta serve` โ€” Start the FastAPI production server (SSE streaming, `/resume` for human-in-the-loop, `/ws/voice`). MCP connections, tool schemas, and the RAG index are pooled per project across requests โ€” see [Runtime Resource Pooling](./docs/04_Production_Deployment.md#runtime-resource-pooling).
167
+
168
+ ---
169
+
170
+ ## ๐Ÿš€ Getting Started
171
+
172
+ ### 1. Installation
173
+
174
+ ```bash
175
+ pip install intagrin # or: uv add intagrin
176
+ ```
177
+
178
+ If a project sets `memory.type: postgres` or `memory.type: redis`, install the matching extra โ€”
179
+ these client libraries are optional (not pulled in by default) so a plain SQLite/in-process project
180
+ stays lightweight:
181
+ ```bash
182
+ uv sync --extra postgres # or: pip install -e ".[postgres]"
183
+ uv sync --extra redis # or: pip install -e ".[redis]"
184
+ ```
185
+
186
+ ### 2. Scaffold Your Project
187
+ Initialize your project scaffolding and navigate into it:
188
+ ```bash
189
+ inta new my-first-swarm
190
+ cd my-first-swarm
191
+ ```
192
+
193
+ ### 3. The Coding Agent Workflow (The "IntaGrin Way")
194
+ Because IntaGrin's routing, tools, and guardrails are declared in `ai.yaml` rather than wired in
195
+ Python, an AI coding assistant working in this repo generally has less boilerplate to read and
196
+ write per agent than it would with a hand-built Python graph. We recommend building your
197
+ application using the **Spec-Driven** approach.
198
+
199
+ Instead of writing code manually, simply describe what you want your swarm to do in plain English inside `blueprint.md`:
200
+
201
+ ```markdown
202
+ # blueprint.md
203
+
204
+ ## Vision
205
+ Build a highly resilient Customer Support Swarm that processes incoming tickets, handles billing, and seamlessly escalates complex issues.
206
+
207
+ ## Constraints
208
+ - The Billing Agent must strictly require human approval before issuing any Stripe refunds.
209
+ - Simple triage must use a lightweight model (e.g. Gemini 1.5 Flash) to save costs.
210
+ - The swarm must never enter an infinite loop if a refund fails.
211
+
212
+ ## Agents
213
+ 1. **Triage Agent:** Reads incoming emails and routes them based on the customer's intent.
214
+ 2. **Billing Agent:** Securely interfaces with the Stripe API to process refunds.
215
+ 3. **Human Escalation:** A fallback agent that halts the swarm if an API error occurs.
216
+ ```
217
+
218
+ Now, compile your English blueprint into a production-ready Swarm Architecture using the IntaGrin compiler:
219
+ ```bash
220
+ inta compile
221
+ ```
222
+ *(Your AI coding assistant โ€” or IntaGrin's built-in compiler โ€” reads the Markdown and generates a structured `ai.yaml`. Review the output; treat it as a first draft, not a final architecture.)*
223
+
224
+ ### 4. Launch & Monitor
225
+ Start the live visual dashboard and run your swarm!
226
+ ```bash
227
+ inta monitor
228
+ inta run daily_audit
229
+ ```
230
+ Open `http://localhost:3000` to watch your swarm light up in real-time.
231
+
232
+ ---
233
+
234
+ ## ๐Ÿ—๏ธ Architectural Paradigm: Declarative Orchestration
235
+
236
+ IntaGrin gives you both routing styles under one config, and you choose per agent: **deterministic
237
+ routers** (a Python condition evaluated against state, no LLM call involved) for logic you want
238
+ statically verifiable, and **LLM-driven handoffs** (`transfer_agent`) for decisions that genuinely
239
+ need the model's judgment. State reducers, tool scoping, and circuit breakers are all declared in
240
+ the same `ai.yaml`.
241
+
242
+ <p align="center">
243
+ <img src="https://raw.githubusercontent.com/intagrin/intagrin/main/docs/assets/diagram.png" alt="IntaGrin Logo" width="600"/>
244
+ </p>
245
+
246
+ <p align="center">
247
+ <img src="https://raw.githubusercontent.com/intagrin/intagrin/main/docs/assets/workflow.png" alt="IntaGrin Logo" width="600"/>
248
+ </p>
249
+
250
+ ```yaml
251
+ # ai.yaml
252
+ name: "SaaS Customer Support Swarm"
253
+ version: "1.0"
254
+ default_agent: "TriageAgent" # Entry point for the Swarm
255
+
256
+ circuit_breakers:
257
+ max_usd_cost_per_session: 0.50 # Hard stop if API costs exceed 50 cents
258
+ max_handoffs_per_session: 3 # Caps handoff ping-pong (defaults to 25 if unset)
259
+
260
+ reducers:
261
+ - key: "customer_context"
262
+ strategy: "deep_merge" # Automatically merge CRM data into state
263
+
264
+ model:
265
+ primary: "openai/gpt-4o"
266
+ fallback: "gemini/gemini-3.5-flash"
267
+
268
+ agents:
269
+ TriageAgent:
270
+ description: "Reads incoming support tickets and classifies the user intent."
271
+ lazy_load_tools: true # Cost Cutter: Dynamically injects only needed tools
272
+ model_override: "gemini/gemini-3.5-flash-lite" # Cost Cutter: Use cheap model for simple triage
273
+ routers:
274
+ - target: BillingAgent
275
+ condition: "'refund' in intent"
276
+ - target: TechnicalAgent
277
+ condition: "'bug' in intent"
278
+ tools:
279
+ - name: "zendesk_mcp"
280
+ type: "mcp"
281
+ command: "npx"
282
+ args: ["@modelcontextprotocol/server-zendesk"]
283
+ - name: "fetch_user_profile"
284
+ module: "tools.crm"
285
+
286
+ BillingAgent:
287
+ description: "Handles subscription changes and issues refunds."
288
+ tools:
289
+ - name: "stripe_mcp"
290
+ type: "mcp"
291
+ command: "npx"
292
+ args: ["@modelcontextprotocol/server-stripe"]
293
+ - name: "issue_refund"
294
+ module: "tools.billing"
295
+ requires_approval: true # Enterprise Safety: Halts for Human-in-the-Loop approval before sending money!
296
+ ```
297
+
298
+ ---
299
+
300
+ ## ๐Ÿ“– Full Documentation
301
+
302
+ The hosted docs site โ€” **<https://docs.intagrin.com/>** โ€” covers the `ai.yaml` reference,
303
+ tools/MCP integration, RAG, human-in-the-loop, deployment, and the API. The [`docs/`](./docs) folder
304
+ in this repository is the source those pages are built from, and is the source of truth for what
305
+ the current code does if the two ever drift.
306
+
307
+ ---
308
+
309
+ ## ๐Ÿงช Testing This Repository
310
+
311
+ ```bash
312
+ uv run pytest tests/ # full suite (SQLite/mocked backends only, no external services needed)
313
+ uv run ruff check . # lint, matches CI
314
+ ```
315
+
316
+ The Postgres and Redis checkpointer backends additionally have real-instance integration tests
317
+ (`tests/test_memory_integration.py`, `tests/test_auto_migrate_postgres.py`) that are **not** part
318
+ of the default suite above โ€” they skip themselves cleanly when no instance is reachable. To run
319
+ them against local Docker containers:
320
+ ```bash
321
+ uv sync --extra postgres --extra redis
322
+ docker compose -f docker-compose.test.yml up -d
323
+ uv run pytest tests/test_memory_integration.py tests/test_auto_migrate_postgres.py -q
324
+ docker compose -f docker-compose.test.yml down
325
+ ```
326
+
327
+ ---
328
+
329
+ ## ๐Ÿ“š Example Use Cases
330
+
331
+ These are illustrative patterns โ€” designs you'd build with IntaGrin's handoffs/tools/MCP, not
332
+ templates that ship with the framework:
333
+
334
+ | Example Swarm | Description |
335
+ | :--- | :--- |
336
+ | **Autonomous DevOps Engineer** | Monitors Datadog alerts, pulls distributed traces, and safely restarts Kubernetes pods via MCP servers. |
337
+ | **Customer Support Triage** | An asynchronous swarm that routes complex tickets, validates Stripe refunds, and drafts personalized apology emails. |
338
+ | **Cybersecurity SOC Analyst** | An event-driven swarm that ingests real-time threat intel, cross-references CVE databases, and executes firewall IP quarantines. |
339
+
340
+ ---
341
+
342
+ > [!NOTE]
343
+ > **No Vendor Lock-In (for the parts it exports)**
344
+ > IntaGrin is open-source (Apache 2.0). `inta export` compiles your project's **default agent** โ€”
345
+ > its prompt and local tools, with a real tool-calling loop, no IntaGrin import required at
346
+ > runtime โ€” into a single standalone FastAPI file. This is a single-agent export: handoffs,
347
+ > delegations, routers, circuit breakers, guardrails, and human-in-the-loop approval are not
348
+ > reproduced, and MCP/OpenAPI tools aren't included either (no live connection is possible in one
349
+ > dependency-free file). For a real multi-agent swarm, keep running `inta serve` โ€” `inta export`
350
+ > is for walking away with your single busiest agent, not the whole framework.