# RAG Stack

> Gated, eval-driven workflow for building production RAG with LangChain.js, LangGraph.js, Langfuse and Supabase pgvector.

RAG Stack is a paid AI agent skill on Agensi by Akmal Haziq. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9 (one-time purchase)
- Creator: [Akmal Haziq](https://www.agensi.io/creators/haziq)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/rag-stack

## About this skill

Build every RAG system the same way: clarify first, measure before building,
test on a pilot before embedding everything, and never advance a phase until
its gate passes. Langfuse is where everything is observed: traces, prompts,
datasets, experiments, scores, and human annotation.

| Layer | Tool | Why it matters |
|---|---|---|
| Loading, splitting, embeddings, retrievers, LLM calls | **LangChain.js** (`@langchain/*`) | Every LLM/embedding call goes through LangChain so the Langfuse callback traces it |
| Orchestration — every runtime flow, even the minimal one | **LangGraph.js** | One graph shape from Phase 5 to production; nodes are traced spans |
| Tracing, prompt management, datasets, experiments, scores, annotation queues | **Langfuse** (JS/TS SDK v5) | Single place to track performance and review chats |
| Vector store | **Supabase pgvector** by default; larger corpora → options in `references/vector-stores.md` | Hybrid search, filters and access control in one Postgres |
| API / runtime / deploy | **Node.js + TypeScript + Fastify** on **Railway** | |
| LLM | Anthropic Claude via `@langchain/anthropic` (model ID from env) | |

Never substitute LlamaIndex, Haystack, LangSmith, a raw provider SDK, or a
hand-rolled framework unless the user explicitly asks. Never pick a vector
store other than pgvector on your own: if the size check says the corpus is
large, present the options from `references/vector-stores.md` and let the
user decide. If the user asks for Python, use the Python equivalents.

APIs in this stack change fast. Before writing code, check current docs for
package versions and import paths. Treat code in references/ as patterns.

## Requires

- Node.js + TypeScript
- Supabase (pgvector)
- Langfuse account
- Anthropic API key
- OpenAI API key (embeddings)
- tsx
- Optional: FFmpeg
- Optional: Cohere or Voyage API key
- Optional: Railway

## Known limitations

Opinionated stack: does not cover LlamaIndex, Haystack or LangSmith unless asked. Code in references is patterns, not a runnable repo; npm scripts assume the rag-stack template layout.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the RAG Stack skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does RAG Stack do?

Gated, eval-driven workflow for building production RAG with LangChain.js, LangGraph.js, Langfuse and Supabase pgvector.

### Which AI agents support RAG Stack?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use RAG Stack?

Connect your AI agent to Agensi through MCP, then ask it to use RAG Stack on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
