Pinecone Vector Database Component — sgcAI | eSeGeCe

Vector Database (Pinecone)

TsgcAIDatabaseVectorPinecone puts your embeddings in a managed Pinecone index. Ingest batches every vector into a single upsert, and a query returns the stored text behind the nearest match, so a corpus can be shared across machines and users.

TsgcAIDatabaseVectorPinecone

The cloud counterpart of the file store. Same interface, same calls, but the index lives in Pinecone and scales past what fits in memory.

Component class

TsgcAIDatabaseVectorPinecone

Purpose

Managed vector index

Platforms

Win32 and Win64

sgcAI is self-contained. This component ships inside sgcAI together with the sgcWebSockets Core runtime it is built on, so there is no base license to buy.

Ingest to Pinecone, query from anywhere

Set the API key, environment, index and project, assign it to an embeddings component.

uses
  sgcAI, sgcAI_DB_Vector_Pinecone, sgcAI_OpenAI_Embeddings;

var
  oDB: TsgcAIDatabaseVectorPinecone;
  oEmbeddings: TsgcAIOpenAIEmbeddings;
begin
  oDB := TsgcAIDatabaseVectorPinecone.Create(nil);
  oDB.PineconeOptions.ApiKey           := 'pc-...';
  oDB.PineconeOptions.Environment      := 'us-west4-gcp-free';
  oDB.PineconeIndexOptions.IndexName   := 'sgc-embeddings';
  oDB.PineconeIndexOptions.ProjectId   := 'abcd1234';

  oEmbeddings := TsgcAIOpenAIEmbeddings.Create(nil);
  oEmbeddings.OpenAIOptions.ApiKey := 'sk-...';
  oEmbeddings.Database := oDB;

  // Every chunk is batched into a single upsert.
  oEmbeddings.CreateEmbeddingsFromFile('manual.txt');

  // Retrieve context for a question.
  Memo1.Text := oEmbeddings.GetEmbedding('How do I reset the device?', '');
end;
// includes: sgcAI.hpp, sgcAI_DB_Vector_Pinecone.hpp

TsgcAIDatabaseVectorPinecone *oDB = new TsgcAIDatabaseVectorPinecone(NULL);
oDB->PineconeOptions->ApiKey         = "pc-...";
oDB->PineconeOptions->Environment    = "us-west4-gcp-free";
oDB->PineconeIndexOptions->IndexName = "sgc-embeddings";
oDB->PineconeIndexOptions->ProjectId = "abcd1234";

oDB->BeginAddData();
oDB->AddData("Reset procedure: hold the button for 10 seconds.", vVector);
oDB->EndAddData();

String vBest = oDB->QueryData(vQueryVector);

Key properties & methods

The members you reach for most often.

PineconeOptions

ApiKey and Environment authenticate against your Pinecone account and select the region the index lives in.

PineconeIndexOptions

IndexName and ProjectId address the specific index. Both appear in the Pinecone console.

Ingest

BeginAddData starts collecting, AddData queues a text and its vector, and EndAddData sends the whole batch as one upsert instead of one request per chunk.

Query

QueryData issues a similarity query against the index and returns the stored text behind the best match.

Id control

OnBeginAddData sets the first id and the id label for the batch, so several ingests can coexist in one index without colliding.

When to use it

Best when the corpus outgrows a local file, when several applications share one index, or when ingest and query happen on different machines.

Specifications & references

Authoritative sources for the services and protocols this component uses.

Keep exploring

Online HelpFull API reference and usage guide for the sgcAI components.
All sgcAI ComponentsBrowse the full feature matrix of all 15 components.
Download Free TrialPush your embeddings to a managed index and query them.
PricingSingle, Team and Site licenses, full source code, no base product required.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Ready to Get Started?

Download the free trial and put your corpus in a managed vector index.