← 返回
未分类 中文

Kvstore

In-memory key-value store with TTL for AI agents. Set, get, delete, list, flush, and stats. Supports any JSON value, optional TTL per key, and prefix-based k...
内存键值存储,支持TTL,适用于 AI 代理。提供 Set、Get、Delete、List、Flush、Stats 操作;可存储任意 JSON 值,支持可选 TTL 及前缀键检索。
mirni mirni 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 332
下载
💾 0
安装
1
版本
#latest

概述

KVStore

Lightweight key-value store for agent state, caching, and data sharing.

Start the server

uvicorn kvstore.app:app --port 8013

Set a value

curl -s -X POST http://localhost:8013/v1/set \
  -H "Content-Type: application/json" \
  -d '{"key": "user:1", "value": {"name": "Alice", "role": "admin"}}' | jq

Set with TTL (auto-expires)

curl -s -X POST http://localhost:8013/v1/set \
  -H "Content-Type: application/json" \
  -d '{"key": "cache:token", "value": "abc123", "ttl_seconds": 3600}' | jq

Get a value

curl -s http://localhost:8013/v1/get/user:1 | jq

Returns key, value (any JSON), and ttl_remaining (seconds until expiry, or null).

List keys by prefix

curl -s "http://localhost:8013/v1/keys?prefix=user:" | jq

Delete / Flush / Stats

curl -s -X DELETE http://localhost:8013/v1/delete/user:1 | jq
curl -s -X POST http://localhost:8013/v1/flush | jq
curl -s http://localhost:8013/v1/stats | jq

Endpoints

MethodPathDescription
---------------------------
POST/v1/setSet a key-value pair (optional TTL)
GET/v1/get/{key}Get value by key
DELETE/v1/delete/{key}Delete a key
GET/v1/keysList keys (optional ?prefix=)
POST/v1/flushDelete all keys
GET/v1/statsHit/miss counts and total keys

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 17:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Agent Observability Stack: Distributed Tracing, Metrics, and Alerting for Multi-Agent Systems

mirni
Agent 可观测性栈:多代理系统的分布式追踪、指标和告警。为代理商务构建完整的可观测性栈:OpenT...
★ 0 📥 562

The Agent Pricing & Monetization Playbook

mirni
《代理定价与变现手册》:制定代理的定价策略,包括使用量计量、成果计费、市场发布和A2A支付结算。
★ 0 📥 563

The Agent Testing & Observability Cookbook: Ship Reliable Agent Commerce Systems

mirni
《代理测试与可观测性实践手册》:交付可靠的代理商务系统。面向从业者的代理商务测试与监控实践手册:工具契约...
★ 0 📥 571