smartmemory-client 0.7.0__tar.gz → 1.4.26__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.
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/CHANGELOG.md +88 -0
- {smartmemory_client-0.7.0/smartmemory_client.egg-info → smartmemory_client-1.4.26}/PKG-INFO +32 -1
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/README.md +31 -0
- smartmemory_client-1.4.26/VERSION +1 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client/client.py +328 -32
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client/models/memory_item.py +13 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26/smartmemory_client.egg-info}/PKG-INFO +32 -1
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client.egg-info/SOURCES.txt +4 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_client.py +44 -0
- smartmemory_client-1.4.26/tests/test_client_bughunt_fixes.py +246 -0
- smartmemory_client-1.4.26/tests/test_client_evaluation.py +173 -0
- smartmemory_client-1.4.26/tests/test_client_init_warning.py +40 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_decision_methods.py +73 -0
- smartmemory_client-1.4.26/tests/test_search_citations.py +126 -0
- smartmemory_client-0.7.0/VERSION +0 -1
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/LICENSE +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/MANIFEST.in +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/pyproject.toml +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/setup.cfg +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client/__init__.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client/models/__init__.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client/models/conversation.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client.egg-info/dependency_links.txt +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client.egg-info/requires.txt +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/smartmemory_client.egg-info/top_level.txt +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_client_errors.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_client_full_coverage.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_code_search.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_procedure_candidates.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_procedure_drift.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_procedure_evolution.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_procedure_matches.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_procedures.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_relation_contract.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_summary_client.py +0 -0
- {smartmemory_client-0.7.0 → smartmemory_client-1.4.26}/tests/test_token_usage.py +0 -0
|
@@ -5,6 +5,94 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
|
+
### Changed (auto, lockstep) — track product version 1.4.26 (1.4.26)
|
|
9
|
+
- Version copied from the smartmemory-core release (single-source lockstep).
|
|
10
|
+
|
|
11
|
+
### Changed (auto, lockstep) — track product version 1.4.25 (1.4.25)
|
|
12
|
+
- Version copied from the smartmemory-core release (single-source lockstep).
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Deprecated (SEC-AUTH-REVOCATION-1 token-prefix, 2026-06-04) — raw-JWT api_key (0.7.8)
|
|
16
|
+
|
|
17
|
+
- **`SmartMemoryClient(api_key="eyJ…")` now emits a `DeprecationWarning`.** A raw JWT in the
|
|
18
|
+
`api_key` slot (or `SMARTMEMORY_API_KEY`) is not scoped or revocable per-key. Mint a proper key
|
|
19
|
+
via `POST /memory/api-keys` and use the new `sm_live_…` / `sm_test_…` prefixes (legacy `sk_…`
|
|
20
|
+
still works). Properly-prefixed keys emit no warning. Fixed a latent `import warnings` shadowing
|
|
21
|
+
in `__init__` surfaced by this change.
|
|
22
|
+
|
|
23
|
+
### Added (CORE-GRAPH-CANONICAL-DEDUP-1, 2026-06-03) — `dedup_entities()` (0.7.7)
|
|
24
|
+
|
|
25
|
+
- **`client.dedup_entities(dry_run=False, require_structural_confirmation=True)`** — POSTs
|
|
26
|
+
`/memory/graph/dedup-entities` (both flags as query params). Opt-in graph-maintenance op that collapses
|
|
27
|
+
same-name cross-extractor entity-node fragments into one node, unblocking ensemble alias disambiguation.
|
|
28
|
+
Returns `merged_clusters / merged_nodes / redirected_edges / abstained_clusters / dry_run / workspace_id /
|
|
29
|
+
user_id`. Contract:
|
|
30
|
+
`smart-memory-docs/docs/features/CORE-GRAPH-CANONICAL-DEDUP-1/dedup-entities-contract.json`.
|
|
31
|
+
|
|
32
|
+
### Added (CORE-GRAPH-ALIAS-DISAMBIG-1, 2026-06-03) — `resolve_aliases(disambiguate=...)` (0.7.6)
|
|
33
|
+
|
|
34
|
+
- **`client.resolve_aliases(dry_run=False, disambiguate=False)`** threads the new opt-in collision-
|
|
35
|
+
disambiguation flag (default off) as a query param; response gains `disambiguated`. Contract:
|
|
36
|
+
`docs/features/CORE-GRAPH-ALIAS-DISAMBIG-1/disambiguate-contract.json`.
|
|
37
|
+
|
|
38
|
+
### Added (CORE-GRAPH-ALIAS-RESOLVE-2, 2026-06-02) — `resolve_aliases(dry_run=...)`
|
|
39
|
+
|
|
40
|
+
- **`client.resolve_aliases(dry_run=False)`** wraps `POST /memory/graph/resolve-aliases`.
|
|
41
|
+
Merges unambiguous single-token entity aliases ("Hudson") into their multi-token
|
|
42
|
+
canonical ("Rock Hudson") over the caller's workspace graph, abstaining on collisions.
|
|
43
|
+
`dry_run` is sent as a **query parameter** (mirrors `cluster()` / the `/clustering/run`
|
|
44
|
+
precedent), not a JSON body. Returns the parsed report dict: `resolved`, `abstained`,
|
|
45
|
+
`redirected_edges`, `ambiguous`, `dry_run`, `workspace_id`, `user_id`.
|
|
46
|
+
- Tests: `tests/integration/test_graph_operations.py::TestResolveAliases` (real-service
|
|
47
|
+
dry-run + default call; auto-skip when the service is unavailable).
|
|
48
|
+
Contract: `smart-memory-docs/docs/features/CORE-GRAPH-ALIAS-RESOLVE-2/resolve-aliases-contract.json`.
|
|
49
|
+
|
|
50
|
+
### Added (NEURO-1d, 2026-06-02) — `search(consolidation_first=...)` + `include_consolidated=...`
|
|
51
|
+
|
|
52
|
+
- **`client.search(..., consolidation_first=True)`** surfaces a consolidated summary above the
|
|
53
|
+
scattered source memories it consolidates — best for synthesis queries ("what is known about X?").
|
|
54
|
+
Opt-in; implies `include_consolidated`. **`include_consolidated=True`** includes consolidated
|
|
55
|
+
source memories (normally hidden). Both default off → request body omits the keys, so existing
|
|
56
|
+
callers are byte-identical on the wire.
|
|
57
|
+
- Tests: `tests/test_client.py::TestSearchConsolidationParams` (body serialization + default-omit).
|
|
58
|
+
Contract: `smart-memory-docs/docs/features/CORE-SEARCH-1/search-contract.json`.
|
|
59
|
+
|
|
60
|
+
### Added (CORE-AGENT-2, 2026-05-24) — `get_evaluation()` + `list_evaluation_history()`
|
|
61
|
+
|
|
62
|
+
- **`client.get_evaluation(agent_id, dimension, domain)`** — wraps `GET /memory/agents/{agent_id}/evaluation`. Returns `dict | None`; cold-start (no evaluation written yet) returns `None` cleanly per the contract (`200 {evaluation: null}` from the service). Raises `SmartMemoryNotFoundError` (404) for cross-tenant / unknown agent.
|
|
63
|
+
- **`client.list_evaluation_history(agent_id, dimension, domain, limit=...)`** — wraps `GET /memory/agents/{agent_id}/evaluation/history`. Returns a list of historical evaluation rows in supersession order.
|
|
64
|
+
- 8 new tests in `tests/test_client_evaluation.py` (happy / 404 / cold-start / pagination).
|
|
65
|
+
|
|
66
|
+
Source: `smart-memory-docs/docs/features/CORE-AGENT-2/report.md`. Contract: `smart-memory-docs/docs/features/CORE-AGENT-2/evaluation-contract.json`.
|
|
67
|
+
|
|
68
|
+
### Added (CORE-DECISION-PROVENANCE-LOOKUP-1, 2026-05-23) — `list_decisions(provenance_memory_id=...)`
|
|
69
|
+
|
|
70
|
+
- **`list_decisions()`** gains an optional `provenance_memory_id` kwarg. When set, the SDK passes it through to `GET /memory/decisions?provenance_memory_id=<id>` and returns only active decisions whose provenance subgraph contains that memory. Other filters (`domain`, `decision_type`, `min_confidence`, `limit`) compose in-query — the SDK never sees a truncated-below-limit result. Backwards-compatible; existing callers see no behavior change.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Changed (CORE-RECALL-LINEAGE-1 Phase 3, 2026-05-22) — SearchResponse envelope unwrap
|
|
74
|
+
|
|
75
|
+
- **`SmartMemoryClient.search()`** now always unwraps the `{results, group_roots, citations?}` envelope. Callers continue to receive `List[MemoryItem]` — no signature change. The envelope siblings are exposed on the client instance:
|
|
76
|
+
- `client.last_group_roots: Dict[str, GroupRootStub]` — canonicals that didn't match the query, keyed by root_id. Each stub: `{item_id, accessible, content_preview?, memory_type?, origin?}`.
|
|
77
|
+
- `client.last_citations: List[Citation]` — unchanged from RECALL-CITATIONS-1; now sourced from the envelope sibling instead of the legacy double-wrap.
|
|
78
|
+
- **`MemoryItem`** dataclass gains `origin: Optional[str]` and `lineage_roots: List[str]`. `from_dict` reads both. Backwards-compatible with old (pre-envelope) responses — missing keys default to `None` / `[]`.
|
|
79
|
+
- Pre-envelope service responses (bare list) still parse correctly during rollout — the client tolerates both shapes.
|
|
80
|
+
|
|
81
|
+
### Added (RECALL-CITATIONS-1, 2026-05-10)
|
|
82
|
+
|
|
83
|
+
- **`SmartMemoryClient.search(cite=True)`** opts into the citation-ready response. The wire response is `{results, citations}`; the client unwraps `results` (callers continue to receive `List[MemoryItem]`) and exposes the citation array via the new `client.last_citations` property. Each citation has shape `{n, item_id, item_type, preview, score, footnote_marker}` per the RECALL-CITATIONS-1 contract. `last_citations` is `[]` when `cite=False` or when there are no results.
|
|
84
|
+
|
|
85
|
+
### Changed (CORE-EXPERTISE-1 Phase 4b, 2026-05-08)
|
|
86
|
+
|
|
87
|
+
- **README gains "Expertise Layer" API section.** Shows `client.create_decision(..., rejected_alternatives=, rationale=, constraints=)` for capture and `client.search(query, expertise=True)` returning the typed dict for recall. Links to the canonical 1-pager. No code change.
|
|
88
|
+
|
|
89
|
+
### Added (CORE-EXPERTISE-1 Phase 4a, 2026-05-08)
|
|
90
|
+
|
|
91
|
+
- **`SmartMemoryClient.search(..., expertise=False)` parameter added.** When `True`, returns `Dict[str, List[MemoryItem]]` keyed by expertise type (decision/constraint/learned/opinion/reasoning/observation), each bucket capped at `top_k`. Default returns `List[MemoryItem]` — no breaking change. Forwarded as `expertise: true` in the POST body; response parsing branches on the flag (parses `{results: {<bucket>: [...]}}`). Contract: `smart-memory-docs/docs/features/CORE-EXPERTISE-1/expertise-search-contract.json`.
|
|
92
|
+
|
|
93
|
+
### Added (CORE-EXPERTISE-1 Phase 1, 2026-05-07)
|
|
94
|
+
|
|
95
|
+
- **`SmartMemoryClient.create_decision()` accepts `rejected_alternatives`, `rationale`, `constraints`.** Three new optional kwargs forwarded to `POST /memory/decisions/create` as snake_case payload keys; omitted entirely when unset (no `null`-leakage). 2 new contract tests in `tests/test_decision_methods.py`. Feature folder: `smart-memory-docs/docs/features/CORE-EXPERTISE-1/phase-1-decision-schema/`.
|
|
8
96
|
|
|
9
97
|
## [0.7.0] — 2026-05-04
|
|
10
98
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smartmemory-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.4.26
|
|
4
4
|
Summary: Python client for SmartMemory Service API
|
|
5
5
|
Author-email: SmartMemory Team <team@smartmemory.dev>
|
|
6
6
|
License: MIT
|
|
@@ -34,6 +34,8 @@ Dynamic: license-file
|
|
|
34
34
|
|
|
35
35
|
# SmartMemory Python Client
|
|
36
36
|
|
|
37
|
+
**Version:** 0.7.0
|
|
38
|
+
|
|
37
39
|
Official Python client for the [SmartMemory Service](https://github.com/smartmemory/smart-memory-service) API.
|
|
38
40
|
|
|
39
41
|
[](https://badge.fury.io/py/smartmemory-client)
|
|
@@ -143,6 +145,31 @@ fixtures will inject them automatically.
|
|
|
143
145
|
|
|
144
146
|
## API Reference
|
|
145
147
|
|
|
148
|
+
### Expertise Layer
|
|
149
|
+
|
|
150
|
+
SmartMemory's [expertise layer](https://docs.smartmemory.ai/smartmemory/concepts/expertise-vs-knowledge) — `decision`, `constraint`, `learned`, `opinion`, `reasoning`, `observation` — has dedicated capture and recall surfaces in this SDK.
|
|
151
|
+
|
|
152
|
+
#### Capture
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
client.create_decision(
|
|
156
|
+
title="Adopt FalkorDB",
|
|
157
|
+
rejected_alternatives=["Neo4j", "Memgraph"],
|
|
158
|
+
rationale="Smallest ops surface; vector-native; permissive license.",
|
|
159
|
+
constraints=["Must support Cypher subset"],
|
|
160
|
+
)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
#### Recall (partitioned by expertise type)
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
results = client.search("graph database choice", expertise=True)
|
|
167
|
+
# Dict[str, List[MemoryItem]] keyed by:
|
|
168
|
+
# decision / constraint / learned / opinion / reasoning / observation
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Default `client.search(query)` returns `List[MemoryItem]` (flat) — no breaking change. Setting `expertise=True` switches the response shape; the SDK parses it into the typed dict.
|
|
172
|
+
|
|
146
173
|
### Memory Operations
|
|
147
174
|
|
|
148
175
|
#### Add Memory
|
|
@@ -545,3 +572,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
|
545
572
|
---
|
|
546
573
|
|
|
547
574
|
**Made with ❤️ by the SmartMemory Team**
|
|
575
|
+
|
|
576
|
+
## Documentation
|
|
577
|
+
|
|
578
|
+
Full SmartMemory documentation: https://docs.smartmemory.ai
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# SmartMemory Python Client
|
|
2
2
|
|
|
3
|
+
**Version:** 0.7.0
|
|
4
|
+
|
|
3
5
|
Official Python client for the [SmartMemory Service](https://github.com/smartmemory/smart-memory-service) API.
|
|
4
6
|
|
|
5
7
|
[](https://badge.fury.io/py/smartmemory-client)
|
|
@@ -109,6 +111,31 @@ fixtures will inject them automatically.
|
|
|
109
111
|
|
|
110
112
|
## API Reference
|
|
111
113
|
|
|
114
|
+
### Expertise Layer
|
|
115
|
+
|
|
116
|
+
SmartMemory's [expertise layer](https://docs.smartmemory.ai/smartmemory/concepts/expertise-vs-knowledge) — `decision`, `constraint`, `learned`, `opinion`, `reasoning`, `observation` — has dedicated capture and recall surfaces in this SDK.
|
|
117
|
+
|
|
118
|
+
#### Capture
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
client.create_decision(
|
|
122
|
+
title="Adopt FalkorDB",
|
|
123
|
+
rejected_alternatives=["Neo4j", "Memgraph"],
|
|
124
|
+
rationale="Smallest ops surface; vector-native; permissive license.",
|
|
125
|
+
constraints=["Must support Cypher subset"],
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Recall (partitioned by expertise type)
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
results = client.search("graph database choice", expertise=True)
|
|
133
|
+
# Dict[str, List[MemoryItem]] keyed by:
|
|
134
|
+
# decision / constraint / learned / opinion / reasoning / observation
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Default `client.search(query)` returns `List[MemoryItem]` (flat) — no breaking change. Setting `expertise=True` switches the response shape; the SDK parses it into the typed dict.
|
|
138
|
+
|
|
112
139
|
### Memory Operations
|
|
113
140
|
|
|
114
141
|
#### Add Memory
|
|
@@ -511,3 +538,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
|
511
538
|
---
|
|
512
539
|
|
|
513
540
|
**Made with ❤️ by the SmartMemory Team**
|
|
541
|
+
|
|
542
|
+
## Documentation
|
|
543
|
+
|
|
544
|
+
Full SmartMemory documentation: https://docs.smartmemory.ai
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.4.26
|