feat(drivers-memory-conversation-dakera): add DakeraConversationMemoryDriver#2228
Open
ferhimedamine wants to merge 1 commit into
Open
Conversation
…yDriver Adds a Conversation Memory Driver that persists Griptape Conversation Memory to a self-hosted Dakera memory server. Each conversation is stored under its own conversation_id (used as the Dakera agent_id), and store() replaces the previous snapshot so load() returns only the latest state, mirroring the existing Redis and Griptape Cloud drivers. Includes unit tests, docs, and the drivers-memory-conversation-dakera extra.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Griptape's
BaseConversationMemoryDriverlets applications persist Conversation Memory to an external store (Local JSON, Amazon DynamoDB, Redis, Griptape Cloud). There's currently no driver for Dakera, a self-hosted memory server that a number of Griptape users run alongside their agents. Today they have to write their own glue to persist conversations to it.Design
This PR adds
DakeraConversationMemoryDriver, mirroring the structure of the existingRedisConversationMemoryDriverandGriptapeCloudConversationMemoryDriver:conversation_id, which is used as the Dakeraagent_id, so conversations stay isolated from one another.store(runs, metadata)serializes the conversation via the base class's_to_params_dictand replaces the previous snapshot (deletes prior entries, then writes the latest one), matching the overwrite semantics of the Redis/DynamoDB drivers.load()reads back the most recent snapshot and reconstructs it with_from_params_dict, returning([], {})when nothing is stored.import_optional_dependency("dakera")), gated behind the newdrivers-memory-conversation-dakeraextra.base_url/api_keyfall back toDAKERA_BASE_URL(defaulthttp://localhost:3000) andDAKERA_API_KEY.Dakera is self-hosted via the
dakera-deployDocker Compose stack; the Python SDK isdakera.Usage
Testing
tests/unit/drivers/memory/conversation/test_dakera_conversation_memory_driver.py(store, snapshot replacement, load, empty-load, and validation) — all pass, following the same mocked-client pattern as the Redis driver tests.ruff format --check,ruff check,pyright,typos, andmdformat --checkall clean locally against the pinned versions inuv.lock.uv.lockregenerated to include the new optional dependency.Checklist
RedisConversationMemoryDriver) and its base classgriptape/drivers/__init__.py(__all__) and re-exported from thedakerasubpackagedrivers-memory-conversation-dakeraextra added; included inall;uv.lockupdatedconversation-memory-drivers.md📚 Documentation preview 📚: https://griptape--2228.org.readthedocs.build//2228/