powabase-agentic 0.1.0rc1__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 (183) hide show
  1. powabase_agentic-0.1.0rc1/.github/workflows/publish.yml +46 -0
  2. powabase_agentic-0.1.0rc1/.python-version +1 -0
  3. powabase_agentic-0.1.0rc1/LICENSE +202 -0
  4. powabase_agentic-0.1.0rc1/PKG-INFO +209 -0
  5. powabase_agentic-0.1.0rc1/README.md +176 -0
  6. powabase_agentic-0.1.0rc1/docs/CONCEPTS.md +690 -0
  7. powabase_agentic-0.1.0rc1/pyproject.toml +91 -0
  8. powabase_agentic-0.1.0rc1/scripts/separability_gate.sh +65 -0
  9. powabase_agentic-0.1.0rc1/src/agentic/__init__.py +147 -0
  10. powabase_agentic-0.1.0rc1/src/agentic/agent/__init__.py +33 -0
  11. powabase_agentic-0.1.0rc1/src/agentic/agent/agent.py +1608 -0
  12. powabase_agentic-0.1.0rc1/src/agentic/agent/cache.py +27 -0
  13. powabase_agentic-0.1.0rc1/src/agentic/agent/compaction.py +159 -0
  14. powabase_agentic-0.1.0rc1/src/agentic/agent/errors.py +48 -0
  15. powabase_agentic-0.1.0rc1/src/agentic/agent/hooks.py +170 -0
  16. powabase_agentic-0.1.0rc1/src/agentic/agent/loop_state.py +83 -0
  17. powabase_agentic-0.1.0rc1/src/agentic/agent/message.py +86 -0
  18. powabase_agentic-0.1.0rc1/src/agentic/agent/normalization.py +62 -0
  19. powabase_agentic-0.1.0rc1/src/agentic/agent/output.py +120 -0
  20. powabase_agentic-0.1.0rc1/src/agentic/agent/rules.py +81 -0
  21. powabase_agentic-0.1.0rc1/src/agentic/agent/session.py +116 -0
  22. powabase_agentic-0.1.0rc1/src/agentic/agent/tool_config.py +34 -0
  23. powabase_agentic-0.1.0rc1/src/agentic/agent/tools.py +339 -0
  24. powabase_agentic-0.1.0rc1/src/agentic/agent/url_validation.py +66 -0
  25. powabase_agentic-0.1.0rc1/src/agentic/execution/__init__.py +21 -0
  26. powabase_agentic-0.1.0rc1/src/agentic/execution/base.py +81 -0
  27. powabase_agentic-0.1.0rc1/src/agentic/execution/context.py +155 -0
  28. powabase_agentic-0.1.0rc1/src/agentic/execution/status.py +45 -0
  29. powabase_agentic-0.1.0rc1/src/agentic/ingest/__init__.py +66 -0
  30. powabase_agentic-0.1.0rc1/src/agentic/ingest/connector/__init__.py +33 -0
  31. powabase_agentic-0.1.0rc1/src/agentic/ingest/connector/base.py +114 -0
  32. powabase_agentic-0.1.0rc1/src/agentic/ingest/connector/file_upload.py +156 -0
  33. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/__init__.py +54 -0
  34. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/base.py +178 -0
  35. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/docx.py +142 -0
  36. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/html.py +222 -0
  37. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/image.py +257 -0
  38. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/llamaparse.py +180 -0
  39. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/page_splitter.py +151 -0
  40. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/pdf.py +1055 -0
  41. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/pptx.py +142 -0
  42. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/registry.py +265 -0
  43. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/text.py +161 -0
  44. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/txt.py +84 -0
  45. powabase_agentic-0.1.0rc1/src/agentic/ingest/extractor/xlsx.py +85 -0
  46. powabase_agentic-0.1.0rc1/src/agentic/ingest/models.py +206 -0
  47. powabase_agentic-0.1.0rc1/src/agentic/knowledge/__init__.py +141 -0
  48. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/__init__.py +34 -0
  49. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/base.py +96 -0
  50. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/fixed.py +154 -0
  51. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/markdown_header.py +157 -0
  52. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/recursive.py +200 -0
  53. powabase_agentic-0.1.0rc1/src/agentic/knowledge/chunking/token_utils.py +48 -0
  54. powabase_agentic-0.1.0rc1/src/agentic/knowledge/embedder/__init__.py +38 -0
  55. powabase_agentic-0.1.0rc1/src/agentic/knowledge/embedder/base.py +109 -0
  56. powabase_agentic-0.1.0rc1/src/agentic/knowledge/embedder/litellm.py +270 -0
  57. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/__init__.py +53 -0
  58. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/_pageindex_lib/__init__.py +15 -0
  59. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/_pageindex_lib/config.yaml +13 -0
  60. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/_pageindex_lib/page_index.py +1512 -0
  61. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/_pageindex_lib/page_index_md.py +1197 -0
  62. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/_pageindex_lib/utils.py +951 -0
  63. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/base.py +88 -0
  64. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/chunk_embed.py +219 -0
  65. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/doc2json.py +1002 -0
  66. powabase_agentic-0.1.0rc1/src/agentic/knowledge/indexing/page_index.py +470 -0
  67. powabase_agentic-0.1.0rc1/src/agentic/knowledge/model_config.py +395 -0
  68. powabase_agentic-0.1.0rc1/src/agentic/knowledge/models.py +158 -0
  69. powabase_agentic-0.1.0rc1/src/agentic/knowledge/reranker/__init__.py +40 -0
  70. powabase_agentic-0.1.0rc1/src/agentic/knowledge/reranker/base.py +81 -0
  71. powabase_agentic-0.1.0rc1/src/agentic/knowledge/reranker/litellm.py +163 -0
  72. powabase_agentic-0.1.0rc1/src/agentic/knowledge/reranker/zeroentropy.py +111 -0
  73. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/__init__.py +52 -0
  74. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/base.py +101 -0
  75. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/bm25.py +121 -0
  76. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/diversity.py +139 -0
  77. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/fusion.py +105 -0
  78. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/tree_search.py +426 -0
  79. powabase_agentic-0.1.0rc1/src/agentic/knowledge/retrieval/vector_search.py +240 -0
  80. powabase_agentic-0.1.0rc1/src/agentic/knowledge/store.py +178 -0
  81. powabase_agentic-0.1.0rc1/src/agentic/llm/__init__.py +20 -0
  82. powabase_agentic-0.1.0rc1/src/agentic/llm/cost_accumulator.py +151 -0
  83. powabase_agentic-0.1.0rc1/src/agentic/llm/reasoning_extractor.py +99 -0
  84. powabase_agentic-0.1.0rc1/src/agentic/llm/routing.py +167 -0
  85. powabase_agentic-0.1.0rc1/src/agentic/llm/setup.py +17 -0
  86. powabase_agentic-0.1.0rc1/src/agentic/llm/streaming.py +400 -0
  87. powabase_agentic-0.1.0rc1/src/agentic/mcp/__init__.py +4 -0
  88. powabase_agentic-0.1.0rc1/src/agentic/mcp/client.py +91 -0
  89. powabase_agentic-0.1.0rc1/src/agentic/mcp/types.py +16 -0
  90. powabase_agentic-0.1.0rc1/src/agentic/orchestration/__init__.py +30 -0
  91. powabase_agentic-0.1.0rc1/src/agentic/orchestration/engine.py +46 -0
  92. powabase_agentic-0.1.0rc1/src/agentic/orchestration/orchestration.py +131 -0
  93. powabase_agentic-0.1.0rc1/src/agentic/orchestration/output.py +20 -0
  94. powabase_agentic-0.1.0rc1/src/agentic/orchestration/session.py +42 -0
  95. powabase_agentic-0.1.0rc1/src/agentic/orchestration/strategies.py +570 -0
  96. powabase_agentic-0.1.0rc1/src/agentic/py.typed +0 -0
  97. powabase_agentic-0.1.0rc1/src/agentic/workflow/__init__.py +44 -0
  98. powabase_agentic-0.1.0rc1/src/agentic/workflow/block.py +90 -0
  99. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/__init__.py +40 -0
  100. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/agent.py +210 -0
  101. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/api_call.py +96 -0
  102. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/condition.py +118 -0
  103. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/function.py +295 -0
  104. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/orchestration.py +39 -0
  105. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/platform_api.py +372 -0
  106. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/response.py +36 -0
  107. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/split.py +31 -0
  108. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/starter.py +22 -0
  109. powabase_agentic-0.1.0rc1/src/agentic/workflow/blocks/webhook.py +12 -0
  110. powabase_agentic-0.1.0rc1/src/agentic/workflow/engine.py +380 -0
  111. powabase_agentic-0.1.0rc1/src/agentic/workflow/expression.py +180 -0
  112. powabase_agentic-0.1.0rc1/src/agentic/workflow/output.py +34 -0
  113. powabase_agentic-0.1.0rc1/src/agentic/workflow/session.py +42 -0
  114. powabase_agentic-0.1.0rc1/src/agentic/workflow/variable_resolver.py +69 -0
  115. powabase_agentic-0.1.0rc1/src/agentic/workflow/workflow.py +177 -0
  116. powabase_agentic-0.1.0rc1/tests/__init__.py +3 -0
  117. powabase_agentic-0.1.0rc1/tests/agent/__init__.py +1 -0
  118. powabase_agentic-0.1.0rc1/tests/agent/test_agent_output_reasoning.py +77 -0
  119. powabase_agentic-0.1.0rc1/tests/agent/test_extract_usage.py +191 -0
  120. powabase_agentic-0.1.0rc1/tests/agent/test_message_pydantic.py +165 -0
  121. powabase_agentic-0.1.0rc1/tests/agent/test_msg_dict_reasoning_attach.py +87 -0
  122. powabase_agentic-0.1.0rc1/tests/agent/test_reasoning_call_kwargs.py +178 -0
  123. powabase_agentic-0.1.0rc1/tests/agent/test_reasoning_effort_resolution.py +54 -0
  124. powabase_agentic-0.1.0rc1/tests/agent/test_step_reset_emission.py +112 -0
  125. powabase_agentic-0.1.0rc1/tests/conftest.py +160 -0
  126. powabase_agentic-0.1.0rc1/tests/fixtures/__init__.py +0 -0
  127. powabase_agentic-0.1.0rc1/tests/fixtures/streams.py +158 -0
  128. powabase_agentic-0.1.0rc1/tests/llm/__init__.py +0 -0
  129. powabase_agentic-0.1.0rc1/tests/llm/test_defensive_extraction.py +48 -0
  130. powabase_agentic-0.1.0rc1/tests/llm/test_extract_usage.py +184 -0
  131. powabase_agentic-0.1.0rc1/tests/llm/test_reasoning_extractor.py +154 -0
  132. powabase_agentic-0.1.0rc1/tests/llm/test_routing.py +232 -0
  133. powabase_agentic-0.1.0rc1/tests/llm/test_setup.py +58 -0
  134. powabase_agentic-0.1.0rc1/tests/llm/test_streaming.py +456 -0
  135. powabase_agentic-0.1.0rc1/tests/llm/test_streaming_extended.py +200 -0
  136. powabase_agentic-0.1.0rc1/tests/orchestration/__init__.py +0 -0
  137. powabase_agentic-0.1.0rc1/tests/orchestration/test_delegate_tool_hook.py +283 -0
  138. powabase_agentic-0.1.0rc1/tests/test_abort.py +34 -0
  139. powabase_agentic-0.1.0rc1/tests/test_agent.py +766 -0
  140. powabase_agentic-0.1.0rc1/tests/test_approval.py +150 -0
  141. powabase_agentic-0.1.0rc1/tests/test_budget.py +143 -0
  142. powabase_agentic-0.1.0rc1/tests/test_cache.py +65 -0
  143. powabase_agentic-0.1.0rc1/tests/test_compaction.py +223 -0
  144. powabase_agentic-0.1.0rc1/tests/test_concurrent_tools.py +203 -0
  145. powabase_agentic-0.1.0rc1/tests/test_cost_accumulator.py +204 -0
  146. powabase_agentic-0.1.0rc1/tests/test_delegate_tool.py +147 -0
  147. powabase_agentic-0.1.0rc1/tests/test_doc2json.py +777 -0
  148. powabase_agentic-0.1.0rc1/tests/test_errors.py +45 -0
  149. powabase_agentic-0.1.0rc1/tests/test_execution_context.py +112 -0
  150. powabase_agentic-0.1.0rc1/tests/test_hook_events.py +170 -0
  151. powabase_agentic-0.1.0rc1/tests/test_hooks.py +161 -0
  152. powabase_agentic-0.1.0rc1/tests/test_ingest.py +1469 -0
  153. powabase_agentic-0.1.0rc1/tests/test_knowledge.py +437 -0
  154. powabase_agentic-0.1.0rc1/tests/test_loop_state.py +69 -0
  155. powabase_agentic-0.1.0rc1/tests/test_mcp_client.py +160 -0
  156. powabase_agentic-0.1.0rc1/tests/test_mcp_tool.py +82 -0
  157. powabase_agentic-0.1.0rc1/tests/test_model_config_resiliency.py +61 -0
  158. powabase_agentic-0.1.0rc1/tests/test_normalization.py +166 -0
  159. powabase_agentic-0.1.0rc1/tests/test_orchestration.py +221 -0
  160. powabase_agentic-0.1.0rc1/tests/test_pageindex_cost_metadata.py +51 -0
  161. powabase_agentic-0.1.0rc1/tests/test_pageindex_reasoning_effort.py +202 -0
  162. powabase_agentic-0.1.0rc1/tests/test_react_loop.py +590 -0
  163. powabase_agentic-0.1.0rc1/tests/test_recovery.py +153 -0
  164. powabase_agentic-0.1.0rc1/tests/test_retrieval_diversity.py +129 -0
  165. powabase_agentic-0.1.0rc1/tests/test_rules.py +182 -0
  166. powabase_agentic-0.1.0rc1/tests/test_ssrf.py +77 -0
  167. powabase_agentic-0.1.0rc1/tests/test_strategies.py +217 -0
  168. powabase_agentic-0.1.0rc1/tests/test_structured_output.py +121 -0
  169. powabase_agentic-0.1.0rc1/tests/test_timeout.py +89 -0
  170. powabase_agentic-0.1.0rc1/tests/test_tool_pipeline.py +170 -0
  171. powabase_agentic-0.1.0rc1/tests/test_tools.py +254 -0
  172. powabase_agentic-0.1.0rc1/tests/test_tree_search_reasoning.py +81 -0
  173. powabase_agentic-0.1.0rc1/tests/unit/test_import_isolation.py +63 -0
  174. powabase_agentic-0.1.0rc1/tests/unit/test_packaging_metadata.py +38 -0
  175. powabase_agentic-0.1.0rc1/tests/unit/test_readme_reality.py +18 -0
  176. powabase_agentic-0.1.0rc1/tests/unit/test_sandbox_contract.py +46 -0
  177. powabase_agentic-0.1.0rc1/tests/workflow/__init__.py +0 -0
  178. powabase_agentic-0.1.0rc1/tests/workflow/test_agent_block_hook.py +349 -0
  179. powabase_agentic-0.1.0rc1/tests/workflow/test_condition_block.py +171 -0
  180. powabase_agentic-0.1.0rc1/tests/workflow/test_function_imports.py +505 -0
  181. powabase_agentic-0.1.0rc1/tests/workflow/test_input_mapping.py +113 -0
  182. powabase_agentic-0.1.0rc1/tests/workflow/test_platform_api_block.py +402 -0
  183. powabase_agentic-0.1.0rc1/uv.lock +2660 -0
@@ -0,0 +1,46 @@
1
+ name: Publish
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ version:
6
+ description: "PEP 440 version, e.g. 0.1.0rc1 (pre-1.0 uses -rc)"
7
+ required: true
8
+ type: string
9
+ dry_run:
10
+ description: "Build only; publish nothing"
11
+ required: true
12
+ default: true
13
+ type: boolean
14
+
15
+ permissions:
16
+ contents: read
17
+ id-token: write # PyPI Trusted Publishing (OIDC) — no token needed
18
+
19
+ jobs:
20
+ publish:
21
+ name: powabase-agentic → PyPI
22
+ runs-on: ubuntu-latest
23
+ environment: pypi
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: astral-sh/setup-uv@v5
27
+ - name: Set version and build sdist+wheel
28
+ run: |
29
+ # version is static in pyproject (hatchling); set it deterministically.
30
+ sed -i -E "s/^version = \".*\"/version = \"${{ inputs.version }}\"/" pyproject.toml
31
+ grep -E "^version = " pyproject.toml
32
+ uv build --out-dir dist
33
+ ls -la dist
34
+ # Guard the packages=["src/agentic"] mapping: the wheel must ship the
35
+ # `agentic` import package (distribution powabase-agentic != import name).
36
+ python3 - <<'PY'
37
+ import glob, zipfile
38
+ whl = glob.glob("dist/*.whl")[0]
39
+ mods = [n for n in zipfile.ZipFile(whl).namelist()
40
+ if n.startswith("agentic/") and n.endswith(".py")]
41
+ assert mods, "empty wheel — hatch packages mapping is wrong"
42
+ print(f"wheel packages {len(mods)} agentic modules")
43
+ PY
44
+ - name: Publish to PyPI (real run only)
45
+ if: ${{ inputs.dry_run == false }}
46
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1 @@
1
+ 3.13
@@ -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 2026 Powabase AI
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,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: powabase-agentic
3
+ Version: 0.1.0rc1
4
+ Summary: The agent, knowledge, orchestration, and workflow engine behind the Powabase stack — a Python library you can also import on its own
5
+ Author: Powabase AI
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.13
9
+ Requires-Dist: beautifulsoup4>=4.12.0
10
+ Requires-Dist: httpx>=0.27.0
11
+ Requires-Dist: langchain-text-splitters>=1.1.0
12
+ Requires-Dist: litellm>=1.90.1
13
+ Requires-Dist: markitdown[xls,xlsx]>=0.1.0
14
+ Requires-Dist: matplotlib>=3.8.0
15
+ Requires-Dist: mistralai>=1.0.0
16
+ Requires-Dist: numpy>=1.26.0
17
+ Requires-Dist: opendataloader-pdf>=2.2.0
18
+ Requires-Dist: pandas>=2.0.0
19
+ Requires-Dist: pdfplumber>=0.11.0
20
+ Requires-Dist: pillow>=10.0.0
21
+ Requires-Dist: pydantic>=2.0.0
22
+ Requires-Dist: pymupdf>=1.24.0
23
+ Requires-Dist: python-dateutil>=2.8.0
24
+ Requires-Dist: pyyaml>=6.0.0
25
+ Requires-Dist: requests>=2.31.0
26
+ Requires-Dist: scikit-learn>=1.4.0
27
+ Requires-Dist: scipy>=1.12.0
28
+ Requires-Dist: seaborn>=0.13.0
29
+ Requires-Dist: tiktoken>=0.7.0
30
+ Provides-Extra: rerankers
31
+ Requires-Dist: zeroentropy>=0.1.0a1; extra == 'rerankers'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # agentic
35
+
36
+ The agent/knowledge/orchestration/workflow engine that powers the Powabase stack — a well-documented Python library you can also import on its own.
37
+
38
+ ## Features
39
+
40
+ - **Agent**: Single LLM-powered agent with a clean run() interface
41
+ - **Session Management**: Built-in conversation history tracking
42
+ - **Multi-Model Support**: Uses [litellm](https://github.com/BerriAI/litellm) for 100+ LLM providers
43
+ - **Type-Safe**: Full type hints and dataclass-based outputs
44
+ - **Orchestration**: Multi-agent coordination (sequential, supervisor, router, parallel)
45
+ - **Workflow**: Multi-step pipelines with conditional logic, loops, and a sandboxed code-execution block
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ # Using pip
51
+ pip install agentic
52
+
53
+ # Using uv
54
+ uv add agentic
55
+
56
+ # From source
57
+ git clone https://github.com/your-org/agentic.git
58
+ cd agentic
59
+ pip install -e .
60
+ ```
61
+
62
+ ## Quick Start
63
+
64
+ ```python
65
+ from agentic import Agent
66
+
67
+ # Create an agent
68
+ agent = Agent(
69
+ model="gpt-4o-mini",
70
+ system_prompt="You are a helpful assistant.",
71
+ )
72
+
73
+ # Run the agent
74
+ output = agent.run("What is 2+2?")
75
+ print(output.content) # "2 + 2 equals 4."
76
+
77
+ # Check execution details
78
+ print(output.status) # ExecutionStatus.COMPLETED
79
+ print(output.usage) # {"prompt_tokens": 15, "completion_tokens": 8, ...}
80
+ ```
81
+
82
+ ## Multi-Turn Conversations
83
+
84
+ Use `AgentSession` to maintain conversation history:
85
+
86
+ ```python
87
+ from agentic import Agent, AgentSession
88
+
89
+ agent = Agent(
90
+ model="gpt-4o-mini",
91
+ system_prompt="You are a helpful assistant.",
92
+ )
93
+
94
+ # Create a session
95
+ session = AgentSession()
96
+
97
+ # First turn
98
+ output1 = agent.run("My name is Alice", session=session)
99
+ session.add_output(output1)
100
+
101
+ # Second turn - agent remembers the name
102
+ output2 = agent.run("What's my name?", session=session)
103
+ session.add_output(output2)
104
+ print(output2.content) # "Your name is Alice."
105
+
106
+ # Get conversation history
107
+ messages = session.get_messages()
108
+ ```
109
+
110
+ ## Async Support
111
+
112
+ ```python
113
+ import asyncio
114
+ from agentic import Agent
115
+
116
+ async def main():
117
+ agent = Agent(model="gpt-4o-mini", system_prompt="You are helpful.")
118
+ output = await agent.arun("Hello!")
119
+ print(output.content)
120
+
121
+ asyncio.run(main())
122
+ ```
123
+
124
+ ## Model Selection
125
+
126
+ agentic uses [litellm](https://github.com/BerriAI/litellm) under the hood, supporting 100+ LLM providers:
127
+
128
+ ```python
129
+ # OpenAI
130
+ agent = Agent(model="gpt-4o")
131
+
132
+ # Anthropic
133
+ agent = Agent(model="claude-3-opus-20240229")
134
+
135
+ # Azure OpenAI
136
+ agent = Agent(model="azure/my-deployment")
137
+
138
+ # Local models (Ollama)
139
+ agent = Agent(model="ollama/llama2")
140
+ ```
141
+
142
+ Set up API keys via environment variables:
143
+ ```bash
144
+ export OPENAI_API_KEY="sk-..."
145
+ export ANTHROPIC_API_KEY="sk-ant-..."
146
+ ```
147
+
148
+ ## Core Concepts
149
+
150
+ ### Agent
151
+
152
+ An `Agent` wraps an LLM with a system prompt. It provides a simple `run()` method that handles message formatting, LLM calls, and response parsing.
153
+
154
+ ### AgentOutput
155
+
156
+ The result of `agent.run()`. Contains:
157
+ - `content`: The LLM's response text
158
+ - `status`: Execution status (COMPLETED, FAILED, etc.)
159
+ - `messages`: All messages exchanged
160
+ - `usage`: Token usage statistics
161
+ - Timing information (`started_at`, `completed_at`)
162
+
163
+ ### AgentSession
164
+
165
+ Container for conversation history. Pass a session to `run()` to include previous messages in the context.
166
+
167
+ ### ExecutionContext
168
+
169
+ Runtime context carrying `execution_id`, `session_id`, and custom metadata. Created automatically or can be provided explicitly.
170
+
171
+ See [docs/CONCEPTS.md](docs/CONCEPTS.md) for detailed documentation.
172
+
173
+ ## Project Structure
174
+
175
+ ```
176
+ agentic/src/agentic/
177
+ ├── agent/ # Agent implementation
178
+ │ ├── agent.py # Agent class
179
+ │ ├── output.py # AgentOutput dataclass
180
+ │ └── session.py # AgentSession for history
181
+ ├── orchestration/ # Multi-agent coordination (sequential, supervisor, router, parallel)
182
+ ├── workflow/ # Pipeline execution (blocks, conditions, sandboxed functions)
183
+ └── execution/ # Shared infrastructure
184
+ ├── context.py # ExecutionContext
185
+ ├── status.py # ExecutionStatus enum
186
+ └── base.py # BaseOutput class
187
+ ```
188
+
189
+ ## Development
190
+
191
+ ```bash
192
+ # Install with dev dependencies
193
+ pip install -e ".[dev]"
194
+
195
+ # Run tests
196
+ pytest
197
+
198
+ # Type checking
199
+ mypy src/agentic
200
+ ```
201
+
202
+ ## License
203
+
204
+ Apache-2.0 — see [LICENSE](LICENSE).
205
+
206
+ ## Contributing
207
+
208
+ Contributions are welcome! Please read our contributing guidelines and submit a pull request.
209
+
@@ -0,0 +1,176 @@
1
+ # agentic
2
+
3
+ The agent/knowledge/orchestration/workflow engine that powers the Powabase stack — a well-documented Python library you can also import on its own.
4
+
5
+ ## Features
6
+
7
+ - **Agent**: Single LLM-powered agent with a clean run() interface
8
+ - **Session Management**: Built-in conversation history tracking
9
+ - **Multi-Model Support**: Uses [litellm](https://github.com/BerriAI/litellm) for 100+ LLM providers
10
+ - **Type-Safe**: Full type hints and dataclass-based outputs
11
+ - **Orchestration**: Multi-agent coordination (sequential, supervisor, router, parallel)
12
+ - **Workflow**: Multi-step pipelines with conditional logic, loops, and a sandboxed code-execution block
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ # Using pip
18
+ pip install agentic
19
+
20
+ # Using uv
21
+ uv add agentic
22
+
23
+ # From source
24
+ git clone https://github.com/your-org/agentic.git
25
+ cd agentic
26
+ pip install -e .
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ```python
32
+ from agentic import Agent
33
+
34
+ # Create an agent
35
+ agent = Agent(
36
+ model="gpt-4o-mini",
37
+ system_prompt="You are a helpful assistant.",
38
+ )
39
+
40
+ # Run the agent
41
+ output = agent.run("What is 2+2?")
42
+ print(output.content) # "2 + 2 equals 4."
43
+
44
+ # Check execution details
45
+ print(output.status) # ExecutionStatus.COMPLETED
46
+ print(output.usage) # {"prompt_tokens": 15, "completion_tokens": 8, ...}
47
+ ```
48
+
49
+ ## Multi-Turn Conversations
50
+
51
+ Use `AgentSession` to maintain conversation history:
52
+
53
+ ```python
54
+ from agentic import Agent, AgentSession
55
+
56
+ agent = Agent(
57
+ model="gpt-4o-mini",
58
+ system_prompt="You are a helpful assistant.",
59
+ )
60
+
61
+ # Create a session
62
+ session = AgentSession()
63
+
64
+ # First turn
65
+ output1 = agent.run("My name is Alice", session=session)
66
+ session.add_output(output1)
67
+
68
+ # Second turn - agent remembers the name
69
+ output2 = agent.run("What's my name?", session=session)
70
+ session.add_output(output2)
71
+ print(output2.content) # "Your name is Alice."
72
+
73
+ # Get conversation history
74
+ messages = session.get_messages()
75
+ ```
76
+
77
+ ## Async Support
78
+
79
+ ```python
80
+ import asyncio
81
+ from agentic import Agent
82
+
83
+ async def main():
84
+ agent = Agent(model="gpt-4o-mini", system_prompt="You are helpful.")
85
+ output = await agent.arun("Hello!")
86
+ print(output.content)
87
+
88
+ asyncio.run(main())
89
+ ```
90
+
91
+ ## Model Selection
92
+
93
+ agentic uses [litellm](https://github.com/BerriAI/litellm) under the hood, supporting 100+ LLM providers:
94
+
95
+ ```python
96
+ # OpenAI
97
+ agent = Agent(model="gpt-4o")
98
+
99
+ # Anthropic
100
+ agent = Agent(model="claude-3-opus-20240229")
101
+
102
+ # Azure OpenAI
103
+ agent = Agent(model="azure/my-deployment")
104
+
105
+ # Local models (Ollama)
106
+ agent = Agent(model="ollama/llama2")
107
+ ```
108
+
109
+ Set up API keys via environment variables:
110
+ ```bash
111
+ export OPENAI_API_KEY="sk-..."
112
+ export ANTHROPIC_API_KEY="sk-ant-..."
113
+ ```
114
+
115
+ ## Core Concepts
116
+
117
+ ### Agent
118
+
119
+ An `Agent` wraps an LLM with a system prompt. It provides a simple `run()` method that handles message formatting, LLM calls, and response parsing.
120
+
121
+ ### AgentOutput
122
+
123
+ The result of `agent.run()`. Contains:
124
+ - `content`: The LLM's response text
125
+ - `status`: Execution status (COMPLETED, FAILED, etc.)
126
+ - `messages`: All messages exchanged
127
+ - `usage`: Token usage statistics
128
+ - Timing information (`started_at`, `completed_at`)
129
+
130
+ ### AgentSession
131
+
132
+ Container for conversation history. Pass a session to `run()` to include previous messages in the context.
133
+
134
+ ### ExecutionContext
135
+
136
+ Runtime context carrying `execution_id`, `session_id`, and custom metadata. Created automatically or can be provided explicitly.
137
+
138
+ See [docs/CONCEPTS.md](docs/CONCEPTS.md) for detailed documentation.
139
+
140
+ ## Project Structure
141
+
142
+ ```
143
+ agentic/src/agentic/
144
+ ├── agent/ # Agent implementation
145
+ │ ├── agent.py # Agent class
146
+ │ ├── output.py # AgentOutput dataclass
147
+ │ └── session.py # AgentSession for history
148
+ ├── orchestration/ # Multi-agent coordination (sequential, supervisor, router, parallel)
149
+ ├── workflow/ # Pipeline execution (blocks, conditions, sandboxed functions)
150
+ └── execution/ # Shared infrastructure
151
+ ├── context.py # ExecutionContext
152
+ ├── status.py # ExecutionStatus enum
153
+ └── base.py # BaseOutput class
154
+ ```
155
+
156
+ ## Development
157
+
158
+ ```bash
159
+ # Install with dev dependencies
160
+ pip install -e ".[dev]"
161
+
162
+ # Run tests
163
+ pytest
164
+
165
+ # Type checking
166
+ mypy src/agentic
167
+ ```
168
+
169
+ ## License
170
+
171
+ Apache-2.0 — see [LICENSE](LICENSE).
172
+
173
+ ## Contributing
174
+
175
+ Contributions are welcome! Please read our contributing guidelines and submit a pull request.
176
+