You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Extract shared database drivers for session, multimodal, and response stores (#357)
* feat: Extract shared database drivers for session, multimodal, and response stores
* feat: Refactor shared database drivers and retry logic
- Parameterize retry helper by exception types, allowing scoped retries for drivers.
- Migrate CosmosDB and Firestore drivers to shared `core/util/drivers/`.
- Consolidate `RedisLikeDriver` retry and health-check behavior across sessions and response stores.
- Standardize method names in CosmosDB to match DynamoDB drivers.
- Update consumer stores to explicit driver parameters and adjust related tests.
* feat: Refactor driver state management and connection handling for Redis and DynamoDB
* feat: Migrate thread stores to shared database drivers and consolidate connection handling
* fix: Correct line numbers in spec.md for thread store connection logic
* fix: Update `spec.md` to reflect package rename from `drivers` to `driver` across shared database driver sections
* feat: Add shared database connection drivers for Cosmos DB, DynamoDB, Firestore, Redis, and Valkey
* fix: Handle `None` type for `last_err` in retry logic and enforce minimum retry count
* feat: Introduce BaseDriver class for shared database connection logic and refactor drivers to inherit from it
@@ -239,6 +239,26 @@ Pluggable storage backends agents can read from and write to as tools:
239
239
- **`KnowledgeBuilder`** (`knowledgebuilder.py`): Wraps one or more `KnowledgeBase` instances and `build()`s plain-function tools (`get_schemas`, `read_kb`, `write_kb`, `get_all_kb_descriptions`) for binding via a framework's `ToolBuilder`
240
240
- **Backends**: `ChromaManager` (vector, `chroma.py`), `Neo4jManager` (graph, `neo4j.py`), `StarburstManager` (read-only SQL via Trino, `starburst.py`) — each behind an optional dependency extra (`chromadb`, `neo4j`, `trino`)
| DynamoDB |`dynamodb`| Serverless/AWS, TTL via `expiry_time`, fully managed |`agentkernel[multimodal,aws]`|
26
26
| Session cache |`session_cache`| Legacy — stores in session `nv_cache` (causes bloat, not recommended) | None |
27
27
@@ -141,7 +141,7 @@ class <Backend>AttachmentStore(AttachmentStore):
141
141
-**Max attachments pruning**: When `save()` is called and the session exceeds `max_attachments`, delete the oldest entry. Track order via timestamps or a per-session index
142
142
-**Index consistency on delete**: When `delete()` is called, remove the attachment ID from the per-session index in addition to deleting the data entry. Skipping this step causes the index count to drift — the backend will think more attachments exist than actually do, breaking `max_attachments` enforcement on subsequent saves
143
143
-**TTL**: If the backend supports time-based expiry (like Redis TTL or DynamoDB `expiry_time`), use it for automatic cleanup. Read the TTL value from the backend-specific config
144
-
-**Connection management**: Use lazy initialization and connection pooling where possible. The store may be instantiated per-request (inside `AttachmentStorageManager.__init__`)
144
+
-**Connection management**: Reuse the shared connection drivers in `agentkernel/core/util/driver/` (`RedisDriver`, `DynamoDBDriver`, etc.) — they provide lazy connect, 3-retry back-off, and (for Redis-like backends) ping/reconnect. The store may be instantiated per-request (inside `AttachmentStorageManager.__init__`), so keep the driver construction cheap (no eager connect)
145
145
-**Serialization**: Attachment dicts must be JSON-serializable. The `data` field contains base64-encoded binary, so all values are strings, floats, or ints
0 commit comments