plasticity-agent 0.2.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.
- plasticity_agent-0.2.0/.gitignore +58 -0
- plasticity_agent-0.2.0/CHANGELOG.md +53 -0
- plasticity_agent-0.2.0/LICENSE +21 -0
- plasticity_agent-0.2.0/PKG-INFO +591 -0
- plasticity_agent-0.2.0/README.md +546 -0
- plasticity_agent-0.2.0/docs/api.md +119 -0
- plasticity_agent-0.2.0/docs/concepts.md +55 -0
- plasticity_agent-0.2.0/docs/index.md +68 -0
- plasticity_agent-0.2.0/docs/llm.md +51 -0
- plasticity_agent-0.2.0/docs/memory.md +92 -0
- plasticity_agent-0.2.0/docs/metrics.md +52 -0
- plasticity_agent-0.2.0/docs/observability.md +33 -0
- plasticity_agent-0.2.0/docs/reasoning_market.md +75 -0
- plasticity_agent-0.2.0/docs/retrieval.md +59 -0
- plasticity_agent-0.2.0/docs/self_healing.md +88 -0
- plasticity_agent-0.2.0/docs/sleep_cycle.md +60 -0
- plasticity_agent-0.2.0/examples/basic_memory.py +40 -0
- plasticity_agent-0.2.0/examples/energy_report_demo.py +40 -0
- plasticity_agent-0.2.0/examples/improvement_metrics_demo.py +42 -0
- plasticity_agent-0.2.0/examples/llm_hooks_demo.py +49 -0
- plasticity_agent-0.2.0/examples/plastic_agent_quickstart.py +40 -0
- plasticity_agent-0.2.0/examples/reasoning_market_demo.py +35 -0
- plasticity_agent-0.2.0/examples/reflection_loop.py +37 -0
- plasticity_agent-0.2.0/examples/sandboxed_healing_demo.py +32 -0
- plasticity_agent-0.2.0/examples/self_healing_demo.py +34 -0
- plasticity_agent-0.2.0/examples/self_refine_demo.py +34 -0
- plasticity_agent-0.2.0/examples/sleep_cycle_demo.py +50 -0
- plasticity_agent-0.2.0/examples/vector_recall_demo.py +37 -0
- plasticity_agent-0.2.0/mkdocs.yml +42 -0
- plasticity_agent-0.2.0/plasticity_agent/__init__.py +139 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/__init__.py +17 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/crewai_adapter.py +38 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/generic.py +45 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/langgraph_adapter.py +39 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/openai_agents_adapter.py +38 -0
- plasticity_agent-0.2.0/plasticity_agent/adapters/pydantic_ai_adapter.py +38 -0
- plasticity_agent-0.2.0/plasticity_agent/cli.py +399 -0
- plasticity_agent-0.2.0/plasticity_agent/core/__init__.py +18 -0
- plasticity_agent-0.2.0/plasticity_agent/core/agent.py +365 -0
- plasticity_agent-0.2.0/plasticity_agent/core/config.py +63 -0
- plasticity_agent-0.2.0/plasticity_agent/core/events.py +62 -0
- plasticity_agent-0.2.0/plasticity_agent/core/runtime.py +108 -0
- plasticity_agent-0.2.0/plasticity_agent/core/trace.py +125 -0
- plasticity_agent-0.2.0/plasticity_agent/healing/__init__.py +22 -0
- plasticity_agent-0.2.0/plasticity_agent/healing/detector.py +38 -0
- plasticity_agent-0.2.0/plasticity_agent/healing/diagnosis.py +159 -0
- plasticity_agent-0.2.0/plasticity_agent/healing/repair.py +119 -0
- plasticity_agent-0.2.0/plasticity_agent/healing/sandbox.py +160 -0
- plasticity_agent-0.2.0/plasticity_agent/learning/__init__.py +21 -0
- plasticity_agent-0.2.0/plasticity_agent/learning/curriculum.py +60 -0
- plasticity_agent-0.2.0/plasticity_agent/learning/reward.py +46 -0
- plasticity_agent-0.2.0/plasticity_agent/learning/skill_library.py +222 -0
- plasticity_agent-0.2.0/plasticity_agent/llm/__init__.py +23 -0
- plasticity_agent-0.2.0/plasticity_agent/llm/client.py +145 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/__init__.py +37 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/consolidation.py +389 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/contradiction.py +181 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/embeddings.py +144 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/forgetting.py +87 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/memory_os.py +465 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/retrieval.py +149 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/salience.py +69 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/schemas.py +101 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/store.py +242 -0
- plasticity_agent-0.2.0/plasticity_agent/memory/vector_index.py +139 -0
- plasticity_agent-0.2.0/plasticity_agent/metrics/__init__.py +11 -0
- plasticity_agent-0.2.0/plasticity_agent/metrics/tracker.py +153 -0
- plasticity_agent-0.2.0/plasticity_agent/observability/__init__.py +7 -0
- plasticity_agent-0.2.0/plasticity_agent/observability/otel.py +53 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/__init__.py +37 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/auction.py +74 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/confidence.py +46 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/critic.py +55 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/critics.py +236 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/debate.py +89 -0
- plasticity_agent-0.2.0/plasticity_agent/reasoning/market.py +55 -0
- plasticity_agent-0.2.0/plasticity_agent/reflection/__init__.py +16 -0
- plasticity_agent-0.2.0/plasticity_agent/reflection/lessons.py +34 -0
- plasticity_agent-0.2.0/plasticity_agent/reflection/reflector.py +226 -0
- plasticity_agent-0.2.0/plasticity_agent/reflection/self_refine.py +137 -0
- plasticity_agent-0.2.0/plasticity_agent/server/__init__.py +12 -0
- plasticity_agent-0.2.0/plasticity_agent/server/api.py +129 -0
- plasticity_agent-0.2.0/plasticity_agent/server/dashboard.py +163 -0
- plasticity_agent-0.2.0/plasticity_agent/thermodynamics/__init__.py +26 -0
- plasticity_agent-0.2.0/plasticity_agent/thermodynamics/energy_report.py +123 -0
- plasticity_agent-0.2.0/plasticity_agent/thermodynamics/entropy.py +43 -0
- plasticity_agent-0.2.0/plasticity_agent/thermodynamics/free_energy.py +69 -0
- plasticity_agent-0.2.0/pyproject.toml +104 -0
- plasticity_agent-0.2.0/tests/conftest.py +33 -0
- plasticity_agent-0.2.0/tests/test_adapters.py +89 -0
- plasticity_agent-0.2.0/tests/test_agent.py +87 -0
- plasticity_agent-0.2.0/tests/test_cli.py +64 -0
- plasticity_agent-0.2.0/tests/test_concurrency.py +57 -0
- plasticity_agent-0.2.0/tests/test_consolidation.py +77 -0
- plasticity_agent-0.2.0/tests/test_contradiction.py +34 -0
- plasticity_agent-0.2.0/tests/test_energy_report.py +57 -0
- plasticity_agent-0.2.0/tests/test_healing.py +94 -0
- plasticity_agent-0.2.0/tests/test_llm.py +82 -0
- plasticity_agent-0.2.0/tests/test_memory_os.py +72 -0
- plasticity_agent-0.2.0/tests/test_memory_schema.py +65 -0
- plasticity_agent-0.2.0/tests/test_metrics.py +65 -0
- plasticity_agent-0.2.0/tests/test_observability.py +45 -0
- plasticity_agent-0.2.0/tests/test_reasoning_market.py +74 -0
- plasticity_agent-0.2.0/tests/test_reflection.py +58 -0
- plasticity_agent-0.2.0/tests/test_salience.py +36 -0
- plasticity_agent-0.2.0/tests/test_self_refine.py +42 -0
- plasticity_agent-0.2.0/tests/test_skill_library.py +60 -0
- plasticity_agent-0.2.0/tests/test_vector_retrieval.py +81 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
.Python
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
|
|
25
|
+
# Virtual environments
|
|
26
|
+
.venv/
|
|
27
|
+
venv/
|
|
28
|
+
env/
|
|
29
|
+
ENV/
|
|
30
|
+
|
|
31
|
+
# uv
|
|
32
|
+
.uv/
|
|
33
|
+
|
|
34
|
+
# Test / coverage
|
|
35
|
+
.pytest_cache/
|
|
36
|
+
.coverage
|
|
37
|
+
.coverage.*
|
|
38
|
+
htmlcov/
|
|
39
|
+
.mypy_cache/
|
|
40
|
+
.ruff_cache/
|
|
41
|
+
|
|
42
|
+
# Plasticity runtime artifacts (local-first state).
|
|
43
|
+
# NOTE: these are anchored to the repo root with a leading slash so they do NOT
|
|
44
|
+
# match the source package directory plasticity_agent/memory/ (an unanchored
|
|
45
|
+
# "memory/" would make the build backend drop the package from the wheel).
|
|
46
|
+
/memory/
|
|
47
|
+
/agent_runs/
|
|
48
|
+
*.sqlite
|
|
49
|
+
*.sqlite3
|
|
50
|
+
*.db
|
|
51
|
+
|
|
52
|
+
# Editors / OS
|
|
53
|
+
.vscode/
|
|
54
|
+
.idea/
|
|
55
|
+
.DS_Store
|
|
56
|
+
|
|
57
|
+
# Docs build
|
|
58
|
+
site/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/), and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.2.0] - 2026-06-07
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **LLM-powered upgrades** behind a single `llm_callback` (provider-agnostic, no SDK
|
|
12
|
+
dependency): model-authored reflection, semantic contradiction/entailment scoring
|
|
13
|
+
(`ContradictionChecker`), an `LLMCritic` in the reasoning market, and LLM self-refine. Every
|
|
14
|
+
path falls back to the deterministic baseline on failure.
|
|
15
|
+
- **Hybrid lexical + vector retrieval**: pluggable `EmbeddingBackend`
|
|
16
|
+
(`HashingEmbeddingBackend` with zero dependencies, optional `SentenceTransformerBackend`, and
|
|
17
|
+
`CallableEmbeddingBackend`), embeddings persisted in SQLite, a NumPy-accelerated `VectorIndex`
|
|
18
|
+
with an optional `FaissVectorIndex`, and `(1-α)·lexical + α·cosine` recall.
|
|
19
|
+
- **Opt-in sandboxed self-healing**: `Sandbox.apply(plan, RepairConsent(...))` can execute narrow,
|
|
20
|
+
reversible repairs (allowlisted `pip install` of a validated package, no shell, timeout, dry-run
|
|
21
|
+
default). `agent.apply_repair(...)` and `plasticity apply`.
|
|
22
|
+
- **Cross-run improvement metrics**: `ImprovementTracker`, `agent.checkpoint()` and
|
|
23
|
+
`agent.improvement()`, persisted to `metrics.sqlite`, plus `plasticity metrics`.
|
|
24
|
+
- **OpenTelemetry export**: `OTelExporter` and `PlasticAgent(otel=True)` stream trace events as
|
|
25
|
+
spans.
|
|
26
|
+
- **Richer consolidation**: embedding-aware clustering, near-duplicate merge (`duplicates_merged`),
|
|
27
|
+
and constitutional-memory governance (`constitution_conflicts`).
|
|
28
|
+
- First-class, tested framework adapters (LangGraph / CrewAI / OpenAI-Agents / Pydantic-AI).
|
|
29
|
+
- `otel` optional-dependency extra.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Self-healing is no longer advisory-only: narrow, reversible repairs are now
|
|
34
|
+
`auto_apply_allowed` but still require explicit consent to execute.
|
|
35
|
+
- SQLite stores are now concurrency-safe (WAL journaling, a guarding lock, retry-on-busy,
|
|
36
|
+
`check_same_thread=False`) and safe to share across threads.
|
|
37
|
+
- `SleepReport` gained `duplicates_merged` and `constitution_conflicts` fields.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Full `mypy` clean across all source files.
|
|
42
|
+
|
|
43
|
+
## [0.1.0] - 2026-06-06
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Initial release: neuroplastic memory (`MemoryOS`, 5 memory types, plasticity signals),
|
|
48
|
+
deterministic memory-quality scoring, salience, heuristic contradiction detection, decay /
|
|
49
|
+
forgetting, sleep-like consolidation (`SleepReport`), Reflexion-style reflection, Self-Refine,
|
|
50
|
+
advisory self-healing (diagnosis + repair plans), a six-critic reasoning market with an auction,
|
|
51
|
+
a Voyager-style skill library, thermodynamic-style energy reporting, the `PlasticAgent` runtime,
|
|
52
|
+
JSONL tracing, a Typer + Rich CLI, a FastAPI server, a Streamlit dashboard, and framework
|
|
53
|
+
adapters.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Plasticity Agent Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|