Skip to content

feat(drivers-memory-conversation-dakera): add DakeraConversationMemoryDriver#2228

Open
ferhimedamine wants to merge 1 commit into
griptape-ai:mainfrom
ferhimedamine:feat/dakera-conversation-memory-driver
Open

feat(drivers-memory-conversation-dakera): add DakeraConversationMemoryDriver#2228
ferhimedamine wants to merge 1 commit into
griptape-ai:mainfrom
ferhimedamine:feat/dakera-conversation-memory-driver

Conversation

@ferhimedamine

@ferhimedamine ferhimedamine commented Jul 1, 2026

Copy link
Copy Markdown

Problem

Griptape's BaseConversationMemoryDriver lets 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 existing RedisConversationMemoryDriver and GriptapeCloudConversationMemoryDriver:

  • Each conversation is stored under its own conversation_id, which is used as the Dakera agent_id, so conversations stay isolated from one another.
  • store(runs, metadata) serializes the conversation via the base class's _to_params_dict and 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.
  • The Dakera client is a lazily-constructed optional dependency (import_optional_dependency("dakera")), gated behind the new drivers-memory-conversation-dakera extra. base_url / api_key fall back to DAKERA_BASE_URL (default http://localhost:3000) and DAKERA_API_KEY.

Dakera is self-hosted via the dakera-deploy Docker Compose stack; the Python SDK is dakera.

Usage

import os
import uuid

from griptape.drivers.memory.conversation.dakera import DakeraConversationMemoryDriver
from griptape.memory.structure import ConversationMemory
from griptape.structures import Agent

dakera_conversation_driver = DakeraConversationMemoryDriver(
    base_url=os.environ["DAKERA_BASE_URL"],  # e.g. http://localhost:3000
    api_key=os.environ["DAKERA_API_KEY"],
    conversation_id=uuid.uuid4().hex,
)

agent = Agent(conversation_memory=ConversationMemory(conversation_memory_driver=dakera_conversation_driver))
agent.run("My name is Jeff.")
agent.run("What is my name?")  # a fresh Agent with the same conversation_id reloads the history

Testing

  • New unit tests in 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, and mdformat --check all clean locally against the pinned versions in uv.lock.
  • uv.lock regenerated to include the new optional dependency.

Checklist

  • New driver mirrors an existing sibling (RedisConversationMemoryDriver) and its base class
  • Registered in griptape/drivers/__init__.py (__all__) and re-exported from the dakera subpackage
  • drivers-memory-conversation-dakera extra added; included in all; uv.lock updated
  • Unit tests added and passing
  • Docs section + runnable example added to conversation-memory-drivers.md
  • Lint / format / type / spell checks pass locally

📚 Documentation preview 📚: https://griptape--2228.org.readthedocs.build//2228/

…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

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../conversation/dakera_conversation_memory_driver.py 96.77% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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