Skip to content

feat(memory): add DakeraMemoryService (community integration, follow-up to #6256)#166

Open
ferhimedamine wants to merge 1 commit into
google:mainfrom
ferhimedamine:feat/dakera-memory-service
Open

feat(memory): add DakeraMemoryService (community integration, follow-up to #6256)#166
ferhimedamine wants to merge 1 commit into
google:mainfrom
ferhimedamine:feat/dakera-memory-service

Conversation

@ferhimedamine

Copy link
Copy Markdown

Summary

Adds DakeraMemoryService, a BaseMemoryService implementation backed by Dakera — a self-hosted memory server that persists agent memories across sessions and ranks recall using an access-weighted importance decay model.

This is a follow-up to #6256, which @rohityan kindly closed with the recommendation to release the integration here in the community repo. Thank you for the pointer — I've re-implemented it to match this repo's conventions.

What it does

  • add_session_to_memory stores each text-bearing session event via POST /v1/memory/store.
  • search_memory retrieves relevant memories via semantic recall (POST /v1/memory/recall).
  • Memories are namespaced by a Dakera agent_id derived from app_name + user_id, so each app/user keeps an isolated memory space; session_id is preserved for provenance.
  • Author-weighted importance seeds Dakera's decay engine; an enriched content prefix ([Author: …, Time: …]) lets recall recover the author/timestamp.
  • A DakeraMemoryServiceConfig (pydantic) exposes search_top_k, timeout, per-author importance, min_importance, memory_type, and enable_metadata_tags.

Design notes

  • Mirrors the existing OpenMemoryService structure — async httpx client, config model, and the shared utils.extract_text_from_event. No new dependencies (httpx is already a base dependency).
  • Server URL and API key come from constructor args or the DAKERA_API_URL / DAKERA_API_KEY environment variables. An API key is required (fails fast otherwise).

Setup for reviewers

Dakera is self-hosted; the public compose file provisions the server and its object store:

git clone https://github.com/dakera-ai/dakera-deploy
cd dakera-deploy && docker compose up -d   # server on :3000 + MinIO
from google.adk_community.memory import DakeraMemoryService

memory_service = DakeraMemoryService(
    base_url="http://localhost:3000",  # or set DAKERA_API_URL
    api_key="dk-...",                  # or set DAKERA_API_KEY
)

Testing plan

  • Added tests/unittests/memory/test_dakera_memory_service.py — 17 unit tests mirroring the OpenMemory suite: store payload shape + endpoint, author→importance mapping, empty-event filtering, metadata-tag toggling, recall payload + namespace scoping, enriched-content parsing, min_importance forwarding, config validation, env-var fallback, and error handling (store logs & continues; recall returns an empty response).
  • Run locally against google-adk on Python 3.12: pytest tests/unittests/memory30 passed (17 new + 13 existing OpenMemory).
  • Formatted with the repo's isort (google profile) + pyink (--check clean).

Happy to open a tracking issue if the team would like one for this integration, and to adjust anything to fit your conventions.

Add a BaseMemoryService implementation backed by Dakera
(https://dakera.ai), a self-hosted memory server with access-weighted
importance decay for persistent, cross-session agent memory.

- Stores session events via POST /v1/memory/store and retrieves them
  with semantic recall via POST /v1/memory/recall.
- Namespaces memories by a Dakera agent_id derived from app_name +
  user_id so each app/user has an isolated memory space; session_id is
  preserved for provenance.
- Author-weighted importance seeds Dakera's decay engine; enriched
  content prefix lets recall recover author/timestamp.
- Mirrors the existing OpenMemoryService structure (httpx async client,
  config model, utils.extract_text_from_event) — no new dependencies.
- Unit tests cover store, recall, namespacing, config validation, env
  fallback, and error handling (17 tests, all green).

Follow-up to #6256, which was closed with a recommendation to release
this integration in the community repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@google-cla

google-cla Bot commented Jul 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

1 participant