New package: @chatcops/store-upstash-vector

Cerrado
#362 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@srujankaleru2007 ya está trabajando en esto.

Desde el 27/10/2026.

  • #385 de @srujankaleru2007 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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
Lenguaje dominante
TypeScript
Estrellas
13
Forks
7
Merge medio
3 h 11 min
PR fusionados (30 d)
330

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codercops/chatcops

Todos los issues de codercops/chatcops

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.