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 testingSqliteStore- Persistent storage using SQLite databaseFileStore- File-based storage with JSON or MessagePack formats
§Vector Memory & Semantic Search
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 featuresSee the vector module documentation for detailed examples.
§Migration Utilities
migrate_memory- Migrate data between different backendsexport_to_json/import_from_json- JSON backup/restoreexport_to_msgpack/import_from_msgpack- MessagePack backup/restore
Modules§
Structs§
- File
Store - A file-based implementation of the
Memorytrait. - InMemory
Store - An in-memory implementation of the
Memorytrait. - Memory
Entry - A stored conversation between an agent and user.
- Sqlite
Store - A SQLite-backed implementation of the
Memorytrait.
Enums§
- Storage
Format - 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.