Module memory

Module memory 

Source
Expand description

Memory system for storing and retrieving agent conversation history.

This module provides types and traits for implementing memory storage, allowing agents to maintain context across multiple conversations.

§Available Backends

  • InMemoryStore - Fast, volatile storage for development and testing
  • SqliteStore - Persistent storage using SQLite database
  • FileStore - File-based storage with JSON or MessagePack formats

The vector module provides semantic search capabilities using vector embeddings:

  • Local Vector Store - In-memory vector storage with cosine similarity search
  • Embedding Providers - OpenAI, Ollama, Hugging Face, and custom embedding models
  • Caching Layer - Efficient embedding caching to reduce API costs
  • Semantic Search - Find similar memories based on meaning, not just keywords

Enable vector memory features in Cargo.toml:

[dependencies]
ceylon = { version = "*", features = ["vector-openai"] }       # For OpenAI embeddings
ceylon = { version = "*", features = ["vector-ollama"] }       # For Ollama embeddings
ceylon = { version = "*", features = ["vector-huggingface"] }  # For Hugging Face embeddings
ceylon = { version = "*", features = ["full-vector"] }         # For all vector features

See the vector module documentation for detailed examples.

§Migration Utilities

Modules§

advanced
Advanced Memory Management System
vector
Vector memory and semantic search capabilities.

Structs§

FileStore
A file-based implementation of the Memory trait.
InMemoryStore
An in-memory implementation of the Memory trait.
MemoryEntry
A stored conversation between an agent and user.
SqliteStore
A SQLite-backed implementation of the Memory trait.

Enums§

StorageFormat
Serialization format for file-based storage

Traits§

Memory
Trait for implementing memory storage backends.

Functions§

export_to_json
Exports all memory entries to a JSON file.
export_to_msgpack
Exports all memory entries to a MessagePack file.
import_from_json
Imports memory entries from a JSON file.
import_from_msgpack
Imports memory entries from a MessagePack file.
migrate_memory
Migrates memory entries from one backend to another.