AIOS Docs
  • Welcome
  • Getting Started
    • Installation
    • Quickstart
      • Use Terminal
      • Use WebUI
    • Environment Variables Configuration
  • AIOS Kernel
    • Overview
    • LLM Core(s)
      • LiteLLM Compatible Backend
      • vLLM Backend
      • Hugging Face Backend
      • LLM Routing
    • Scheduler
      • FIFOScheduler
      • RRScheduler
    • Context
    • Memory
      • Base Layer
      • Agentic Memory Operations
    • Storage
      • sto_mount
      • sto_create_file
      • sto_create_directory
      • sto_write
      • sto_retrieve
      • sto_rollback
      • sto_share
    • Tools
    • Access
    • Syscalls
    • Terminal
  • AIOS Agent
    • How to Use Agent
    • How to Develop Agents
      • Develop with Native SDK
      • Develop with AutoGen
      • Develop with Open-Interpreter
      • Develop with MetaGPT
    • How to Publish Agents
  • AIOS-Agent SDK
    • Overview
    • LLM Core API
      • llm_chat
      • llm_chat_with_json_output
      • llm_chat_with_tool_call_output
      • llm_call_tool
      • llm_operate_file
    • Memory API
      • create_memory
      • get_memory
      • update_memory
      • delete_memory
      • search_memories
      • create_agentic_memory
    • Storage API
      • mount
      • create_file
      • create_dir
      • write_file
      • retrieve_file
      • rollback_file
      • share_file
    • Tool API
      • How to Develop Tools
    • Access API
    • Post API
    • Agent API
  • Community
    • How to Contribute
Powered by GitBook
On this page
  • Two-Tier Memory Architecture for Agents
  • Memory Manager
  1. AIOS Kernel

Memory

PreviousContextNextBase Layer

Last updated 1 month ago

Two-Tier Memory Architecture for Agents

The system employs a two-tier memory architecture consisting of:

  1. Memory Manager (RAM-based): Handles transient, session-specific data for active agents. Memory is cleared when the agent session ends.

  2. Storage Manager (Persistent Storage): Ensures long-term storage for evicted or overflowed memory blocks.

Memory Manager

The Memory Manager is responsible for managing temporary memory stored in RAM during an agent's active tasks or sessions.

Components

  • Compressed Block: Primary unit of memory, containing interaction history in a compressed format.

  • Memory Limit: Defines the maximum amount of memory an agent can use in RAM.

  • Eviction Strategy: Implements a policy to evict blocks to persistent storage when memory usage exceeds the limit, ensuring efficient memory management.

Memory Flow

  1. Interaction data is compressed into blocks and stored in the agent's memory.

  2. Each agent's memory operates within a predefined limit.

  3. When the accumulated memory reaches the limit:

    • Blocks are evicted based on the eviction strategy.

    • Evicted blocks are moved to the Storage Manager for persistent storage.

Key Modules

Module
Purpose
Key Classes

Memory Processing

Core memory operations

BaseMemoryManager, MemoryNote

Vector Retrieval

Semantic search backend

ChromaRetriever, SimpleEmbeddingRetriever

Content Analysis

Cognitive processing

execute_memory_content_analyze

Memory Evolution

Autonomous adaptation

execute_memory_evolve

TODO

  • Privacy Mechanism: Add a system to restrict agents from accessing the memory of other agents, ensuring data privacy.

  • Memory Optimization: Improve the structure and efficiency of the memory management system.

How data swap occurs between memory and storage manager