OpenViSTAI · Agents · Blockchain · Crypto
Menu
RAG & Knowledge Systems

Semantic Cache

Semantic Cache is an open-source TypeScript library for storing natural-language text and retrieving cached values by semantic similarity rather than exact string equality. It connects to an Upstash Vector database and supports query-response reuse, natural-language classification against predefined categories, configurable match thresholds, and namespaces.

Independent OpenViST project profile, based on linked sources.

Semantic Cache — OpenViST project profile in RAG & Knowledge Systems.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when an application should recognize meaning-level similarity between a new query and stored text, rather than requiring identical cache keys.

Who it is for

  • Node.js developers adding semantic matching to an application’s cache or retrieval workflow.
  • Teams seeking to reuse AI responses for similar, differently worded queries.
  • Developers classifying natural-language inputs into predefined categories.

Documented uses

  • Store a query and its associated value for later semantic retrieval.
  • Return a cached value for a sufficiently similar, paraphrased query.
  • Set a minimum similarity threshold to control what counts as a cache hit.
  • Separate cache entries into namespaces.
  • Classify natural-language text into predefined categories.
Before you choose

Requirements & limits

The repository identifies the project as open source under the MIT License.

  • An Upstash Vector database and its URL and token are required for the documented setup.
  • The database must be created with a pre-made embedding model.
  • The minProximity threshold ranges from 0 to 1; higher values require closer matches, and the documentation describes 1.00 as exact matching.
  • Multilingual queries require an embedding model that supports the languages being used.
  • The project documentation suggests smaller embedding dimensions when prioritizing latency and more dimensions when prioritizing accuracy.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up Semantic Cache in a Node.js project

Install the library and configure the Upstash Vector connection needed by the documented Node.js example.

Before you start

  • A Node.js project
  • An Upstash Vector database created with a pre-made embedding model
  • The database URL and token

Steps

  1. Install @upstash/semantic-cache and @upstash/vector with npm.

  2. Add the Upstash Vector URL and token to a .env file as UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN.

  3. Create an Index and a SemanticCache instance, passing the index and a chosen minProximity value.

Expected outcome

The project has the documented package dependencies and cache connection setup, ready for application code to use the cache API.

Guide limitations

  • The guide covers installation and configuration, not a verified deployment or successful run.
  • Cache matching depends on the selected embedding model and the chosen proximity threshold.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
upstash/semantic-cache · Official homepage title · retained in its source language