Persistent memory for LLMs and apps. Content-addressed storage with dedupe, compression, full-text and vector search.
  • C++ 93.1%
  • Python 2.4%
  • Shell 1.6%
  • Meson 1.6%
  • Lean 0.7%
  • Other 0.6%
Find a file
2025-08-21 17:28:01 +00:00
.conan v0.2.6 2025-08-14 06:52:24 -04:00
.devcontainer yams 2025-08-10 23:41:49 -04:00
.github/workflows v0.4.6 2025-08-21 17:28:01 +00:00
cmake yams 2025-08-10 23:41:49 -04:00
conan/profiles changelog updates v0.0.3 2025-08-11 11:11:19 -04:00
data v0.1.5 2025-08-13 19:25:31 -04:00
docker/local-ci v0.0.5 2025-08-11 20:35:51 -04:00
docs v0.4.2 2025-08-21 00:06:31 +00:00
examples v0.4.0 staging 2025-08-20 12:17:48 -04:00
include/yams v0.4.6 2025-08-21 17:28:01 +00:00
packaging v0.4.2 2025-08-21 00:06:31 +00:00
public v0.2.0 2025-08-13 23:11:02 -04:00
scripts v0.4.0 2025-08-20 14:02:06 -04:00
sql yams 2025-08-10 23:41:49 -04:00
src v0.4.6 2025-08-21 17:28:01 +00:00
tests v0.4.6 2025-08-21 17:28:01 +00:00
tools v0.4.0 staging 2025-08-20 12:17:48 -04:00
.clang-format v0.3.3 clang-format now in use 2025-08-15 15:51:18 -04:00
.cppcheck-suppressions v0.4.0 2025-08-20 14:02:06 -04:00
.dockerignore v0.2.4 2025-08-14 01:49:02 -04:00
.gitignore v0.4.0 staging 2025-08-20 12:17:48 -04:00
CHANGELOG.md v0.4.6 2025-08-21 17:28:01 +00:00
CMakeLists.txt v0.4.3 ci bump with extras 2025-08-21 00:56:25 +00:00
CMakePresets.json v0.4.0 staging 2025-08-20 12:17:48 -04:00
CMakeUserPresets.json v0.4.6 2025-08-21 17:28:01 +00:00
conanfile.py v0.4.3 ci bump with extras 2025-08-21 00:56:25 +00:00
Dockerfile v0.4.4 2025-08-21 06:05:46 +00:00
LICENSE yams 2025-08-10 23:41:49 -04:00
mkdocs.yml v0.4.0 staging 2025-08-20 12:17:48 -04:00
NOTICE yams 2025-08-10 23:41:49 -04:00
README.md v0.4.2 2025-08-21 00:06:31 +00:00
spdlog.pc yams 2025-08-10 23:41:49 -04:00

Release CI

YAMS - Yet Another Memory System

Persistent memory for LLMs and applications. Content-addressed storage with deduplication, semantic search, and full-text indexing.

My prompt for CLI usage is PROMPT.md and PROMPT-eng.md for programming. I added additional prompts for research with MCP usage. These prompts are subject to change with experimentation

Features

  • Content-Addressed Storage - SHA-256 based, ensures data integrity
  • Deduplication - Block-level with Rabin fingerprinting
  • Compression - Zstandard and LZMA with intelligent policies
  • Search - Full-text (SQLite FTS5) and semantic (vector embeddings)
  • Crash Recovery - Write-ahead logging for durability
  • High Performance - 100MB/s+ throughput, thread-safe

Versioning

YAMS provides comprehensive versioning through content-addressed storage. Every stored document gets a unique SHA-256 hash that serves as an immutable version identifier. You can track changes using metadata updates (yams update), organize versions with collections (--collection release-v1.0), and capture point-in-time states with snapshots (--snapshot-id 2024Q4).

Installation

Supported platforms:

  • Linux x86_64, ARM64
  • macOS x86_64 (Intel), ARM64 (Apple Silicon)

Package Managers

Docker:

docker run --rm -it ghcr.io/trvon/yams:latest --version

Linux Packages:

# DEB (Debian/Ubuntu)
curl -L https://github.com/trvon/yams/releases/latest/download/yams-latest-amd64.deb -o yams.deb
sudo dpkg -i yams.deb
sudo apt-get install -f  # Fix any dependency issues

# RPM (Fedora/RedHat/CentOS)  
curl -L https://github.com/trvon/yams/releases/latest/download/yams-latest-x86_64.rpm -o yams.rpm
sudo dnf install ./yams.rpm

# AppImage (Universal Linux - no installation required)
curl -L https://github.com/trvon/yams/releases/latest/download/yams-latest-x86_64.AppImage -o yams
chmod +x yams
./yams --version

Homebrew (coming soon):

brew tap trvon/yams && brew install yams

Binary Downloads

For systems where packages aren't available:

# Linux x86_64
curl -L https://github.com/trvon/yams/releases/latest/download/yams-linux-x86_64.tar.gz | tar xz
sudo mv bin/yams /usr/local/bin/

# macOS ARM64 (Apple Silicon)
curl -L https://github.com/trvon/yams/releases/latest/download/yams-macos-arm64.zip -o yams.zip
unzip yams.zip && sudo mv bin/yams /usr/local/bin/

# macOS x86_64 (Intel)
curl -L https://github.com/trvon/yams/releases/latest/download/yams-macos-x86_64.zip -o yams.zip  
unzip yams.zip && sudo mv bin/yams /usr/local/bin/

Build

# Install Conan
pip install conan

# One-time: create default Conan profile
conan profile detect --force

# Build with Conan (recommended - this is what creates the release binaries)
conan install . --output-folder=build/conan-release -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release
sudo cmake --install build/conan-release/build/Release

Requirements:

  • C++20 compiler (GCC 11+, Clang 14+, AppleClang 14+)
  • CMake 3.20+
  • Python 3.8+ (for Conan)

Known Issue: Traditional CMake builds (without Conan) currently have dependency resolution issues. Use Conan builds for reliable compilation.

Build Options

Option Default Description
YAMS_USE_CONAN OFF Use Conan package manager
YAMS_BUILD_CLI ON CLI with TUI browser
YAMS_BUILD_MCP_SERVER ON MCP server (requires Boost)
YAMS_BUILD_TESTS OFF Unit and integration tests
YAMS_BUILD_BENCHMARKS OFF Performance benchmarks
YAMS_ENABLE_PDF ON PDF text extraction support
CMAKE_BUILD_TYPE Release Debug/Release/RelWithDebInfo

Dependencies

# macOS
brew install openssl@3 protobuf sqlite3 ncurses
export OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)

# Linux
apt install libssl-dev libsqlite3-dev protobuf-compiler libncurses-dev

Setup

# Initialize with XDG defaults (non-interactive)
yams init --non-interactive

# Optional: custom storage root
export YAMS_STORAGE="$HOME/.local/share/yams"
yams init --non-interactive

# Print resulting config (secrets masked)
yams init --non-interactive --print

Troubleshooting

If you see:

ERROR: The default build profile '/home/trevon/.conan2/profiles/default' doesn't exist.
You need to create a default profile (type 'conan profile detect' command)
or specify your own profile with '--profile:build=<myprofile>'

Fix:

# Create default profile
conan profile detect --force

# Optional: ensure C++20 in the default profile
# Linux/macOS (GNU sed):
sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' ~/.conan2/profiles/default || true
# macOS (BSD sed):
# sed -i '' 's/compiler.cppstd=.*/compiler.cppstd=20/' ~/.conan2/profiles/default || true

Then re-run:

conan install . \
  --output-folder=build/conan-ninja-release \
  -s build_type=Release \
  --build=missing

cmake --preset conan-ninja-release
cmake --build build/conan-ninja-release -j

PDF Support Issues

If PDF extraction fails or PDFium download fails:

# Disable PDF support temporarily
cmake -B build -DYAMS_ENABLE_PDF=OFF

# Or explicitly specify a different PDFium version if needed
# (check https://github.com/bblanchon/pdfium-binaries/releases for available versions)

If you see network errors during PDFium download:

  • Check internet connectivity
  • Corporate firewalls may block GitHub releases
  • Consider using a VPN or different network
  • PDFium binaries are ~20MB per platform

LLM Integration Guide

YAMS is designed to work seamlessly with Large Language Models through simple, pipeline-friendly commands:

# Store conversation context with descriptive name
echo "User asked about X, I explained Y" | yams add - --name "context-$(date +%Y%m%d).txt"

# Store code snippets with tags
echo "def function(): return 42" | yams add - --name "helper.py" --tags "python,utils"

# Delete temporary files by pattern
yams delete --pattern "temp_*.txt" --force

# Delete multiple specific files
yams delete --names "draft1.md,draft2.md,notes.txt"

# Retrieve documents by name (coming soon)
# yams get --name "meeting-notes.txt"

# Search with fuzzy matching
yams search "databse" --fuzzy --similarity 0.8

# List with rich metadata
yams list --format table --limit 20

# Chain commands for batch operations
yams list --format minimal | tail -5 | while read hash; do
  yams get $hash
done

# Preview deletions before executing
yams delete --pattern "*.log" --dry-run

Best Practices for LLMs

  1. Use stdin for content storage: Avoids file creation

    echo "content to store" | yams add -
    
  2. Use minimal format for piping: Clean output for processing

    yams list --format minimal | head -5
    
  3. Explicit data directory: Always specify storage location

    yams --data-dir /tmp/project-memory add -
    
  4. JSON for structured data: Parse responses easily

    yams stats --format json | jq '.totalObjects'
    
  5. Direct stdout retrieval: No intermediate files

    yams get <hash> | process_somehow
    

Usage

MCP Server

Start the MCP server (stdio transport only):

yams serve

MCP Integration

{
  "mcpServers": {
    "yams": {
      "command": "/usr/local/bin/yams",
      "args": ["serve"],
      "env": {}
    }
  }
}

CLI Usage

Initialize Storage

# One-time setup with defaults
yams init --non-interactive --no-keygen

# Custom storage location
yams --data-dir /path/to/storage init --non-interactive

Store Documents

# Add a file
yams add file.txt

# Add from stdin
echo "content" | yams add -
cat file.txt | yams add -

# Add multiple files
find . -name "*.txt" -exec yams add {} \;

List Documents

# Table format (default)
yams list

# JSON output for programmatic use
yams list --format json

# Just hashes for piping
yams list --format minimal

# Sort and filter
yams list --sort size --reverse --limit 10
yams list --sort date

Retrieve Documents

# Output to stdout
yams get <hash>

# Save to file
yams get <hash> -o output.txt

# Pipe to other commands
yams get <hash> | grep pattern
yams get <hash> | wc -l

# Get first document from list
yams list --format minimal --limit 1 | xargs yams get

Browse Documents (TUI)

# Launch ranger-style browser
yams browse

# Navigation:
#   j/k or ↑/↓     - Move up/down
#   h/l or ←/→     - Switch columns
#   g/G           - Jump to top/bottom
#   d then D      - Delete document
#   r             - Refresh
#   ?             - Help
#   q or Esc      - Quit

yams search "query" --limit 10 yams search "error" --type "log" yams search "call(" --paths-only --literal-text # treat query as literal text, not regex

Retrieve

yams get yams get --output file.txt

List & Stats

yams list --recent 20 yams stats --json # JSON output for scripts

Browse (interactive TUI)

yams browse # Interactive document browser


### API
```cpp
#include <yams/api/content_store.h>

auto store = yams::api::createContentStore(getenv("YAMS_STORAGE"));

// Store
yams::api::ContentMetadata meta{.tags = {"code", "v1.0"}};
auto result = store->store("file.txt", meta);

// Search
auto results = store->search("query", 10);

// Retrieve
store->retrieve(hash, "output.txt");

Python

import subprocess, json

def yams_store(content, tags=[], type="text"):
    cmd = ["yams", "store", content]
    if tags: cmd.extend(["--tags", ",".join(tags)])
    if type: cmd.extend(["--type", type])
    return subprocess.run(cmd, capture_output=True, text=True)

def yams_search(query, limit=10):
    cmd = ["yams", "search", query, "--limit", str(limit)]
    return subprocess.run(cmd, capture_output=True, text=True)

LLM Usage Guide

Quick Start for LLMs

# Always specify data directory explicitly
export YAMS_STORAGE="/tmp/yams-data"

# Initialize once (quiet mode)
yams --data-dir "$YAMS_STORAGE" init --non-interactive --force

# Store content from stdin (most common for LLMs)
echo "Important information to remember" | yams --data-dir "$YAMS_STORAGE" add --tags "memory"

# Search for content
yams --data-dir "$YAMS_STORAGE" search "important" --json

# Retrieve specific document
yams --data-dir "$YAMS_STORAGE" get <hash> --json

# Get storage statistics
yams --data-dir "$YAMS_STORAGE" stats --json

Common Patterns

# Store code changes
git diff | yams --data-dir "$YAMS_STORAGE" add --tags "git-diff,$(date +%Y%m%d)"

# Store conversation context
echo "User asked about: $TOPIC" | yams --data-dir "$YAMS_STORAGE" add --tags "context,$TOPIC"

# Store external documentation
curl -s "$API_DOCS_URL" | yams --data-dir "$YAMS_STORAGE" add --tags "api-docs,external"

# Search and retrieve in one line
hash=$(yams --data-dir "$YAMS_STORAGE" search "$QUERY" --json | jq -r '.results[0].hash')
yams --data-dir "$YAMS_STORAGE" get "$hash"

LLM Integration

When to Use YAMS

YAMS is ideal for LLMs to maintain persistent memory across sessions:

  • Code Development: Track changes, store working versions, remember context
  • Research: Cache web content, API responses, documentation
  • Conversation Context: Store important discussions, decisions, requirements
  • Knowledge Base: Build searchable repository of project knowledge

CLI Usage Examples

Development Workflow

# Store current code state before making changes
git diff | yams add - --tags "pre-refactor,auth-module,$(date +%Y%m%d)"

# Track implementation decisions
echo "Decided to use JWT tokens with 24h expiry for auth" | yams add - \
  --tags "decision,auth,architecture"

# Store error context for debugging
tail -100 app.log | yams add - --tags "error,production,$(date +%Y%m%d-%H%M)"

# Save working implementation
yams add auth_handler.py --tags "working,auth,v2.1"

Research & Documentation

# Store web research
curl -s https://api.example.com/docs | yams add - \
  --tags "api-docs,external,example-api" \
  --source "https://api.example.com/docs"

# Cache fetched content
echo "$WEB_CONTENT" | yams add - --tags "research,oauth,implementation-guide"

# Store meeting notes
yams add meeting-notes-2024-01-15.md --tags "meeting,requirements,client"

Search Patterns

# Find related code changes
yams search "authentication" --type "code" --limit 10

# Retrieve specific version
yams search "working auth" --tags "v2.1"

# Get recent errors
yams list --recent 20 --tags "error"

# Semantic search for concepts
yams search "token expiry handling"

MCP (Model Context Protocol) Integration

MCP provides direct integration with Claude Desktop and other MCP-compatible clients.

Performance Tuning

Optimize for large files:

# Adjust chunk size for better deduplication
export YAMS_CHUNK_SIZE=64KB  # Default: 16KB

# Increase cache size
export YAMS_CACHE_SIZE=1GB   # Default: 256MB

Reduce memory usage:

# Add a large file (streamed from disk)
yams add large-file.bin

# Enable compression
export YAMS_COMPRESSION=zstd  # Options: none, zstd, lzma

License

Apache-2.0