Layer 2: RAG & Vector Database Auto-Instrumentation (shdw.wrapVectorStore)

Automated AI-BOM (4 Layers)
#rag#vector-db#pinecone#pgvector#weaviate#qdrant#wrapVectorStore#embedding_model_id#spdx

Automatically link Pinecone, Supabase pgvector, Weaviate, Qdrant, and embedding models to your CycloneDX and SPDX 3.0 AI-BOM lineage graphs.

How It Works Under the Hood
  • •Calling shdw.wrapVectorStore(vectorClient, { sourceUrl, embeddingModelId }) registers your active vector knowledge base on the ShdwTelemetryClient instance.
  • •Every subsequent LLM telemetry event automatically includes vector_db_connected: true, vector_db_source_url, and embedding_model_id.
  • •When you export SPDX 3.0 AI Profile (.spdx.json) or CycloneDX v1.7 (.cdx.json), SHDWsdk automatically generates DatasetPackage nodes with dependsOn and trainedOn relationship edges.
How to Use It Step-by-Step
  1. 1Call shdw.wrapVectorStore() with your Pinecone index, Supabase client, or vector retriever.
  2. 2Specify the sourceUrl (e.g., https://index.pinecone.io/prod-kb or pgvector://supabase.db/documents) and embeddingModelId (e.g., text-embedding-3-large).
Auto-Instrumenting Pinecone or Supabase pgvector
import { Pinecone } from "@pinecone-database/pinecone";
import { ShdwTelemetryClient } from "@shdwsdk/sdk";

const shdw = new ShdwTelemetryClient({ apiKey: process.env.SHDW_API_KEY! });
const pc = new Pinecone({ apiKey: process.env.PINECONE_API_KEY! });

// Automatically links RAG dataset & embedding model to your AI-BOM
export const kbIndex = shdw.wrapVectorStore(pc.index("enterprise-contracts"), {
  sourceUrl: "https://index.pinecone.io/enterprise-contracts",
  embeddingModelId: "text-embedding-3-large",
  workloadName: "Contract RAG Copilot",
});

Related guides