Cognipeer Console SDK

TypeScript SDK for Cognipeer Console

Official TypeScript/JavaScript SDK for Cognipeer Console. Provides type-safe access to chat completions, embeddings, vector operations, file management, agent tracing, and guardrails.

Key Features

Chat Completions

OpenAI-compatible chat API with streaming support for real-time responses.

Embeddings

Text vectorization for semantic search and RAG pipelines.

Vector Operations

Manage vector databases (Pinecone, Chroma, Qdrant, etc.) through a unified API.

File Management

Upload and manage files with optional markdown conversion for RAG ingestion.

Agent Tracing

Observability for agent executions with structured session data.

Guardrails

Evaluate content against tenant guardrail policies.

Type-Safe

Full TypeScript support with comprehensive types and ESM + CJS compatibility.

Quick Start

Install the SDK and start using Cognipeer Console services with full type safety.

Installation

npm install @cognipeer/console-sdk

Chat Completion

import { ConsoleClient } from '@cognipeer/console-sdk';

const client = new ConsoleClient({
  apiKey: 'your-api-key',
  baseURL: 'https://api.cognipeer.com',
});

// Standard completion
const response = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello!' },
  ],
});

console.log(response.choices[0].message.content);

Streaming Chat

const stream = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Tell me a story' }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

Vector Operations

// Upsert vectors
await client.vectors.upsert('my-provider', 'my-index', {
  vectors: [
    { id: 'vec1', values: [0.1, 0.2, 0.3], metadata: { text: 'Hello world' } },
  ],
});

// Query vectors
const results = await client.vectors.query('my-provider', 'my-index', {
  query: { vector: [0.1, 0.2, 0.3], topK: 5 },
});

Cognipeer Console SDK vs Alternatives

ProductPrimary RoleChat APIEmbeddingsVector OpsFile MgmtTracingGuardrailsType-SafeStreaming

Cognipeer Console SDK

Full Platform SDK

OpenAI Node SDK

Single Provider SDK

LangChain JS

LLM Framework