Retrieval-Augmented Generation (RAG) combines the power of LLMs with your own data. Cognipeer Console acts as the unified gateway — managing vector databases, generating embeddings, and serving chat completions. Console SDK gives you type-safe access to all these capabilities.
This guide shows how to build a document Q&A system over your internal knowledge base.
When to reach for this recipe
If your team needs the capabilities described above and you'd rather build on proven primitives than wire one from scratch — this is the shape to start from.
Architecture
Console provides the infrastructure layer: OpenAI-compatible API for embeddings, vector orchestration across multiple providers (Pinecone, Qdrant, Chroma, etc.), and the files pipeline for document ingestion.
Console SDK is the TypeScript client that ties everything together with full type safety and streaming support.
1. Set Up Console SDK Client
Install the SDK and create a client pointing to your Console instance.
24content:`Answer using the following context:\n\n${context}`,
25},
26{role:"user",content: question },
27],
28});
29
30return response.choices[0].message.content;
31}
32
33constanswer=awaitragQuery("How does vector orchestration work?");
34console.log(answer);
Result
You now have a complete RAG pipeline that:
- Ingests documents through the files pipeline with automatic Markdown conversion
- Embeds text chunks through a unified API across any model provider
- Stores vectors in your choice of vector database (Pinecone, Qdrant, Chroma, etc.)
- Queries semantically and generates context-aware answers
- Scales across providers with Console routing and fallback