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

# File System

> Zeus file system architecture

> The storage architecture design for Zeus Agent, consisting of two core components: Checkpoint (state persistence) and Backend (file storage).

***

## Architecture Overview

```mermaid theme={null}
flowchart TB
    subgraph DeepAgent["DeepAgent"]
        FileTools["File Tools"]
        Memory["Memory (custom implementation)"]
        StateManager["State Manager"]
    end

    subgraph CloudDrive["CloudDriveBackend"]
        Redis["Redis Cache"]
        Supabase["Supabase Storage"]
        Redis <--> Supabase
        Paths["/workspace/ artifact files\n/memory/ long-term memory"]
    end

    subgraph Checkpoint["PostgresSaver"]
        CheckpointDB["Checkpoint (HITL/recovery)"]
    end

    FileTools --> CloudDrive
    Memory --> CloudDrive
    StateManager --> Checkpoint

    CloudDrive --> SupabaseStorage[("Supabase Storage\nUser Cloud Drive")]
    Checkpoint --> PostgreSQL[("PostgreSQL")]
```

***

## Core Components

| Component        | Purpose                                          | Storage Location | Documentation                 |
| ---------------- | ------------------------------------------------ | ---------------- | ----------------------------- |
| **Checkpointer** | Agent state persistence, HITL interrupt recovery | PostgreSQL       | [Checkpoint.md](./Checkpoint) |
| **Backend**      | File system operations, user cloud drive         | Supabase Storage | [Backend.md](./Backend)       |
| **Memory**       | Long-term memory (custom implementation)         | Supabase Storage | [Backend.md](./Backend)       |

***

## Quick Comparison

| Aspect                     | Checkpointer           | Backend           | Memory                     |
| -------------------------- | ---------------------- | ----------------- | -------------------------- |
| **Stored Content**         | Agent execution state  | Files/artifacts   | User knowledge/preferences |
| **Granularity**            | Per execution step     | File operations   | Concept-level              |
| **Lifecycle**              | Session-level          | User-level        | Permanent                  |
| **Accessed By**            | LangGraph internals    | Agent tools       | Custom logic               |
| **Current Implementation** | DrizzleCheckpointSaver | StateBackend      | InMemoryStore              |
| **Target Implementation**  | PostgresSaver          | CloudDriveBackend | Supabase Storage           |

***

## Migration Priority

1. **High Priority**: [Checkpoint](./Checkpoint) - Affects HITL feature stability
2. **Medium Priority**: [Backend](./Backend) - Affects artifact persistence and user experience
3. **Low Priority**: Redis Cache - Performance optimization, can be added later

***

## Environment Variables

The following environment variables need to be configured:

* `DATABASE_URL` - PostgreSQL connection URL (for Checkpointer)
* `SUPABASE_URL` - Supabase Storage URL (for Backend)
* `SUPABASE_SERVICE_KEY` - Supabase Service Key (for Backend)
* `REDIS_URL` - Redis connection URL (optional, for caching)
