Memo
Memo - Semantic search and vector storage library
A focused library for chunking, embedding, and searching text using vector similarity. Designed to be embedded in applications that need semantic search capabilities.
Quick Start
require "memo"
# Initialize database
db = DB.open("sqlite3://app.db")
Memo::Database.load_schema(db)
# Create service (handles embeddings internally)
memo = Memo::Service.new(
db: db,
provider: "openai",
api_key: ENV["OPENAI_API_KEY"]
)
# Index a document
memo.index(
source_type: "document",
source_id: 42,
text: "Your document text..."
)
# Search
results = memo.search(query: "search query", limit: 10)
API
The primary API is Memo::Service which provides:
index()- Index documents with automatic chunking and embeddingsearch()- Search with automatic query embeddingmark_as_read()- Track chunk usage
Internal modules (Storage, Search, Chunking, RRF) remain accessible for advanced use cases but Service is the recommended entry point.
Constants
VERSION = "0.12.1"
Nested types
- Memo::ArcanaService
- Memo::CLI
- Memo::Chunking
- Memo::Clustering
- Memo::Config
- Memo::Database
- Memo::Dialect
- Memo::Document
- Memo::ExternalId
- Memo::Files
- Memo::Namespaces
- Memo::Providers
- Memo::Queries
- Memo::QueryCache
- Memo::RRF
- Memo::Search
- Memo::Service
- Memo::ServiceProvider
- Memo::SourceRegistry
- Memo::Stats
- Memo::Storage
- Memo::USearchIndex
- Memo::Vocab