module

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 embedding
  • search() - Search with automatic query embedding
  • mark_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