Cognipeer Console SDK
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
OpenAI-compatible chat API with streaming support for real-time responses.
Text vectorization for semantic search and RAG pipelines.
Manage vector databases (Pinecone, Chroma, Qdrant, etc.) through a unified API.
Upload and manage files with optional markdown conversion for RAG ingestion.
Observability for agent executions with structured session data.
Evaluate content against tenant guardrail policies.
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
| Product | Primary Role | Chat API | Embeddings | Vector Ops | File Mgmt | Tracing | Guardrails | Type-Safe | Streaming |
|---|---|---|---|---|---|---|---|---|---|
Cognipeer Console SDK | Full Platform SDK | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
OpenAI Node SDK | Single Provider SDK | ✓ | ✓ | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ |
LangChain JS | LLM Framework | ✓ | ✓ | △ | ✕ | △ | ✕ | △ | ✓ |