hebbrix 2.0.3__tar.gz → 2.1.1__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.
- {hebbrix-2.0.3 → hebbrix-2.1.1}/PKG-INFO +1 -1
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix/__init__.py +1 -1
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix/resources.py +41 -13
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix.egg-info/PKG-INFO +1 -1
- {hebbrix-2.0.3 → hebbrix-2.1.1}/pyproject.toml +1 -1
- {hebbrix-2.0.3 → hebbrix-2.1.1}/setup.py +1 -1
- {hebbrix-2.0.3 → hebbrix-2.1.1}/MANIFEST.in +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/README.md +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix/chat.py +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix/client.py +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix/exceptions.py +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix.egg-info/SOURCES.txt +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix.egg-info/dependency_links.txt +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix.egg-info/requires.txt +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/hebbrix.egg-info/top_level.txt +0 -0
- {hebbrix-2.0.3 → hebbrix-2.1.1}/setup.cfg +0 -0
|
@@ -196,35 +196,63 @@ class MemoriesResource(BaseResource):
|
|
|
196
196
|
self,
|
|
197
197
|
collection_id: str,
|
|
198
198
|
content: str,
|
|
199
|
-
importance: float =
|
|
199
|
+
importance: Optional[float] = None,
|
|
200
200
|
source_type: str = "text",
|
|
201
201
|
source_reference: Optional[str] = None,
|
|
202
202
|
metadata: Optional[Dict[str, Any]] = None,
|
|
203
|
+
infer: bool = False,
|
|
203
204
|
) -> Dict[str, Any]:
|
|
204
205
|
"""
|
|
205
|
-
Create a
|
|
206
|
+
Create a memory.
|
|
207
|
+
|
|
208
|
+
By default (``infer=False``) the content is stored verbatim as a single
|
|
209
|
+
memory and the response's ``results[0].id`` is that memory's real,
|
|
210
|
+
immediately-resolvable id — so ``create()`` round-trips with ``get()``.
|
|
211
|
+
|
|
212
|
+
Behavior change (SDK 2.1.0): previously ``create()`` implicitly used the
|
|
213
|
+
server's LLM extract-and-resolve path (``infer=true``), which rewrote the
|
|
214
|
+
content, could emit zero or several fact rows, and — when the server ran
|
|
215
|
+
extraction asynchronously — returned a transient job id that ``get()``
|
|
216
|
+
could not resolve. That transient id is why a create/get round-trip
|
|
217
|
+
failed. Storing verbatim by default makes the returned id stable.
|
|
218
|
+
|
|
219
|
+
Pass ``infer=True`` to opt into fact extraction (``POST /v1/memories``
|
|
220
|
+
with server-side inference). In that mode ``results`` may contain several
|
|
221
|
+
extracted-fact ids, or the response may be ``{"job_id": ...}`` if the
|
|
222
|
+
server extracts asynchronously — poll that job rather than treating it as
|
|
223
|
+
a memory id.
|
|
206
224
|
|
|
207
225
|
Args:
|
|
208
226
|
collection_id: Collection ID
|
|
209
227
|
content: Memory content
|
|
210
|
-
importance: Importance
|
|
228
|
+
importance: Importance (0-1). When set, the direct-store path
|
|
229
|
+
(``infer=False``) uses this EXACT value. Leave as ``None`` to let
|
|
230
|
+
the server auto-score. Ignored when ``infer=True``.
|
|
211
231
|
source_type: Type of source
|
|
212
232
|
source_reference: Reference to source
|
|
213
233
|
metadata: Optional metadata
|
|
234
|
+
infer: When True, extract facts via the LLM pipeline instead of
|
|
235
|
+
storing ``content`` verbatim. Default False (direct store).
|
|
214
236
|
|
|
215
237
|
Returns:
|
|
216
|
-
Created memory
|
|
217
|
-
|
|
238
|
+
Created memory (MemoryAddResponse). With ``infer=False`` (default),
|
|
239
|
+
``results[0].id`` is the real, get-able memory id.
|
|
240
|
+
"""
|
|
241
|
+
payload: Dict[str, Any] = {
|
|
242
|
+
"collection_id": collection_id,
|
|
243
|
+
"content": content,
|
|
244
|
+
"source_type": source_type,
|
|
245
|
+
"source_reference": source_reference,
|
|
246
|
+
"metadata": metadata or {},
|
|
247
|
+
"infer": infer,
|
|
248
|
+
}
|
|
249
|
+
# Send importance ONLY when the caller set it, so an unspecified
|
|
250
|
+
# importance keeps the server's auto-scoring instead of pinning a value.
|
|
251
|
+
if importance is not None:
|
|
252
|
+
payload["importance"] = importance
|
|
218
253
|
return await self.client.post(
|
|
219
254
|
"/v1/memories",
|
|
220
|
-
json=
|
|
221
|
-
"collection_id": collection_id,
|
|
222
|
-
"content": content,
|
|
223
|
-
"importance": importance,
|
|
224
|
-
"source_type": source_type,
|
|
225
|
-
"source_reference": source_reference,
|
|
226
|
-
"metadata": metadata or {},
|
|
227
|
-
},
|
|
255
|
+
json=payload,
|
|
228
256
|
)
|
|
229
257
|
|
|
230
258
|
async def list_page(
|
|
@@ -9,7 +9,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name="hebbrix",
|
|
12
|
-
version="2.
|
|
12
|
+
version="2.1.1",
|
|
13
13
|
author="Hebbrix Team",
|
|
14
14
|
author_email="support@hebbrix.com",
|
|
15
15
|
description="Advanced Memory API for AI Agents with Reinforcement Learning - 3-line integration",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|