RAG Pipeline
Scaffolds a Retrieval-Augmented Generation pipeline in TypeScript. Implements document ingestion, configurable chunking strategies, embedding generation, vector storage, similarity retrieval, and LLM-powered answer generation with source citations. No LangChain — all components are built from first principles using the provider SDKs directly. Defaults to AWS Bedrock (Claude via Converse with prompt caching for generation, Titan v2 for embeddings, on IRSA — no keys). Supports multiple vector stores (pgvector, Chroma, Qdrant, Pinecone), alternate embedding providers (OpenAI, Cohere), and alternate LLM providers (Anthropic, OpenAI).
| Name | rag-pipeline |
| Version | 0.1.0 |
| Category | ai-systems |
| License | Apache-2.0 |
| Persona | engineering |
| Tags | typescript, rag, embeddings, vector-search, llm, retrieval, ai |
| Source | templates/rag-pipeline |
Render it
Three front doors, one catalog. Pick whichever suits the caller.
# CLI
npx @nanohype/sdk render rag-pipeline --out ./my-app
# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "rag-pipeline", variables);
# MCP — from an agent
get_template({ name: "rag-pipeline" })Prerequisites
| Tool | Version | Why |
|---|---|---|
node | >=24 | Node.js runtime for TypeScript execution |
Variables
Required
ProjectNamestring- Kebab-case project name, used in package.json and directory names Must be lowercase kebab-case starting with a letter.
Optional
Descriptionstring — defaults toA retrieval-augmented generation pipeline- Short project description for package.json and README
VectorStorestring — defaults tochroma- Vector database backend for storing and querying embeddings (e.g. chroma, pgvector, qdrant, pinecone)
EmbeddingProviderstring — defaults tobedrock- Provider for text embeddings — bedrock (Titan v2, default), openai, or cohere
LlmProviderstring — defaults tobedrock- LLM provider for answer generation — bedrock (default), anthropic, or openai
ChunkStrategystring — defaults torecursive- Text chunking strategy for splitting documents
IncludeTestsbool — defaults totrue- Include vitest test suite with chunking, retrieval, and registry tests
What it produces
38 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.
.dockerignore
.env.example
.github/workflows/ci.yml
.gitignore
biome.json
Dockerfile
package.json
README.md
src/__tests__/chunking.test.ts
src/__tests__/pipeline.integration.test.ts
src/__tests__/registry.test.ts
src/__tests__/retrieval.test.ts
src/bootstrap.ts
src/chunking.ts
src/config.ts
src/generation.ts
src/index.ts
src/ingest.ts
src/logger.ts
src/providers/__tests__/chroma.integration.test.ts
src/providers/anthropic.ts
src/providers/bedrock.ts
src/providers/chroma.ts
src/providers/cohere.ts
src/providers/index.ts
src/providers/mock-vectorstore.ts
src/providers/mock.ts
src/providers/openai.ts
src/providers/pgvector.ts
src/providers/pinecone.ts
src/providers/qdrant.ts
src/providers/registry.ts
src/providers/types.ts
src/resilience/__tests__/circuit-breaker.test.ts
src/resilience/circuit-breaker.ts
src/retrieval.ts
tsconfig.json
vitest.config.tsComposes with
- Pairs with
agentic-loop - Pairs with
eval-harness - Pairs with
go-service - Nests inside
monorepo
Composites that use it
- AI Web Application — Full-stack web application with Next.js frontend, RAG pipeline, authentication, database, and deployment..
- Document Intelligence — Document search and question-answering system with RAG pipeline, HTTP service, file storage, database, and deployment..
- Enterprise AI Infrastructure — Full enterprise AI stack with agents, tool servers, safety guardrails, evaluation, prompt management, observability, and Kubernetes deployment..
- RAG-Powered Agent — AI agent that uses retrieval-augmented generation as a tool.