Skip to main content
Retrieval-Augmented Generation (RAG) connects semantic vector search with generative language models. External documents are converted into dense floating-point vector representations, indexed in a vector store, and retrieved to inject factual context into the model’s prompt. RAG Workflow

Quickstart

Embeddings Capability

Specifications for /v1/embeddings parameters and vector formatting.

Model Catalog

Browse available embedding models including nusa-embedding-0001 and nv-embed-v1.

Step-by-Step Implementation

1

Install Dependencies

Install required Python libraries for OpenAI SDK and ChromaDB:
2

Define Custom Embedding Function

ChromaDB allows custom embedding wrappers to direct vectorization requests to Neosantara’s /v1/embeddings endpoint:
3

Index Knowledge Base in ChromaDB

Populate documents into a Chroma collection. The embedding function automatically projects each passage into a 768-dimensional vector space:
4

Vector Retrieval & Grounded Generation

Retrieve the closest matching passages using cosine similarity and prompt the chat completion model with grounded context:

Complete Production Script

rag_chroma_complete.py
Set temperature=0 or 0.1 during the generation stage to minimize hallucinations and enforce strict adherence to retrieved text.
The nusa-embedding-0001 model yields 768-dimensional vector embeddings and is included in Neosantara’s tier quota without separate vector charges.