marmo-core 0.4.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 (168) hide show
  1. marmo_core-0.4.0/.dockerignore +22 -0
  2. marmo_core-0.4.0/.env.example +15 -0
  3. marmo_core-0.4.0/CHANGELOG.md +34 -0
  4. marmo_core-0.4.0/CONTRIBUTING.md +91 -0
  5. marmo_core-0.4.0/Dockerfile +21 -0
  6. marmo_core-0.4.0/LICENSE +201 -0
  7. marmo_core-0.4.0/MANIFEST.in +20 -0
  8. marmo_core-0.4.0/PKG-INFO +162 -0
  9. marmo_core-0.4.0/README.md +127 -0
  10. marmo_core-0.4.0/SECURITY.md +52 -0
  11. marmo_core-0.4.0/benchmarks/README.md +316 -0
  12. marmo_core-0.4.0/benchmarks/_provenance.py +57 -0
  13. marmo_core-0.4.0/benchmarks/corpus/set_corpus.json +1570 -0
  14. marmo_core-0.4.0/benchmarks/generate_scale_corpus.py +251 -0
  15. marmo_core-0.4.0/benchmarks/generate_set_corpus.py +345 -0
  16. marmo_core-0.4.0/benchmarks/results/adaptive-cache-hybrid-model.json +258 -0
  17. marmo_core-0.4.0/benchmarks/results/adaptive-cache-lexical.json +258 -0
  18. marmo_core-0.4.0/benchmarks/results/adaptive-drift.json +107 -0
  19. marmo_core-0.4.0/benchmarks/results/adaptive-feedback.json +121 -0
  20. marmo_core-0.4.0/benchmarks/results/adaptive-threshold-sweep.json +2275 -0
  21. marmo_core-0.4.0/benchmarks/results/hybrid-hash.json +541 -0
  22. marmo_core-0.4.0/benchmarks/results/hybrid-model.json +337 -0
  23. marmo_core-0.4.0/benchmarks/results/latest.json +522 -0
  24. marmo_core-0.4.0/benchmarks/results/scale-routing-10000.json +3278 -0
  25. marmo_core-0.4.0/benchmarks/results/scale-routing-100000.json +960 -0
  26. marmo_core-0.4.0/benchmarks/results/set-selection-distractors.json +1095 -0
  27. marmo_core-0.4.0/benchmarks/results/set-selection-graph-distractors.json +1059 -0
  28. marmo_core-0.4.0/benchmarks/results/set-selection-graph-hybrid.json +850 -0
  29. marmo_core-0.4.0/benchmarks/results/set-selection-graph-lexical.json +932 -0
  30. marmo_core-0.4.0/benchmarks/results/set-selection-hybrid.json +1165 -0
  31. marmo_core-0.4.0/benchmarks/results/set-selection-lexical.json +1361 -0
  32. marmo_core-0.4.0/benchmarks/results/set-selection-policy-hybrid.json +3580 -0
  33. marmo_core-0.4.0/benchmarks/results/set-selection-policy-lexical.json +3927 -0
  34. marmo_core-0.4.0/benchmarks/run_adaptive_benchmark.py +760 -0
  35. marmo_core-0.4.0/benchmarks/run_benchmark.py +356 -0
  36. marmo_core-0.4.0/benchmarks/run_scale_benchmark.py +318 -0
  37. marmo_core-0.4.0/benchmarks/run_set_benchmark.py +499 -0
  38. marmo_core-0.4.0/benchmarks/scale_scenarios.json +122 -0
  39. marmo_core-0.4.0/benchmarks/scenarios.json +125 -0
  40. marmo_core-0.4.0/benchmarks/set_scenarios.json +376 -0
  41. marmo_core-0.4.0/compose.yaml +5 -0
  42. marmo_core-0.4.0/docs/connectors.md +138 -0
  43. marmo_core-0.4.0/docs/local-resource-packages.md +158 -0
  44. marmo_core-0.4.0/docs/threat-model.md +75 -0
  45. marmo_core-0.4.0/examples/agent_delegation.py +94 -0
  46. marmo_core-0.4.0/examples/hello_world.py +89 -0
  47. marmo_core-0.4.0/examples/human_in_the_loop.py +106 -0
  48. marmo_core-0.4.0/examples/package-template/marmo-package.json +12 -0
  49. marmo_core-0.4.0/examples/package-template/marmo-package.lock.json +12 -0
  50. marmo_core-0.4.0/examples/package-template/resources.json +91 -0
  51. marmo_core-0.4.0/examples/planned_execution.py +124 -0
  52. marmo_core-0.4.0/examples/recovery_fallback.py +123 -0
  53. marmo_core-0.4.0/examples/resources/core_resources.json +253 -0
  54. marmo_core-0.4.0/examples/search_scenarios.json +24 -0
  55. marmo_core-0.4.0/marmo_core/__init__.py +361 -0
  56. marmo_core-0.4.0/marmo_core/_version.py +3 -0
  57. marmo_core-0.4.0/marmo_core/activator.py +247 -0
  58. marmo_core-0.4.0/marmo_core/adaptive.py +542 -0
  59. marmo_core-0.4.0/marmo_core/agent_runtime.py +206 -0
  60. marmo_core-0.4.0/marmo_core/audit.py +236 -0
  61. marmo_core-0.4.0/marmo_core/cli.py +875 -0
  62. marmo_core-0.4.0/marmo_core/compiler.py +604 -0
  63. marmo_core-0.4.0/marmo_core/connectors.py +865 -0
  64. marmo_core-0.4.0/marmo_core/environment.py +45 -0
  65. marmo_core-0.4.0/marmo_core/errors.py +51 -0
  66. marmo_core-0.4.0/marmo_core/evaluator.py +262 -0
  67. marmo_core-0.4.0/marmo_core/formatting.py +136 -0
  68. marmo_core-0.4.0/marmo_core/graph_routing.py +301 -0
  69. marmo_core-0.4.0/marmo_core/hierarchy.py +409 -0
  70. marmo_core-0.4.0/marmo_core/hitl.py +353 -0
  71. marmo_core-0.4.0/marmo_core/kernel.py +1892 -0
  72. marmo_core-0.4.0/marmo_core/llm.py +197 -0
  73. marmo_core-0.4.0/marmo_core/llm_routing.py +386 -0
  74. marmo_core-0.4.0/marmo_core/loader.py +311 -0
  75. marmo_core-0.4.0/marmo_core/markdown_skill.py +238 -0
  76. marmo_core-0.4.0/marmo_core/mcp.py +360 -0
  77. marmo_core-0.4.0/marmo_core/models.py +463 -0
  78. marmo_core-0.4.0/marmo_core/package.py +560 -0
  79. marmo_core-0.4.0/marmo_core/planner.py +512 -0
  80. marmo_core-0.4.0/marmo_core/policy.py +310 -0
  81. marmo_core-0.4.0/marmo_core/providers.py +289 -0
  82. marmo_core-0.4.0/marmo_core/py.typed +1 -0
  83. marmo_core-0.4.0/marmo_core/recovery.py +331 -0
  84. marmo_core-0.4.0/marmo_core/registry.py +181 -0
  85. marmo_core-0.4.0/marmo_core/rerank.py +156 -0
  86. marmo_core-0.4.0/marmo_core/retriever.py +485 -0
  87. marmo_core-0.4.0/marmo_core/safety.py +263 -0
  88. marmo_core-0.4.0/marmo_core/sample_resources/__init__.py +1 -0
  89. marmo_core-0.4.0/marmo_core/sample_resources/agents.py +255 -0
  90. marmo_core-0.4.0/marmo_core/sample_resources/tools.py +341 -0
  91. marmo_core-0.4.0/marmo_core/secrets.py +259 -0
  92. marmo_core-0.4.0/marmo_core/security.py +124 -0
  93. marmo_core-0.4.0/marmo_core/selector.py +578 -0
  94. marmo_core-0.4.0/marmo_core/semantic.py +235 -0
  95. marmo_core-0.4.0/marmo_core/state.py +658 -0
  96. marmo_core-0.4.0/marmo_core/tool_runtime.py +255 -0
  97. marmo_core-0.4.0/marmo_core.egg-info/PKG-INFO +162 -0
  98. marmo_core-0.4.0/marmo_core.egg-info/SOURCES.txt +166 -0
  99. marmo_core-0.4.0/marmo_core.egg-info/dependency_links.txt +1 -0
  100. marmo_core-0.4.0/marmo_core.egg-info/entry_points.txt +3 -0
  101. marmo_core-0.4.0/marmo_core.egg-info/requires.txt +13 -0
  102. marmo_core-0.4.0/marmo_core.egg-info/top_level.txt +1 -0
  103. marmo_core-0.4.0/pyproject.toml +71 -0
  104. marmo_core-0.4.0/resources/agents/api-designer.json +15 -0
  105. marmo_core-0.4.0/resources/agents/code-reviewer.json +15 -0
  106. marmo_core-0.4.0/resources/agents/data-analyst.json +15 -0
  107. marmo_core-0.4.0/resources/agents/docs-writer.json +15 -0
  108. marmo_core-0.4.0/resources/agents/incident-triager.json +15 -0
  109. marmo_core-0.4.0/resources/agents/release-manager.json +15 -0
  110. marmo_core-0.4.0/resources/agents/research-assistant.json +15 -0
  111. marmo_core-0.4.0/resources/agents/security-reviewer.json +15 -0
  112. marmo_core-0.4.0/resources/agents/support-specialist.json +15 -0
  113. marmo_core-0.4.0/resources/agents/test-planner.json +15 -0
  114. marmo_core-0.4.0/resources/memory/api-design.json +20 -0
  115. marmo_core-0.4.0/resources/memory/architecture-decisions.json +20 -0
  116. marmo_core-0.4.0/resources/memory/data-retention.json +20 -0
  117. marmo_core-0.4.0/resources/memory/domain-glossary.json +20 -0
  118. marmo_core-0.4.0/resources/memory/incident-response.json +20 -0
  119. marmo_core-0.4.0/resources/memory/project-conventions.json +20 -0
  120. marmo_core-0.4.0/resources/memory/release-checklist.json +20 -0
  121. marmo_core-0.4.0/resources/memory/security-baseline.json +20 -0
  122. marmo_core-0.4.0/resources/memory/support-tone.json +20 -0
  123. marmo_core-0.4.0/resources/memory/testing-strategy.json +20 -0
  124. marmo_core-0.4.0/resources/tools/create-archive.json +10 -0
  125. marmo_core-0.4.0/resources/tools/format-code.json +10 -0
  126. marmo_core-0.4.0/resources/tools/http-get.json +10 -0
  127. marmo_core-0.4.0/resources/tools/list-files.json +10 -0
  128. marmo_core-0.4.0/resources/tools/read-text.json +10 -0
  129. marmo_core-0.4.0/resources/tools/run-tests.json +10 -0
  130. marmo_core-0.4.0/resources/tools/search-text.json +10 -0
  131. marmo_core-0.4.0/resources/tools/send-notification.json +10 -0
  132. marmo_core-0.4.0/resources/tools/validate-json.json +10 -0
  133. marmo_core-0.4.0/resources/tools/write-text.json +10 -0
  134. marmo_core-0.4.0/scripts/release_check.py +36 -0
  135. marmo_core-0.4.0/setup.cfg +4 -0
  136. marmo_core-0.4.0/tests/fake_mcp_server.py +69 -0
  137. marmo_core-0.4.0/tests/fixtures/compat/v0.3.0/public_api.txt +168 -0
  138. marmo_core-0.4.0/tests/fixtures/compat/v0.3.0/resource.json +32 -0
  139. marmo_core-0.4.0/tests/fixtures/compat/v0.3.0/state.jsonl +4 -0
  140. marmo_core-0.4.0/tests/test_adaptive.py +498 -0
  141. marmo_core-0.4.0/tests/test_agent_runtime.py +445 -0
  142. marmo_core-0.4.0/tests/test_cli_release.py +129 -0
  143. marmo_core-0.4.0/tests/test_compatibility.py +77 -0
  144. marmo_core-0.4.0/tests/test_compiler.py +300 -0
  145. marmo_core-0.4.0/tests/test_connectors.py +491 -0
  146. marmo_core-0.4.0/tests/test_executable_resource_samples.py +230 -0
  147. marmo_core-0.4.0/tests/test_formatting.py +86 -0
  148. marmo_core-0.4.0/tests/test_graph_routing.py +173 -0
  149. marmo_core-0.4.0/tests/test_hierarchy.py +215 -0
  150. marmo_core-0.4.0/tests/test_kernel.py +578 -0
  151. marmo_core-0.4.0/tests/test_llm_routing.py +277 -0
  152. marmo_core-0.4.0/tests/test_package.py +295 -0
  153. marmo_core-0.4.0/tests/test_planner.py +633 -0
  154. marmo_core-0.4.0/tests/test_policy_audit.py +199 -0
  155. marmo_core-0.4.0/tests/test_recovery.py +642 -0
  156. marmo_core-0.4.0/tests/test_release_readiness.py +29 -0
  157. marmo_core-0.4.0/tests/test_rerank.py +154 -0
  158. marmo_core-0.4.0/tests/test_resource_samples.py +39 -0
  159. marmo_core-0.4.0/tests/test_safety.py +344 -0
  160. marmo_core-0.4.0/tests/test_secrets.py +274 -0
  161. marmo_core-0.4.0/tests/test_security_boundaries.py +179 -0
  162. marmo_core-0.4.0/tests/test_set_selection.py +258 -0
  163. marmo_core-0.4.0/tests/test_state_hitl.py +664 -0
  164. marmo_core-0.4.0/tests/test_v03.py +409 -0
  165. marmo_core-0.4.0/tests/test_v1.py +284 -0
  166. marmo_core-0.4.0/tests/test_v2_examples.py +45 -0
  167. marmo_core-0.4.0/tools/collect_skills.py +389 -0
  168. marmo_core-0.4.0/tools/make_url_list.py +65 -0
@@ -0,0 +1,22 @@
1
+ .git
2
+ .agents
3
+ .codex
4
+ /resources/*
5
+ !/resources/memory/
6
+ !/resources/memory/**
7
+ !/resources/agents/
8
+ !/resources/agents/**
9
+ !/resources/tools/
10
+ !/resources/tools/**
11
+ __pycache__/
12
+ *.py[cod]
13
+ *.egg-info/
14
+ .pytest_cache/
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+ .coverage
18
+ htmlcov/
19
+ *.md
20
+ !README.md
21
+ # Required by scripts/release_check.py, which the test suite runs.
22
+ !CHANGELOG.md
@@ -0,0 +1,15 @@
1
+ # Local API credentials. Values set in the operating-system environment take
2
+ # precedence over this file.
3
+ OPENAI_API_KEY=
4
+ ANTHROPIC_API_KEY=
5
+
6
+ # Runtime model selection.
7
+ OPENAI_MODEL=gpt-5.6-terra
8
+ OPENAI_REASONING_EFFORT=none
9
+ ANTHROPIC_MODEL=claude-sonnet-5
10
+ ANTHROPIC_MAX_TOKENS=16384
11
+ OPENAI_EMBEDDING_MODEL=text-embedding-3-small
12
+
13
+ # Optional model-backed benchmark selection.
14
+ BENCHMARK_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
15
+ BENCHMARK_CROSS_ENCODER_MODEL=Xenova/ms-marco-MiniLM-L-6-v2
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.4.0] - 2026-08-16
11
+
12
+ First release published to PyPI.
13
+
14
+ ### Added
15
+
16
+ - Unified resource model covering Memory, Tool, and Agent resources, with a
17
+ registry, retriever, reranker, and selector for task-driven activation.
18
+ - `marmo` / `marmo-core` CLI with `validate`, `list`, `search`, and `run`
19
+ commands, including `--strict` runs for automation and release gates.
20
+ - Guarded execution: permission declarations, exact side-effect allowlists
21
+ (`--allow-side-effect`), policy evaluation, audit logging, secret handling,
22
+ and human-in-the-loop approval.
23
+ - Built-in connectors and MCP support, plus an executable tool and agent
24
+ runtime backed by `python:` refs.
25
+ - Thirty bundled resource samples (ten each for Memory, Tool, and Agent) that
26
+ run against the standard library without manual binding.
27
+ - Provider configuration read from `.env` (`OPENAI_MODEL`, `ANTHROPIC_MODEL`,
28
+ `OPENAI_EMBEDDING_MODEL`, and related settings) instead of hard-coded
29
+ defaults.
30
+ - Typed distribution (`py.typed`) and an optional `benchmark` extra for the
31
+ embedding and cross-encoder integration.
32
+
33
+ [Unreleased]: https://github.com/kota-kawa/Marmo-Core/compare/v0.4.0...HEAD
34
+ [0.4.0]: https://github.com/kota-kawa/Marmo-Core/releases/tag/v0.4.0
@@ -0,0 +1,91 @@
1
+ # Contributing to Marmo-Core
2
+
3
+ ## Setup
4
+
5
+ Marmo-Core supports Python 3.10 through 3.14 and keeps its runtime dependency
6
+ surface minimal — `python-dotenv` is the only required dependency. Please do
7
+ not add a runtime dependency without discussing it in an issue first; the dev
8
+ and benchmark extras are the place for anything that is not needed at runtime.
9
+
10
+ ```bash
11
+ python -m pip install -e '.[dev]'
12
+ ```
13
+
14
+ ## Tests
15
+
16
+ ```bash
17
+ python -W error::ResourceWarning -m unittest discover -s tests
18
+ ```
19
+
20
+ `-W error::ResourceWarning` is not optional: CI runs it this way, so an
21
+ unclosed file or socket in a test fails the build even when the assertions
22
+ pass.
23
+
24
+ ## Reproducing CI locally
25
+
26
+ CI runs the test suite on every supported Python version, plus the static and
27
+ release checks below. Run these before opening a pull request:
28
+
29
+ ```bash
30
+ ruff check marmo_core tests scripts tools
31
+ mypy marmo_core
32
+ python scripts/release_check.py
33
+ check-manifest
34
+ python -m build
35
+ python -m twine check dist/*
36
+ check-wheel-contents dist/*.whl
37
+ ```
38
+
39
+ If `check-manifest` reports a mismatch after you add a file, either add the
40
+ matching rule to `MANIFEST.in` (to ship it in the sdist) or list the file under
41
+ `[tool.check-manifest] ignore` in `pyproject.toml` (to keep it repository-only).
42
+
43
+ A Docker job also builds the image and runs the suite inside it:
44
+
45
+ ```bash
46
+ docker build --tag marmo-core:ci .
47
+ docker run --rm marmo-core:ci python -m unittest discover -s tests
48
+ ```
49
+
50
+ ## Resource samples
51
+
52
+ The bundled samples under `resources/memory`, `resources/tools`, and
53
+ `resources/agents` are executable and covered by tests. A new sample must
54
+ resolve a working implementation through its `python:` ref, declare the
55
+ permissions and side effects it actually needs, and stay within the current
56
+ working directory for filesystem access. Validate a change with:
57
+
58
+ ```bash
59
+ marmo validate resources/memory resources/tools resources/agents
60
+ ```
61
+
62
+ ## Security-relevant changes
63
+
64
+ Changes to permissions, side-effect classification, policy evaluation, secret
65
+ handling, or the human-in-the-loop gates should be reviewed against
66
+ [docs/threat-model.md](docs/threat-model.md), and should update that document
67
+ when they move a trust boundary. See [SECURITY.md](SECURITY.md) for reporting a
68
+ vulnerability rather than opening a pull request for it.
69
+
70
+ ## Releasing
71
+
72
+ Releases are published to PyPI by `.github/workflows/release.yml` through
73
+ Trusted Publishing. The workflow refuses to publish when the tag and the
74
+ packaged version disagree.
75
+
76
+ 1. Update the version in **both** `marmo_core/_version.py` and
77
+ `pyproject.toml` — `scripts/release_check.py` fails if they diverge.
78
+ 2. Add a `## [x.y.z] - YYYY-MM-DD` section to `CHANGELOG.md` and update the
79
+ comparison links at the bottom of the file. `release_check.py` fails if the
80
+ new version has no dated section.
81
+ 3. Run the checks above, then commit and merge to `main`.
82
+ 4. Optionally run the `Release` workflow manually (`workflow_dispatch`) to
83
+ publish to TestPyPI first and verify the rendered project page.
84
+ 5. Tag and push:
85
+
86
+ ```bash
87
+ git tag v0.4.0
88
+ git push origin v0.4.0
89
+ ```
90
+
91
+ The `pypi` environment requires an approval before the upload step runs.
@@ -0,0 +1,21 @@
1
+ # syntax=docker/dockerfile:1
2
+ FROM python:3.14-slim
3
+
4
+ WORKDIR /app
5
+
6
+ COPY README.md CHANGELOG.md LICENSE pyproject.toml ./
7
+ COPY marmo_core ./marmo_core
8
+ RUN python3 -m pip install --no-cache-dir .
9
+
10
+ COPY examples ./examples
11
+ COPY resources ./resources
12
+ COPY scripts ./scripts
13
+ COPY tests ./tests
14
+
15
+ ENV PYTHONDONTWRITEBYTECODE=1 \
16
+ PYTHONUNBUFFERED=1
17
+
18
+ RUN useradd --create-home --uid 10001 marmo
19
+ USER marmo
20
+
21
+ CMD ["python3", "examples/hello_world.py"]
@@ -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. Do not 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 [yyyy] [name of copyright owner]
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,20 @@
1
+ include CHANGELOG.md
2
+ include CONTRIBUTING.md
3
+ include SECURITY.md
4
+ include .env.example
5
+ include .dockerignore
6
+ include Dockerfile
7
+ include compose.yaml
8
+ recursive-include docs *.md
9
+ recursive-include examples *.json *.py
10
+ recursive-include resources/memory *.json
11
+ recursive-include resources/agents *.json
12
+ recursive-include resources/tools *.json
13
+ include benchmarks/*.json
14
+ include benchmarks/*.md
15
+ include benchmarks/*.py
16
+ include benchmarks/corpus/set_corpus.json
17
+ recursive-include benchmarks/results *.json
18
+ include scripts/release_check.py
19
+ recursive-include tests *.json *.jsonl *.py *.txt
20
+ recursive-include tools *.py
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: marmo-core
3
+ Version: 0.4.0
4
+ Summary: Lightweight AI Agent Kernel primitives: resource registry, search CLI, and guarded execution.
5
+ Author: Marmo-Core Contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://project-kk.com/en/marmo
8
+ Project-URL: Repository, https://github.com/kota-kawa/Marmo-Core
9
+ Project-URL: Issues, https://github.com/kota-kawa/Marmo-Core/issues
10
+ Keywords: ai-agent,kernel,resource-registry,retrieval,cli
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: python-dotenv<2,>=1.0
24
+ Provides-Extra: benchmark
25
+ Requires-Dist: fastembed>=0.8.0; extra == "benchmark"
26
+ Provides-Extra: dev
27
+ Requires-Dist: build>=1.2; extra == "dev"
28
+ Requires-Dist: check-manifest>=0.51; extra == "dev"
29
+ Requires-Dist: check-wheel-contents>=0.6; extra == "dev"
30
+ Requires-Dist: coverage>=7.6; extra == "dev"
31
+ Requires-Dist: mypy>=1.11; extra == "dev"
32
+ Requires-Dist: ruff>=0.8; extra == "dev"
33
+ Requires-Dist: twine>=6.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # Marmo-Core
37
+
38
+ [![PyPI](https://img.shields.io/pypi/v/marmo-core.svg)](https://pypi.org/project/marmo-core/)
39
+ [![Python versions](https://img.shields.io/pypi/pyversions/marmo-core.svg)](https://pypi.org/project/marmo-core/)
40
+ [![CI](https://github.com/kota-kawa/Marmo-Core/actions/workflows/ci.yml/badge.svg)](https://github.com/kota-kawa/Marmo-Core/actions/workflows/ci.yml)
41
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
42
+
43
+ Marmo-Core is a lightweight Python kernel for registering, retrieving,
44
+ selecting, and safely executing AI-agent resources.
45
+
46
+ ## Requirements
47
+
48
+ - Python 3.10 or newer
49
+
50
+ Install the published package with:
51
+
52
+ ```bash
53
+ python -m pip install marmo-core
54
+ ```
55
+
56
+ For local development, install the checkout with:
57
+
58
+ ```bash
59
+ python -m pip install -e '.[dev]'
60
+ ```
61
+
62
+ Validate and inspect the bundled resource examples with:
63
+
64
+ ```bash
65
+ marmo validate examples/resources
66
+ marmo search examples/resources --task "read a local text file safely"
67
+ ```
68
+
69
+ The `resources` directory also includes ten standalone samples for each of
70
+ Memory, Tool, and Agent. Every Tool and Agent sample resolves an executable
71
+ standard-library implementation through its `python:` ref, so no manual
72
+ binding is needed. Filesystem samples are confined to the current working
73
+ directory. External samples still require the declared permissions and human
74
+ approval; notification webhooks are configured through
75
+ `MARMO_NOTIFICATION_<DESTINATION>_URL` rather than model-visible arguments.
76
+ The `format-code` sample invokes Ruff and therefore requires the `.[dev]`
77
+ extra.
78
+
79
+ ```bash
80
+ marmo validate resources/memory resources/tools resources/agents
81
+ marmo list resources/memory resources/tools resources/agents
82
+ ```
83
+
84
+ Run the offline JSON validation Tool end to end with the mock LLM:
85
+
86
+ ```bash
87
+ marmo run resources/tools/validate-json.json \
88
+ --task "validate JSON input" \
89
+ --tool-args '{"tool.marmo.samples.validate-json":{"value":{"name":"Marmo"},"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}' \
90
+ --strict --format json
91
+ ```
92
+
93
+ Agent samples are also directly executable:
94
+
95
+ ```bash
96
+ marmo run resources/agents/security-reviewer.json \
97
+ --task "review webhook security" \
98
+ --tool-args '{"agent.marmo.samples.security-reviewer":{"goal":"Review webhook security","context":"external upload"}}' \
99
+ --format json
100
+ ```
101
+
102
+ ## API and model configuration
103
+
104
+ Create a `.env` file and set the relevant key when using an OpenAI-compatible
105
+ LLM, Anthropic LLM, or embedding provider. Model names and model-specific
106
+ runtime settings are also read from `.env` rather than being hard-coded by
107
+ the providers. In a source checkout, `.env.example` can be copied as a
108
+ starting point:
109
+
110
+ ```bash
111
+ cp .env.example .env
112
+ ```
113
+
114
+ ```dotenv
115
+ OPENAI_API_KEY=your_key_here
116
+ ANTHROPIC_API_KEY=your_key_here
117
+ OPENAI_MODEL=gpt-5.6-terra
118
+ OPENAI_REASONING_EFFORT=none
119
+ ANTHROPIC_MODEL=claude-sonnet-5
120
+ ANTHROPIC_MAX_TOKENS=16384
121
+ OPENAI_EMBEDDING_MODEL=text-embedding-3-small
122
+ ```
123
+
124
+ `OPENAI_MODEL`, `ANTHROPIC_MODEL`, and `OPENAI_EMBEDDING_MODEL` are required
125
+ when the corresponding provider is constructed without an explicit `model`
126
+ argument. `ANTHROPIC_MAX_TOKENS` is required unless `max_tokens` is passed
127
+ explicitly. `OPENAI_REASONING_EFFORT` is optional and applies when the OpenAI
128
+ model is resolved from the environment. The package loads `.env` without
129
+ overriding values already present in the operating-system environment. `.env`
130
+ is excluded from Git.
131
+
132
+ The benchmark-only embedding and cross-encoder integration is optional:
133
+
134
+ ```bash
135
+ python -m pip install '.[benchmark]'
136
+ ```
137
+
138
+ Run the test suite with:
139
+
140
+ ```bash
141
+ python -W error::ResourceWarning -m unittest discover -s tests
142
+ ```
143
+
144
+ ## Strict CLI runs
145
+
146
+ The kernel normally allows a task to recover after a resource is denied or
147
+ cannot be activated. For automation and release checks, pass `--strict` so a
148
+ skipped resource or a tool named in `--tool-args` that was not evaluated makes
149
+ the command exit non-zero.
150
+
151
+ CLI commands auto-discover `resources`, `skills`, or `examples/resources` from
152
+ the current directory when no resource path is provided. Connector-only runs
153
+ should pass `--no-default-resources` to make their behavior independent of the
154
+ working directory.
155
+
156
+ `--allow-side-effect` is an exact, repeatable allowlist. For example, allowing
157
+ both side-effect-free resources and read operations requires
158
+ `--allow-side-effect none --allow-side-effect read`.
159
+
160
+ See [Built-in Connectors](docs/connectors.md) and
161
+ [Local Resource Packages](docs/local-resource-packages.md) for complete usage
162
+ examples.