AI студия Владимира Ломтева
УСЛУГИПРОЕКТЫСТАТЬИБАЗА ЗНАНИЙМаркетплейсПолезные сервисы

Оставьте заявку,
чтобы обсудить проект

Напишите ваш вопрос, не забудьте указать телефон. Мы перезвоним и все расскажем.

Контакты

Москва

Работаем по всей России
и миру (онлайн)

+7 (999) 760-24-41

Ежедневно с 9:00 до 21:00

lamooof@gmail.com

По вопросам сотрудничества

TelegramWhatsApp

Есть предложение?

Напишите нам в мессенджеры

© 2025 AI студия Владимира Ломтева

Политика конфиденциальностиСогласие на обработку ПДн|ИНН 623412173261
    Upstash Redis Js — Скилл для ИИ-агентов | AI Рассвет

    Upstash Redis Js

    Work with the Upstash Redis TypeScript/JavaScript SDK for serverless Redis operations. Use for caching, session storage, rate limiting, leaderboards, full text search (querying, filtering, aggregating) with Upstash Redis Search (different from regular FT.SEARCH), and all Redis data structures. Supports automatic serialization/deserialization of JavaScript types. Upstash Redis Search also available via @upstash/search redis and @upstash/search ioredis adapters for TCP clients.

    Скиллы для операций#GitHub#upstash/skills#skills.sh
    Скачивания
    0
    В избранном
    0
    Комментарии
    0
    Просмотры
    2

    Установить скилл

    Добавьте инструмент одной командой или скачайте проверенный архив версии.

    npx skills add upstash/skills --skill upstash-redis-js
    Скачать ZIP
    Версия
    1.0.0+f7ad88b9aaab
    Автор
    Владимир Ломтев
    Репозиторий
    upstash/skills
    GitHub: upstash/skills

    Как установить

    1. 1Скопируйте команду из блока установки.
    2. 2Запустите её в терминале из каталога проекта.

    Документация

    Upstash Redis SDK - Complete Skills Guide

    This directory contains comprehensive guides for using the @upstash/redis SDK. These skill files are designed to help developers and AI assistants understand and use the SDK effectively.

    Installation

    npm install @upstash/redis
    

    Quick Start

    Basic Initialization

    import { Redis } from "@upstash/redis";
    
    // Initialize with explicit credentials
    const redis = new Redis({
      url: "UPSTASH_REDIS_REST_URL",
      token: "UPSTASH_REDIS_REST_TOKEN",
    });
    
    // Or initialize from environment variables
    const redis = Redis.fromEnv();
    

    Environment Variables

    Set these in your .env file:

    UPSTASH_REDIS_REST_URL=https://your-redis.upstash.io
    UPSTASH_REDIS_REST_TOKEN=your-token-here
    

    No credentials yet? If you're an agent that needs scratch Redis and the user hasn't provided a database, you can mint a temporary one with a single POST to https://upstash.com/start-redis (3-day TTL, no signup).

    Skill Files Overview

    Data Structures (data-structures/)

    Redis data types with auto-serialization examples:

    • strings.md - GET, SET, INCR, DECR, APPEND with automatic type handling
    • hashes.md - HSET, HGET, HMGET with object serialization
    • lists.md - LPUSH, RPUSH, LRANGE with array handling
    • sets.md - SADD, SMEMBERS, set operations
    • sorted-sets.md - ZADD, ZRANGE, ZRANK, leaderboard patterns
    • json.md - JSON.SET, JSON.GET, JSONPath queries for nested objects
    • streams.md - XADD, XREAD, XGROUP, consumer groups

    Advanced Features (advanced-features/)

    Complex operations and optimizations:

    • auto-pipeline.md - Automatic request batching, performance optimization
    • pipeline-and-transactions.md - Manual pipelines, MULTI/EXEC for atomic operations
    • scripting.md - Lua scripts, EVAL, EVALSHA for server-side logic

    Patterns (patterns/)

    Common use cases and architectural patterns:

    • caching.md - Cache-aside, write-through, TTL strategies
    • rate-limiting.md - Integration with @upstash/ratelimit package
    • session-management.md - Session storage and user state management
    • distributed-locks.md - Lock implementations, deadlock prevention
    • leaderboard.md - Sorted set leaderboards, real-time rankings

    Performance (performance/)

    Optimization techniques and best practices:

    • batching-operations.md - MGET, MSET, batch operations
    • pipeline-optimization.md - When to use pipelines, performance tips
    • ttl-expiration.md - Key expiration strategies, memory management
    • data-serialization.md - Deep dive into auto serialization, custom serializers, edge cases
    • error-handling.md - Error types, retry strategies, timeout handling, debugging tips
    • redis-replicas.md - Global database setup, read replicas, read-your-writes consistency

    Search (search/)

    Full-text search, filtering, and aggregation extension for Redis:

    • overview.md - Schema definition, field types, pitfalls, package overview
    • commands/querying.md - Query and count with filters, pagination, sorting, highlighting
    • commands/aggregating.md - Metric aggregations ($avg, $sum, $stats), bucket aggregations ($terms, $range, $histogram, $facet)
    • commands/index-management.md - Create, describe, drop indexes, waitIndexing
    • commands/aliases.md - Index aliases for zero-downtime reindexing
    • adapters.md - Using search with node-redis and ioredis via @upstash/search-redis and @upstash/search-ioredis

    Migrations (migrations/)

    Migration guides from other libraries:

    • from-ioredis.md - Migration from ioredis, key differences, serialization changes
    • from-redis-node.md - Migration from node-redis, API differences

    Common Mistakes (Especially for LLMs)

    ❌ Mistake 1: Treating Everything as Strings

    // ❌ WRONG - Don't do this with @upstash/redis
    await redis.set("count", "42"); // Stored as string "42"
    const count = await redis.get("count");
    const incremented = parseInt(count) + 1; // Manual parsing needed
    
    // ✅ CORRECT - Let the SDK handle it
    await redis.set("count", 42); // Stored as number
    const count = await redis.get("count");
    const incremented = count + 1; // Just use it
    

    ❌ Mistake 2: Manual JSON Serialization

    // ❌ WRONG - Unnecessary with @upstash/redis
    await redis.set("user", JSON.stringify({ name: "Alice" }));
    const user = JSON.parse(await redis.get("user"));
    
    // ✅ CORRECT - Automatic handling
    await redis.set("user", { name: "Alice" });
    const user = await redis.get("user");
    

    Quick Command Reference

    // Strings
    await redis.set("key", "value");
    await redis.get("key");
    await redis.incr("counter");
    await redis.decr("counter");
    
    // Hashes
    await redis.hset("user:1", { name: "Alice", age: 30 });
    await redis.hget("user:1", "name");
    await redis.hgetall("user:1");
    
    // Lists
    await redis.lpush("tasks", "task1", "task2");
    await redis.rpush("tasks", "task3");
    await redis.lrange("tasks", 0, -1);
    
    // Sets
    await redis.sadd("tags", "javascript", "redis");
    await redis.smembers("tags");
    
    // Sorted Sets
    await redis.zadd("leaderboard", { score: 100, member: "player1" });
    await redis.zrange("leaderboard", 0, -1);
    
    // JSON
    await redis.json.set("user:1", "$", { name: "Alice", address: { city: "NYC" } });
    await redis.json.get("user:1");
    
    // Expiration
    await redis.setex("session", 3600, { userId: "123" });
    await redis.expire("key", 60);
    await redis.ttl("key");
    

    Best Practices

    1. Use environment variables for credentials, never hardcode
    2. Leverage auto-serialization - pass native JavaScript types
    3. Use TypeScript types for better type safety
    4. Set appropriate TTLs to manage memory
    5. Use pipelines for multiple operations
    6. Namespace your keys (e.g., user:123, session:abc)

    Resources

    • Official Documentation
    • GitHub Repository
    • API Reference
    • Examples

    Getting Help

    For detailed information on specific topics, refer to the individual skill files in the skills/ directory. Each file contains comprehensive examples, use cases, and best practices for its topic.

    Требования и возможности

    Источник пакета
    https://github.com/upstash/skills/tree/f7ad88b9aaabaaca97feef5ef7e29f00be34d6fa/skills/upstash-redis-js

    Файлы версии

    ПутьРазмерSHA256
    SKILL.md68378b0ae5fdae60a3b1...
    advanced-features/auto-pipeline.md13761558035c43a9e9c6...
    advanced-features/pipeline-and-transactions.md253396e1a65af28bedf5...
    advanced-features/scripting.md2864c798969813f90446...
    data-structures/hashes.md1851232784e77a16eeed...

    Частые вопросы

    Как установить Upstash Redis Js?
    Используйте команду npx skills add upstash/skills --skill upstash-redis-js или скачайте ZIP-архив.
    Можно ли скачать Upstash Redis Js бесплатно?
    Да, опубликованную версию можно скачать из маркетплейса бесплатно.

    Похожие инструменты

    Смотреть все
    Story Long Write长篇网文写作。从大纲到正文,辅助长篇网络小说的创作,包括世界观、人物、情节线管理。触发方式:/story-long-write、/写长篇、「帮我开书」「写大纲」「日更」「续写」「继续写」「修改第X章」「回炉」「重写第X章」。Parallel Deep ResearchONLY use when user explicitly says 'deep research', 'exhaustive', 'comprehensive report', or 'thorough investigation'. Slower and more expensive than parallel-web-search. For normal research/lookup requests, use parallel-web-search instead. Supports multi-turn: pass --previous-interaction-id from a prior research or enrichment to continue with context.LangfuseInteract with Langfuse and access its documentation: tracing, monitoring, creating datasets, running experiments, and evaluating AI applications. Use when needing to (1) query or modify Langfuse data, (2) look up Langfuse documentation, concepts, integration guides, a feature or SDK usage, or (3) do any AI engineering task (AI observability, prompt engineering/management, evaluation and evaluator management, experimentation, dataset management, evaluation-driven CI/CD, feedback collection). Invoke it for tasks in this scope even when Langfuse is not configured or explicitly mentioned.
    Комментарии

    Войдите, чтобы оставить комментарий.

    Комментариев пока нет.

    Установить скилл

    Добавьте инструмент одной командой или скачайте проверенный архив версии.

    npx skills add upstash/skills --skill upstash-redis-js
    Скачать ZIP
    Версия
    1.0.0+f7ad88b9aaab
    Автор
    Владимир Ломтев
    Репозиторий
    upstash/skills
    GitHub: upstash/skills
    Excel Automation>