Class JdbcDistributedStore

java.lang.Object
io.agentscope.extensions.jdbc.JdbcDistributedStore
All Implemented Interfaces:
io.agentscope.harness.agent.DistributedStore

public class JdbcDistributedStore extends Object implements io.agentscope.harness.agent.DistributedStore
Multi-database JDBC-backed DistributedStore with automatic dialect detection.

Pass any JDBC DataSource and the store auto-detects the database via AbstractJdbcDialect.from(DataSource), then assembles all four components:

Usage


 DataSource dataSource = ... // HikariCP, Druid, etc.

 HarnessAgent agent = HarnessAgent.builder()
     .name("my-agent")
     .model("dashscope:qwen-plus")
     .distributedStore(JdbcDistributedStore.create(dataSource))
     .filesystem(new DockerFilesystemSpec()
             .image("ubuntu:24.04"))
     .build();
 
Author:
shanhongyu
  • 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
     
    create(DataSource dataSource)
    Creates a JDBC distributed store with auto-detected dialect and table creation.
    create(DataSource dataSource, AbstractJdbcDialect dialect)
    Creates a JDBC distributed store with an explicitly provided dialect.
    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

    • create

      public static JdbcDistributedStore create(DataSource dataSource)
      Creates a JDBC distributed store with auto-detected dialect and table creation.
      Parameters:
      dataSource - the JDBC data source for any supported database
      Returns:
      a new distributed store
    • create

      public static JdbcDistributedStore create(DataSource dataSource, AbstractJdbcDialect dialect)
      Creates a JDBC distributed store with an explicitly provided dialect.
      Parameters:
      dataSource - the JDBC data source
      dialect - the pre-built dialect (skips auto-detection)
      Returns:
      a new 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