Skip to content

Support Dakera 0.12.4 - #208

Draft
ferhimedamine wants to merge 7 commits into
mainfrom
claude/trusting-maxwell-yctksi
Draft

ferhimedamine wants to merge 7 commits into
mainfrom
claude/trusting-maxwell-yctksi

Conversation

@ferhimedamine

Copy link
Copy Markdown
Contributor

What

Support for Dakera server v0.12.4 in the Python SDK (sync and async clients), version 0.15.0. Every item was checked against the engine's request/response types and router at 0.12.4.

New calls and fields

  • forget_memories(agent_id, *, memory_ids=, memory_type=, session_id=, tags=, below_importance=, about=, request=, until=, min_score=, limit=, restorable=, dry_run=) → ForgetResponse (deleted_count, forgotten_ids, intent). about forgets by description; request forgets what a user's request to forget means, in any language, after the server confirms it is one. Invalid combinations (about + request, min_score outside [0, 1], limit outside 1..50, texts above 8000 characters) raise ValueError before sending.
  • detect_forget_requests(texts) → POST /v1/memory/forget/detect (ForgetDetectResponse).
  • forget(..., restorable=True); DeduplicatedMemory.content and the "deletion" trash kind.
  • Store: forget_request on the stored memory; batch store forget_requests / duplicates.
  • Recall: rerank_head= / importance_weighted= (sent only when set), RecallResponse.instructions, .degraded, .is_degraded.
  • get_memory(..., projection_days=N) (strength projection), import_memories(..., run_async=True) + wait_for_import_job(), get_namespace_ner_config() (with source).
  • MemoryPolicy.stored, link label on GraphEdge / GraphLinkResponse, EntityExtractionResponse.extractor / .warnings.
  • Failures the server now reports: DeduplicateResponse.groups_failed, CrossAgentNetworkResponse.unavailable, CompressResponse.deprecation_skipped / .deprecation_error, TtlCleanupResponse.failed, DerivationStatus.entity_tagging.
  • Admin: autopilot_update_config(consolidation_mode=), WarmCacheRequest.query_vector / .min_score_threshold / .recently_accessed_within; docstrings for the 200 / 202 / 409 / 503 answers of key and quota changes.

Fixes already on this branch (verified against the server)

  • recall() no longer sends top_k=5 or drops include_associated=False; the server's defaults apply unless the caller sets a value.
  • MemoryPolicy TTL defaults are None (no expiry by type) and dedup_threshold is 0.95, matching the server.
  • ConsolidateResponse / SummarizeResponse now have the shapes the server actually sends (breaking for code that read the old fields, which the server never sent).
  • list_audit_events(cursor=) pages using the server's next_cursor.
  • Docstrings now cover the auto_summarize, summary_pending, agent_memories(memory_type=), agent_sessions(active_only=) and analytics period / namespace behaviour.

Error handling needed no code change: 202 was already treated as success, 409 raises ConflictError, and 503 / 429 expose retry_after and are retried after the server's Retry-After (for example, a namespace fenced after a failed delete returns 503 with Retry-After: 5). New tests cover these paths.

Why

Server v0.12.4 adds forgetting by meaning, standing instructions, recall degradation reporting, async imports and several fields that make failures visible. It also changes defaults (importance_weighted false, associated memories on), which the SDK must leave to the server.

Compatibility

Works with v0.12.0 – v0.12.3 servers. New request fields are sent only when set, and new response fields are None or empty from an older server. The only breaking change is the ConsolidateResponse / SummarizeResponse model shapes noted above, so this is a minor version bump.

Tests run (locally)

uv sync --extra dev --extra async
uv run ruff check .                                         # All checks passed
uv run mypy src/                                            # no issues in 9 source files
uv run pytest tests/ -q --ignore=tests/test_integration.py  # 852 passed, 4 skipped

tests/test_v0124.py (57 tests) covers each new method and field with mocked HTTP for both clients, including answers from an older server. tests/v0_12_routes.txt now includes the new detect route. The live-server integration tests were not run locally.

🤖 Generated with Claude Code

ferhimedamine and others added 7 commits November 1, 2026 19:12
- MemoryPolicy: *_ttl_seconds default to None (server default: no TTL by
  type) and dedup_threshold to 0.95 (server default_store_dedup_threshold);
  docstrings no longer claim 4h/30d defaults.
- recall(): top_k is omitted unless set (server default 10);
  include_associated defaults to None and is sent whenever set, so False
  turns it off now that the server default is on.
- list_audit_events(cursor=): raises ValueError; GET /v1/audit has no
  cursor pagination. AuditListResponse.cursor is always None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
- ConsolidateResponse: consolidated_memory, source_memory_ids,
  memories_removed (server ConsolidateResponse).
- SummarizeResponse: summary_memory, source_count (server
  SummarizeResponse).
- consolidate() docstring: describe auto-detection without memory_ids
  (most important memory with neighbours at cosine >= threshold, merged
  with up to 4 of them; 400 when none are that similar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
GET /v1/audit pages by cursor from server 0.12.4: list_audit_events(cursor=)
sends it and AuditListResponse.cursor is the server's next_cursor (it raised
ValueError, since the server had none). agent_memories(memory_type=) and
agent_sessions(active_only=) are applied by 0.12.4 servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
…sync import)

Checked against the engine's request and response types and router at 0.12.4:

- forget_memories(): every POST /v1/memory/forget selector, including about,
  request, until, min_score, limit, restorable and dry_run; ForgetResponse with
  forgotten_ids and intent (ForgetIntent). forget(restorable=).
- detect_forget_requests(): POST /v1/memory/forget/detect (ForgetDetectResponse).
- store_memory() returns forget_request; BatchStoreMemoryResponse carries
  forget_requests (StoredForgetRequest) and duplicates (BatchDuplicate).
- recall(rerank_head=, importance_weighted=), sent only when set;
  RecallResponse.instructions, .degraded, .is_degraded.
- get_memory(projection_days=), import_memories(run_async=) with
  wait_for_import_job(), get_namespace_ner_config().
- MemoryPolicy.stored, GraphEdge/GraphLinkResponse.label,
  EntityExtractionResponse.extractor/.warnings, DeduplicatedMemory.content.
- Failure lists: DeduplicateResponse.groups_failed, CrossAgentNetworkResponse
  .unavailable, CompressResponse.deprecation_skipped/.deprecation_error,
  TtlCleanupResponse.failed, DerivationStatus.entity_tagging.
- autopilot_update_config(consolidation_mode=), WarmCacheRequest query_vector /
  min_score_threshold / recently_accessed_within.
- Docstrings for the 200/202/409/503 answers of key and quota changes, the
  honoured analytics/session/agent filters and auto_summarize.

Sync and async clients; tests/test_v0124.py covers each, also against a server
that sends none of the new fields. The route snapshot gains the detect route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
Version 0.15.0 (pyproject, __version__, uv.lock). The CHANGELOG [0.15.0] entry
gathers this branch's changes and corrects the audit cursor entry: the cursor
pages for real (next_cursor), it does not raise. README: what's new for server
v0.12.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd
A server before v0.12.4 ignores about, request, until, min_score, limit,
restorable and dry_run and still applies memory_ids and the filters, so
forget_memories(memory_ids=[...], dry_run=True) or about= with session_id=
would really delete what the filters select there.

When one of those fields is combined with memory_ids or a filter,
forget_memories() and forget(restorable=True) (sync and async) first read the
server version from the cached capabilities() and raise ValidationError,
sending nothing, unless the server is v0.12.4 or later. A server that
advertises no readable version or has no capabilities route (404) counts as
older; any other failure to read the capabilities is raised before the forget
is sent. Without a filter no check is made: an older server refuses such a
body with 400.

Tests: new server sends; old, unknown and pre-capabilities servers are refused
with nothing sent; a capabilities error is raised; the version is read once;
the no-filter and plain cases make no capabilities call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKmYrmGxPEHfmA624vFLcd

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants