Class RedisDistributedStore

java.lang.Object
io.agentscope.extensions.redis.RedisDistributedStore
All Implemented Interfaces:
io.agentscope.harness.agent.DistributedStore

public class RedisDistributedStore extends Object implements io.agentscope.harness.agent.DistributedStore
Redis-backed DistributedStore that configures all distributed storage components with a single Jedis connection.

Usage:


 JedisPooled jedis = new JedisPooled("redis://localhost:6379");
 RedisDistributedStore store = RedisDistributedStore.fromJedis(jedis);

 HarnessAgent agent = HarnessAgent.builder()
     .name("my-agent")
     .model("dashscope:qwen-plus")
     .distributedStore(store)
     .filesystem(new RemoteFilesystemSpec(store.baseStore())
             .isolationScope(IsolationScope.USER))
     .build();
 

This provides:

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.agentscope.harness.agent.DistributedStore

    io.agentscope.harness.agent.DistributedStore.Builder, io.agentscope.harness.agent.DistributedStore.CompositeDistributedStore
  • Method Summary

    Modifier and Type
    Method
    Description
    io.agentscope.core.state.AgentStateStore
     
    io.agentscope.harness.agent.filesystem.remote.store.BaseStore
     
    fromJedis(redis.clients.jedis.UnifiedJedis jedis)
    Creates a Redis distributed store from a Jedis client with the default key prefix.
    fromJedis(redis.clients.jedis.UnifiedJedis jedis, String keyPrefix)
    Creates a Redis distributed store from a Jedis client with a custom key prefix.
    io.agentscope.harness.agent.sandbox.SandboxExecutionGuard
     
    io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.agentscope.harness.agent.DistributedStore

    asyncToolRegistry, messageBus, sessionTurnGate, taskRepository, teamClient
  • Method Details

    • fromJedis

      public static RedisDistributedStore fromJedis(redis.clients.jedis.UnifiedJedis jedis)
      Creates a Redis distributed store from a Jedis client with the default key prefix.
      Parameters:
      jedis - initialized Jedis client (e.g. new JedisPooled("redis://localhost:6379"))
      Returns:
      a new Redis distributed store
    • fromJedis

      public static RedisDistributedStore fromJedis(redis.clients.jedis.UnifiedJedis jedis, String keyPrefix)
      Creates a Redis distributed store from a Jedis client with a custom key prefix.
      Parameters:
      jedis - initialized Jedis client
      keyPrefix - prefix for all Redis keys (e.g. "myapp:")
      Returns:
      a new Redis distributed store
    • agentStateStore

      public io.agentscope.core.state.AgentStateStore agentStateStore()
      Specified by:
      agentStateStore in interface io.agentscope.harness.agent.DistributedStore
    • baseStore

      public io.agentscope.harness.agent.filesystem.remote.store.BaseStore baseStore()
      Specified by:
      baseStore in interface io.agentscope.harness.agent.DistributedStore
    • sandboxSnapshotSpec

      public io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec sandboxSnapshotSpec()
      Specified by:
      sandboxSnapshotSpec in interface io.agentscope.harness.agent.DistributedStore
    • sandboxExecutionGuard

      public io.agentscope.harness.agent.sandbox.SandboxExecutionGuard sandboxExecutionGuard()
      Specified by:
      sandboxExecutionGuard in interface io.agentscope.harness.agent.DistributedStore