Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ WARP.md
**/memory-bank/
**/projectBrief.md
**/tmpclaude*
.kiro/
# Dependency-bound validation reports
python/scripts/dependency-*-results.json
python/scripts/dependencies/dependency-*-results.json
Expand Down
21 changes: 21 additions & 0 deletions python/packages/valkey/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions python/packages/valkey/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# agent-framework-valkey

Valkey integration for the [Microsoft Agent Framework](https://aka.ms/agent-framework).

## Components

- **ValkeyStreamBuffer** — Resumable streaming buffer backed by Valkey Streams.
Persists agent response chunks via `XADD` and supports cursor-based client
reconnection via `XREAD`. Implements `AgentResponseCallbackProtocol` for
direct use with durable agent workers.

## Installation

```bash
pip install agent-framework-valkey
```

For durable agent callback support:

```bash
pip install agent-framework-valkey[durabletask]
```

## Quick Start

```python
import asyncio

from glide import GlideClient, GlideClientConfiguration, NodeAddress
from agent_framework_valkey import ValkeyStreamBuffer


async def main():
config = GlideClientConfiguration([NodeAddress("localhost", 6379)])
client = await GlideClient.create(config)
buffer = ValkeyStreamBuffer(client=client)

# Write side
await buffer.write_chunk("conv-1", "Hello, ", 0)
await buffer.write_chunk("conv-1", "world!", 1)
await buffer.write_completion("conv-1", 2)

# Read side (supports cursor-based resumption)
async for chunk in buffer.read_stream("conv-1"):
if chunk.is_done:
break
print(chunk.text, end="")


asyncio.run(main())
```

## Requirements

- Python 3.10+
- Valkey server (any version supporting Streams)
- `valkey-glide` client library
16 changes: 16 additions & 0 deletions python/packages/valkey/agent_framework_valkey/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) Microsoft. All rights reserved.

import importlib.metadata

from ._stream_buffer import StreamChunk, ValkeyStreamBuffer

try:
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0" # Fallback for development mode

__all__ = [
"StreamChunk",
"ValkeyStreamBuffer",
"__version__",
]
Loading