v0.2.28
moorcheh-ai/memantov0.2.28Oct 13, 2026by het0814
Upgrading?
AI Summary
This release introduces a new `Memanto.extract` method for the Python client to extract memories from chat conversations and adds a specific `NothingToExtractError` to distinguish between empty extractions and invalid JSON responses.
Key Highlights
- New `Memanto.extract` method for in-process memory extraction
- Introduction of `NothingToExtractError` to handle empty extraction results
- Support for `dry_run` mode in the extraction process
- Improved error handling for batch writes when normalization drops all candidates
New Features
- Memanto.extract function on the Python client
- NothingToExtractError exception class
- Dry run mode for memory extraction
Full Release Notes
# Release Notes for v0.2.28
This release adds conversation extraction to the in-process Python client and gives "nothing to extract" its own error. Callers such as per-turn memory hooks can now tell an empty conversation apart from a real extraction failure.
## New Features
- **`Memanto.extract` on the Python client** (`memanto/client.py`)
- New `Memanto(agent_id).extract(messages, *, dry_run=False, max_memories=20, ai_model=None)` takes `{"role": ..., "content": ...}` chat turns, extracts typed memories and stores them under the client's agent.
- With `dry_run=True` it returns the candidates without storing them. Otherwise it returns the candidates together with the batch result (`successful`, `failed`, `results`, ...).
- It works with both the local (`DirectClient`) and server-backed (`SdkClient`) modes.
## Improvements
- **New `NothingToExtractError` for conversations with nothing to remember** (`memanto/app/services/conversation_memory_extraction_service.py`, `memanto/__init__.py`)
- It is raised when the LLM returns an empty JSON array (`[]`, `Nothing to store: []`, or a fenced ```` ```json [] ```` block). Before this release, that case fell through to the generic `"Memory extraction did not return valid JSON"` error.
- Output that really is not JSON still raises a plain `ValueError`, so it can be told apart from an empty extraction.
- It subclasses `ValueError`, so existing `except ValueError` handlers (including the REST `/extract` route) keep working.
- It can be imported from the top level with `from memanto import NothingToExtractError`.
## Bug Fixes
- **Extraction with no usable candidates no longer fails as an empty batch write** (`memanto/cli/client/direct_client.py`, `memanto/cli/client/sdk_client.py`)
- Before: when every extracted candidate was dropped during normalization (for example, all had empty `content`), a non-dry-run extraction passed an empty list to `batch_remember`. That call then failed with the misleading `"Batch must contain at least one memory"`.
- Now both clients raise `NothingToExtractError` before any write is attempted. `dry_run=True` still returns a preview with zero candidates (`candidates: []`, `count: 0`).
## Tests
- `tests/test_conversation_memory_extraction.py`: an empty array raises `NothingToExtractError` across the three answer formats. Non-JSON output stays a plain `ValueError`. The error is a `ValueError` subclass, and all-unusable candidates still return `[]` from the service. Both `DirectClient` and `SdkClient` raise without calling `batch_remember`, and their dry run previews zero candidates.
- `tests/test_python_client.py`: `Memanto.extract` is scoped to the agent and passes its options through, and `memanto.NothingToExtractError` is exported.
## Full Changelog
Full Changelog: https://github.com/moorcheh-ai/memanto/compare/v0.2.27...v0.2.28Related Repositories
public-apis/public-apis★ 491,127
A collective list of free APIs
NousResearch/hermes-agent★ 255,899
The agent that grows with you
yt-dlp/yt-dlp★ 199,996
A feature-rich command-line audio/video downloader
microsoft/markitdown★ 191,480
Python tool for converting files and office documents to Markdown.
Significant-Gravitas/AutoGPT★ 187,700
AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.