Class PostgresDistributedStore

java.lang.Object
io.agentscope.extensions.postgresql.PostgresDistributedStore
All Implemented Interfaces:
io.agentscope.harness.agent.DistributedStore

@Deprecated(since="2.1", forRemoval=true) public class PostgresDistributedStore extends Object implements io.agentscope.harness.agent.DistributedStore
Deprecated, for removal: This API element is subject to removal in a future version.
Use io.agentscope.extensions.jdbc.JdbcDistributedStore from the agentscope-extensions-jdbc module instead. The new module provides a unified multi-database dialect abstraction that supports MySQL, PostgreSQL, H2, and SQLite with a single aggregated interface. This class is preserved unchanged for backward compatibility and will be removed in a future major release.
PostgreSQL-backed DistributedStore.

Usage:


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

 HarnessAgent agent = HarnessAgent.builder()
     .name("my-agent")
     .model("dashscope:qwen-plus")
     .distributedStore(PostgresDistributedStore.create(dataSource))
     .filesystem(new DockerFilesystemSpec()
             .image("ubuntu:24.04"))
     .build();
 

This configures:

The target database must already exist; schema and tables are created automatically by default.

  • 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
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    io.agentscope.harness.agent.filesystem.remote.store.BaseStore
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    create(DataSource dataSource)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a PostgreSQL distributed store.
    io.agentscope.harness.agent.sandbox.SandboxExecutionGuard
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    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 PostgresDistributedStore create(DataSource dataSource)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a PostgreSQL distributed store.
      Parameters:
      dataSource - JDBC data source for PostgreSQL
      Returns:
      a new PostgreSQL distributed store
    • agentStateStore

      public io.agentscope.core.state.AgentStateStore agentStateStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      agentStateStore in interface io.agentscope.harness.agent.DistributedStore
    • baseStore

      public io.agentscope.harness.agent.filesystem.remote.store.BaseStore baseStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      baseStore in interface io.agentscope.harness.agent.DistributedStore
    • sandboxSnapshotSpec

      public io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec sandboxSnapshotSpec()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      sandboxSnapshotSpec in interface io.agentscope.harness.agent.DistributedStore
    • sandboxExecutionGuard

      public io.agentscope.harness.agent.sandbox.SandboxExecutionGuard sandboxExecutionGuard()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      sandboxExecutionGuard in interface io.agentscope.harness.agent.DistributedStore