Home
Technical documentation

Industrial engineering behind the interface.

This page is written for technical teams. Sentium doesn't ship a chat window, we deploy infrastructure: observable, scalable, and audit-ready from day one.

A production stack that integrates natively with your existing infrastructure

NEXT.JSTYPESCRIPTPRISMAPOSTGRESQLPINECONE

Retrieval pipeline

Your institutional memory is chunked, embedded and reranked. The model answers strictly from the authorized corpus; nothing else enters the context window.

  • End-to-end type-safe data layer on Node.js + Prisma
  • Multi-tenant namespace isolation
  • AES-256 encryption · GDPR- and KVKK-compliant data processing
  • Horizontal scaling for 10,000+ concurrent requests

Your data can stay in your own cloud — AWS, GCP, or on-premise

sentium/lib/rag/retrieve-context.tsTypeScript
1import { PineconeStore } from "@langchain/pinecone";
2import { OpenAIEmbeddings } from "@langchain/openai";
3import { prisma } from "@/lib/db";
4
5// Tenant-isolated retrieval — never leaves the authorized corpus.
6export async function retrieveContext(query: string, orgId: string) {
7 const store = await PineconeStore.fromExistingIndex(
8 new OpenAIEmbeddings({ model: "text-embedding-3-large" }),
9 { pineconeIndex, namespace: `org_${orgId}` },
10 );
11
12 const matches = await store.similaritySearchWithScore(query, 8);
13 const grounded = matches.filter(([, score]) => score >= 0.82);
14
15// Below the confidence threshold: no guessing, escalate to a human.
16 if (!grounded.length) return { escalate: true, context: [] };
17
18 await prisma.auditLog.create({ data: { orgId, query, hits: grounded.length } });
19 return { escalate: false, context: grounded.map(([doc]) => doc.pageContent) };
20}
index: healthy1.24M vectorsnamespace: org_*
01Retrieval and ranking
  • Hybrid retrieval: BM25 + vector search
  • Cross-encoder reranking
  • Per-chunk source attribution and score threshold
02Tool layer (MCP)
  • Type-safe tool definitions on Prisma
  • Write-level authority across CRM / ERP
  • Role-based access control (RBAC)
03Security and isolation
  • A dedicated namespace per tenant
  • Audit log written for every response
  • Deployment in your own cloud or on-premise

Let us talk to your technical team.

Start a Pilot