Skip to content

dlasky/vec-memory-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vec Memory CLI

A command-line tool for graph-based semantic memory using SQLite vec0 and Ollama embeddings. All output is JSON for easy parsing and tool integration.

Features

  • Semantic Search: Vector-based similarity search using embeddings
  • Graph Relationships: Create and traverse relationships between memories
  • JSON Output: All commands output JSON for easy scripting and integration
  • Flexible Storage: SQLite with vec0 extension for efficient vector operations

Prerequisites

  • Node.js 18+
  • Ollama: Install from ollama.ai or:
    • macOS: brew install ollama
    • Linux: curl -fsSL https://ollama.ai/install.sh | sh
    • Windows: Download from ollama.ai/download

Installation

From npm (recommended)

npm install -g @dlasky/vec-memory-cli

From source

npm install
npm run build

Usage

The CLI will automatically start Ollama if it's not running and download the required embedding model if needed.

Memory Commands

# Store a memory
vec-memory add "The sky is blue"
vec-memory add "Deploy failed" -m '{"severity":"high"}'

# Retrieve a memory by ID
vec-memory get <id>

# Update a memory
vec-memory update <id> --content "New content"
vec-memory update <id> --metadata '{"key":"value"}'

# Delete a memory
vec-memory delete <id>

# Semantic search
vec-memory search "what color is the sky"
vec-memory search "deploy" -n 5 -t 0.3

Relationship Commands

# Create a relationship between two memories
vec-memory relate <from-id> <to-id> causes
vec-memory relate <from-id> <to-id> related_to -s 0.8

# List relationships
vec-memory relations
vec-memory relations --memory-id <id> --type causes

# Update a relationship
vec-memory update-relation <id> --strength 0.5

# Delete a relationship
vec-memory delete-relation <id>

# Traverse the graph (BFS)
vec-memory connected <id> -d 3

Global Options

Option Default Description
--db ~/.vec-memory.db Path to SQLite database
--ollama-url http://localhost:11434 Ollama API base URL
--model nomic-embed-text Ollama embedding model

These can also be set via environment variables:

  • MEMORY_DB_PATH — Database path
  • OLLAMA_BASE_URL — Ollama URL
  • OLLAMA_MODEL — Embedding model

Architecture

  • src/index.ts — CLI entry point and command definitions
  • src/ollama.ts — Ollama management and embedding generation
  • src/database.ts — SQLite database schema and vec0 integration
  • src/memory.ts — Core memory operations and graph traversal

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors