Skip to main content

Memory System

The PilottAI Memory System provides robust storage and retrieval capabilities for agents, enabling context preservation, knowledge persistence, and job history tracking.

Overview

The Memory System is designed to:
  • Maintain job execution history
  • Store and retrieve semantic information
  • Track agent interactions
  • Provide context for future jobs
  • Support search and similarity matching

Memory Architecture

PilottAI implements a layered memory architecture:

Basic Memory Usage

Initializing Memory

Storing Job Information

Retrieving Job History

Storing Semantic Information

Searching Memory

Enhanced Memory

PilottAI also provides an EnhancedMemory class for advanced memory capabilities:

Job Memory

Job memory stores the complete history of job execution:

Memory Maintenance

PilottAI automatically manages memory with cleanup functionality:

Memory Architecture Details

Memory Entry

Each memory entry contains:

Memory Indices

The memory system maintains several indices for efficient retrieval:
  • Job Index: Maps job IDs to related entries
  • Agent Index: Maps agent IDs to related entries
  • Tag Index: Maps tags to related entries
  • Timestamp Index: Organizes entries chronologically
  • Priority Index: Groups entries by priority level

Memory Persistence

By default, memory is stored in-memory, but PilottAI supports persistence options:

Advanced Memory Features

Pattern Recognition

The enhanced memory system can identify patterns in stored information:

Agent Interaction History

Track interactions between agents:

Job Context Building

Build rich context for new jobs based on history:

Best Practices

  1. Use Tags Consistently: Develop a consistent tagging schema for easy retrieval
  2. Prioritize Important Information: Set higher priority for critical data
  3. Cleanup Regularly: Implement regular cleanup for optimal performance
  4. Use TTL for Temporal Data: Set time-to-live for information that expires
  5. Store Structured Metadata: Use structured metadata for better searchability

Example Workflow

Here’s a complete example of memory usage in a multi-agent system:

API Reference

For a complete reference of all Memory System methods and attributes, see the Memory API documentation.