> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage

> Public storage signatures and configuration in @agentium/core 4.0.0.

Import these **13 exports** from `@agentium/core`. Read the [storage guide](/storage/overview) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## DynamoDBStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/dynamodb.ts)

```typescript theme={null}
export declare class DynamoDBStorage implements StorageDriver {
    constructor(config?: DynamoDBStorageConfig);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`DynamoDBStorageConfig`](/api-reference/core/storage#dynamodbstorageconfig), [`StorageDriver`](/api-reference/core/storage#storagedriver).

## DynamoDBStorageConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/dynamodb.ts)

```typescript theme={null}
export interface DynamoDBStorageConfig {
    tableName?: string;
    region?: string;
    endpoint?: string;
    credentials?: {
        accessKeyId: string;
        secretAccessKey: string;
    };
}
```

## InMemoryStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/in-memory.ts)

```typescript theme={null}
export declare class InMemoryStorage implements StorageDriver {
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver).

## MongoDBStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/mongodb.ts)

```typescript theme={null}
export declare class MongoDBStorage implements StorageDriver {
    constructor(uri: string, dbName?: string, collectionName?: string);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver).

## MySQLStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/mysql.ts)

```typescript theme={null}
export declare class MySQLStorage implements StorageDriver {
    constructor(config?: MySQLStorageConfig);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`MySQLStorageConfig`](/api-reference/core/storage#mysqlstorageconfig), [`StorageDriver`](/api-reference/core/storage#storagedriver).

## MySQLStorageConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/mysql.ts)

```typescript theme={null}
export interface MySQLStorageConfig {
    host?: string;
    port?: number;
    user?: string;
    password?: string;
    database?: string;
    connectionString?: string;
    tableName?: string;
}
```

## PostgresStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/postgres.ts)

```typescript theme={null}
export declare class PostgresStorage implements StorageDriver {
    constructor(connectionString: string);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver).

## RedisStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/redis.ts)

```typescript theme={null}
export declare class RedisStorage implements StorageDriver {
    constructor(config?: RedisStorageConfig);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`RedisStorageConfig`](/api-reference/core/storage#redisstorageconfig), [`StorageDriver`](/api-reference/core/storage#storagedriver).

## RedisStorageConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/redis.ts)

```typescript theme={null}
export interface RedisStorageConfig {
    host?: string;
    port?: number;
    password?: string;
    db?: number;
    url?: string;
    keyPrefix?: string;
    ttl?: number;
}
```

## ScopedStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/scoped.ts)

```typescript theme={null}
/**
 * Wraps any `StorageDriver` and namespaces every key by tenant / user, providing
 * multi-tenant isolation without requiring per-driver changes.
 *
 * Namespace transformation:
 *   "sessions" + scope { tenantId: "acme", userId: "u1" }
 *   -> "tenant:acme:user:u1:sessions"
 */
export declare class ScopedStorage implements StorageDriver {
    constructor(inner: StorageDriver, scope: StorageScope);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver), [`StorageScope`](/api-reference/core/storage#storagescope).

## SqliteStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/sqlite.ts)

```typescript theme={null}
export declare class SqliteStorage implements StorageDriver {
    constructor(dbPath: string);
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver).

## StorageDriver

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/driver.ts)

```typescript theme={null}
export interface StorageDriver {
    initialize?(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
}
```

## StorageScope

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/storage/scoped.ts)

```typescript theme={null}
export interface StorageScope {
    /** Tenant / organization identifier. */
    tenantId?: string;
    /** User identifier within the tenant. */
    userId?: string;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.