redis-om

Redis OM (Object Mapping), a high-level client for using Redis as a primary database. Helps define schemas, store JSON documents, perform full-text and vector similarity search, and build real-time applications, using Redis Stack's JSON, Search, and Vector features via an ORM-like interface without calling low-level commands directly.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "redis-om" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c58a8c50b99e57fe3fbfa24acc8162ea17c886d238c9199fd507d31c8e9088f4. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Redis OM (Object Mapping), a high-level client for using Redis as a primary database. Helps define schemas, store JSON documents, perform full-text and vector similarity search, and build real-time applications, using Redis Stack's JSON, Search, and Vector features via an ORM-like interface without calling low-level commands directly.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: redis-om
description: >-
  You are an expert in Redis OM (Object Mapping), the high-level client for
  working with Redis as a primary database. You help developers define
  schemas, store JSON documents, perform full-text search, vector similarity
  search, and build real-time applications — using Redis Stack's JSON, Search,
  and Vector capabilities through an ORM-like interface instead of raw
  commands.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Backend Development
  tags:
    - redis
    - orm
    - search
    - json
    - vector
    - caching
    - database

Redis OM — Object Mapping for Redis

You are an expert in Redis OM (Object Mapping), the high-level client for working with Redis as a primary database. You help developers define schemas, store JSON documents, perform full-text search, vector similarity search, and build real-time applications — using Redis Stack's JSON, Search, and Vector capabilities through an ORM-like interface instead of raw commands.

Core Capabilities

Schema and Repository

import { Client, Schema, Repository, EntityId } from "redis-om";

const client = await new Client().open(process.env.REDIS_URL);

// Define schema
const productSchema = new Schema("product", {
  name: { type: "string" },
  description: { type: "text" },          // Full-text searchable
  price: { type: "number", sortable: true },
  category: { type: "string[]" },         // Array of tags
  inStock: { type: "boolean" },
  embedding: { type: "number[]" },        // Vector for similarity search
  createdAt: { type: "date", sortable: true },
  location: { type: "point" },            // Geo coordinates
});

const productRepo = new Repository(productSchema, client);

// Create index (run once)
await productRepo.createIndex();

// CRUD operations
const product = await productRepo.save({
  name: "Wireless Keyboard",
  description: "Ergonomic bluetooth keyboard with backlight and long battery life",
  price: 79.99,
  category: ["electronics", "peripherals"],
  inStock: true,
  embedding: await getEmbedding("wireless keyboard ergonomic"),  // 1536-dim vector
  createdAt: new Date(),
  location: { longitude: -122.4194, latitude: 37.7749 },
});

const id = product[EntityId];              // Auto-generated ULID
const fetched = await productRepo.fetch(id);

Search and Queries

// Full-text search
const results = await productRepo.search()
  .where("description").matches("ergonomic bluetooth")
  .and("inStock").is.true()
  .and("price").is.between(50, 150)
  .sortBy("price", "ASC")
  .page(0, 20)
  .return.all();

// Tag filtering
const electronics = await productRepo.search()
  .where("category").contains("electronics")
  .return.all();

// Geo search — products near San Francisco
const nearby = await productRepo.search()
  .where("location").inRadius(
    (circle) => circle.origin(-122.4194, 37.7749).radius(10).miles
  )
  .return.all();

// Vector similarity search (semantic search)
const queryEmbedding = await getEmbedding("comfortable typing experience");
const similar = await productRepo.search()
  .where("embedding").nearest(queryEmbedding, 10)  // Top 10 nearest
  .return.all();

// Count
const count = await productRepo.search()
  .where("inStock").is.true()
  .return.count();

Python

from redis_om import HashModel, Field, Migrator
from redis_om import get_redis_connection

redis = get_redis_connection(url="redis://localhost:6379")

class Product(HashModel):
    name: str = Field(index=True)
    description: str = Field(index=True, full_text_search=True)
    price: float = Field(index=True, sortable=True)
    category: str = Field(index=True)
    in_stock: bool = Field(index=True, default=True)

    class Meta:
        database = redis

Migrator().run()                           # Create indexes

# Save
product = Product(name="Wireless Mouse", description="Ergonomic wireless mouse", price=49.99, category="electronics")
product.save()

# Query
results = Product.find(
    (Product.category == "electronics") &
    (Product.price < 100) &
    (Product.in_stock == True)
).sort_by("price").all()

Installation

# TypeScript
npm install redis-om

# Python
pip install redis-om

# Redis Stack (includes JSON + Search + Vector)
docker run -p 6379:6379 redis/redis-stack:latest

Best Practices

  1. Redis Stack required — Redis OM needs Redis Stack (JSON + Search modules); regular Redis won't work
  2. Create index once — Call createIndex() on startup or migration; indexes enable all search features
  3. Full-text vs exact — Use text type for full-text search, string for exact match/filtering
  4. Vector search — Store embeddings as number[]; query with .nearest() for semantic similarity
  5. Sortable fields — Mark fields as sortable: true to enable .sortBy(); adds index overhead
  6. Pagination — Use .page(offset, count) for large result sets; don't fetch all at once
  7. Geo queries — Use point type for location-based search; radius queries built-in
  8. Performance — Sub-millisecond reads/writes; Redis OM adds minimal overhead over raw commands

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 Redis OM 对象映射的完整解决方案,涵盖模式定义、JSON 存储、全文搜索、向量相似性搜索等高级功能
  • 面向开发者群体,解决 Redis 作为主数据库时的 ORM 抽象需求,具有明确的技术实用价值
Trigger Precision90/100

Highlights

  • description 完整描述了 Redis OM 专家角色和核心能力,触发词清晰覆盖 TypeScript/Python 示例、安装命令等关键信息
Structure and Standards90/100

Highlights

  • 结构清晰包含 Core Capabilities/Installation/Best Practices 等章节,frontmatter 完整,代码示例丰富
Execution Reliability90/100

Highlights

  • 工具来源明确(redis-om npm/pip 包),参数使用正确,覆盖主要异常场景,安装命令准确
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.