> ## 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.

# Agent filesystem

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

Import these **3 exports** from `@agentium/core`. Read the [agent filesystem guide](/agents/sandbox) 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.

## AgentFile

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

```typescript theme={null}
export interface AgentFile {
    path: string;
    content: string;
    updatedAt: number;
    version: number;
}
```

## AgentFileSystem

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

```typescript theme={null}
/**
 * Durable text store for notes the agent writes for its future self.
 * Not the host disk — that is FileSystemToolkit / workspace tools.
 */
export declare class AgentFileSystem {
    constructor(config?: AgentFileSystemConfig);
    resolveNamespace(ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }): string;
    writeFile(path: string, content: string, ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }, expectedVersion?: number): Promise<AgentFile>;
    readFile(path: string, ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }): Promise<AgentFile | null>;
    listFiles(ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }): Promise<string[]>;
    searchContent(query: string, ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }): Promise<Array<{
        path: string;
        snippet: string;
    }>>;
    deleteFile(path: string, ctx: {
        userId?: string;
        agentId?: string;
        sessionId?: string;
    }): Promise<boolean>;
    getTools(): ToolDef[];
}
```

Related: [`AgentFile`](/api-reference/core/fs#agentfile), [`AgentFileSystemConfig`](/api-reference/core/fs#agentfilesystemconfig), [`ToolDef`](/api-reference/core/tools#tooldef).

## AgentFileSystemConfig

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

```typescript theme={null}
export interface AgentFileSystemConfig {
    storage?: StorageDriver;
    /** Namespace prefix. `{userId}` / `{agentId}` / `{sessionId}` are substituted. Default: `fs/{agentId}/{userId}` */
    namespace?: string;
    maxFileBytes?: number;
    maxNamespaceBytes?: number;
}
```

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


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