New package: @chatcops/store-upstash-vector

Fermée
#362 2 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@srujankaleru2007 y travaille déjà.

Depuis le 27/10/2026.

  • #385 par @srujankaleru2007 — ouverte

Évaluation

Cette issue n'a pas encore été évaluée.

Description

enhancement hacktoberfest help wanted

@chatcops/core now has a VectorStore interface (#333). This adds a new package with a VectorStore backed by Upstash Vector, for serverless sites (Vercel, Netlify) that already use Upstash Redis through @chatcops/store-redis.

What every vector store needs

  • Implement VectorStore from @chatcops/core (packages/core/src/storage/types.ts): dimensions, upsert, query (cosine similarity, best first), deleteBySource, and keywordQuery where the backend has full-text search.
  • Expose it as vectors on the storage the package already returns, so runStorageConformance picks it up. Its vector section (in packages/core/src/testing/conformance.ts) is the spec: run it from the package's tests/conformance.test.ts, with at least 4 dimensions.
  • Filters follow MetadataFilter: every key must match, a value matches only the same type (1 is not "1"), an array means any of its values, and a record without the key never matches.
  • memoryVectors (packages/core/src/storage/memory-vectors.ts) is the reference implementation, and segmentWords there splits text into words with Intl.Segmenter (use it so Japanese and Chinese keyword search works).
  • Add a short section for your store under "Vector stores" in website/src/content/docs/server/storage.mdx, and a changeset for the package (minor).

For this package

  • Start from packages/store-redis for the layout: package.json ("private": true for now, @upstash/vector as a peer dependency), tsconfig.json, vitest.config.ts, README.md, CHANGELOG.md. The root vitest.config.ts and pnpm-workspace.yaml pick up new packages under packages/ on their own.
  • Export upstashVectors({ index, dimensions }) returning a VectorStore, where index is an @upstash/vector Index.
  • Upstash filters are a string syntax (locale = 'de' AND collection IN ('docs', 'pricing')). Build it from MetadataFilter with proper quoting, so a value can't change the filter.
  • keywordQuery only if the index type supports full-text (hybrid or sparse indexes). Otherwise leave it out.
  • There's no local Upstash Vector emulator, so: unit tests with a fake Index for the logic (filter building, mapping, deletes), and the conformance suite gated on CHATCOPS_TEST_UPSTASH_VECTOR_URL and CHATCOPS_TEST_UPSTASH_VECTOR_TOKEN, skipped without them. Upstash has a free tier if you'd like to run it yourself.

Acceptance criteria

  • New package builds, type-checks and passes its tests in CI
  • Conformance passes against a real index when the env variables are set (say in the PR whether you ran it)
  • Filter strings are quoted safely, with a test for a value containing a quote
  • README, a docs section and a changeset
  • pnpm test:coverage and pnpm lint pass
Langage dominant
TypeScript
Étoiles
13
Forks
7
Merge moyen
3 h 11 min
PR mergées (30 j)
330

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de codercops/chatcops

Toutes les issues de codercops/chatcops

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.