docs: add a minimal opentenbase_ai + pgvector integration example (embedding + similarity search)

Ouverte
#325 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

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

Personne n'a encore pris cette issue.

  • #327 par @muzimu217 — fermée sans fusion

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
35/100
Type d'issue
Documentation
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
postgresql, sql

Piste de recherche

Read contrib/opentenbase_ai/opentenbase_ai--1.0.sql for the documented function signatures, then check the bundled contrib/pgvector and contrib/pgsql-http setup. Draft one self-contained document under contrib/opentenbase_ai/ covering model registration, embedding casts, inserts, similarity search, and the stated limits and FAQ. Done when the example is runnable as written and clearly labels verified steps versus expected results.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Motivation

Issue #304 tracks a README for contrib/opentenbase_ai. While walking through the extension's SQL interface (opentenbase_ai--1.0.sql), I noticed there is no runnable end-to-end example showing how opentenbase_ai combines with the bundled contrib/pgvector (the vector extension) — which is the most natural way to evaluate this extension in practice: register an embedding model, store embeddings in a table, and run a similarity search.

Proposal

Add a single self-contained example document under contrib/opentenbase_ai/, covering:

  1. Prerequisites — both dependencies are bundled in this repo: http (contrib/pgsql-http, declared by opentenbase_ai.control via requires = 'http') and vector (contrib/pgvector).
  2. Register an OpenAI-compatible embedding model with ai.add_embedding_model(model_name, uri, default_args, token).
  3. Call ai.embedding(input) — note it returns text (the JSON array extracted from the HTTP response), so the example shows the explicit ::vector cast into a pgvector column.
  4. Create a vector column table, insert, and run a nearest-neighbour query with the pgvector distance operators.
  5. Notes and limits: which steps are verified vs. expected results (clearly labeled), behavior when the endpoint is unreachable (the invoke path surfaces errors rather than silently returning NULL), and a short FAQ.

The example will follow the exact function signatures in opentenbase_ai--1.0.sql and will not touch any existing file or build script — one new documentation file only.

I'll follow up with a PR referencing this issue.

Langage dominant
C
Étoiles
946
Forks
693
Merge moyen
5 min
PR mergées (30 j)
1

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 OpenTenBase/OpenTenBase

Toutes les issues de OpenTenBase/OpenTenBase

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

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