DEV.co
RAG Frameworks · athina-ai

rag-cookbooks

rag-cookbooks is a curated collection of Jupyter notebooks demonstrating advanced and agentic Retrieval-Augmented Generation (RAG) techniques. It provides ready-to-use implementations for improving LLM accuracy by combining external documents with AI models, progressing from naive RAG to sophisticated techniques like RAG fusion and corrective RAG.

Source: GitHub — github.com/athina-ai/rag-cookbooks
2.6k
GitHub stars
320
Forks
Jupyter Notebook
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryathina-ai/rag-cookbooks
Ownerathina-ai
Primary languageJupyter Notebook
LicenseMIT — OSI-approved
Stars2.6k
Forks320
Open issues6
Latest releaseUnknown
Last updated2025-02-17
Sourcehttps://github.com/athina-ai/rag-cookbooks

What rag-cookbooks is

The repository implements RAG architectures across indexing, retrieval, augmentation, and generation stages using frameworks like LangChain, LangGraph, and vector stores (Pinecone, Chromadb, Weaviate, FAISS, Qdrant). It covers techniques including hybrid retrieval (BM25 + vector), hypothetical document embeddings (HyDE), parent document retrieval, query rewriting, and agentic workflows with evaluation patterns.

Quickstart

Get the rag-cookbooks source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/athina-ai/rag-cookbooks.gitcd rag-cookbooks# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Building production RAG systems with evaluation pipelines

Organizations deploying LLM-powered Q&A systems, chatbots, or search can adopt these patterns directly. Notebooks include end-to-end evaluation using Athina AI, helping teams assess retrieval quality, generation accuracy, and hallucination risks before deployment.

Prototyping advanced retrieval strategies

Teams experimenting with hybrid search, multi-query generation, or contextual compression can use these implementations to benchmark approaches. Particularly useful for document-heavy domains (legal, medical, enterprise) where naive retrieval fails.

Learning RAG architecture patterns

ML engineers and researchers can study progressive complexity—from basic retrieval-augmented generation to agentic workflows—with working code and research paper references. Suitable for internal training and skill development.

Implementation considerations

  • Each notebook relies on external services (OpenAI LLMs, vector DBs) and API keys; verify pricing, rate limits, and data residency requirements before scaling.
  • Evaluation patterns use Athina AI integration; consider whether that dependency aligns with your observability/logging stack or if custom evaluation is needed.
  • Chunking strategies, embedding models, and retriever parameters are not universally optimal; experimentation on domain-specific corpora is required.
  • Agentic techniques (corrective RAG, self-RAG) introduce loops and conditional logic increasing latency and token consumption; profile costs and failure modes.
  • Notebooks assume structured/semi-structured documents; unstructured RAG technique covers text+table+image but custom preprocessing may be needed for your formats.

When to avoid it — and what to weigh

  • You need production-hardened, maintained library code — This is a cookbook/reference repository without versioned releases, dependency pinning clarity, or long-term maintenance guarantees. For production, evaluate the underlying libraries (LangChain, Chromadb, etc.) separately.
  • You require security certifications or compliance audit trails — Notebooks are educational examples without security hardening, secrets management patterns, or documented compliance controls. Not suitable for regulated environments without substantial adaptation.
  • You need real-time or low-latency inference — Notebooks focus on correctness and technique demonstration, not optimization for latency, throughput, or resource efficiency. Multi-step agentic patterns (query rewriting, fusion) add latency overhead.
  • You depend on vendor continuity or SLA support — Repository is actively updated but open-source with no commercial support, SLA, or guaranteed maintenance window. Suitable only if your team can maintain local forks and adapt code independently.

License & commercial use

MIT License. Permits commercial use, modification, and distribution with attribution. No patent protection or liability waiver beyond standard MIT terms.

MIT is a permissive OSI-approved license allowing commercial use without restriction. However, this is a reference cookbook, not a production framework; you must audit and maintain the code yourself. No indemnification or commercial support is provided by the repository maintainers. Suitable for internal development or as a foundation for your own commercial product.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Notebooks handle API keys via environment variables; no secrets management patterns (vault, secure vaults) demonstrated. Input validation and injection prevention not addressed. No threat model for multi-tenant scenarios or adversarial prompt injection. Evaluation does not cover data leakage risks. Vector DB credentials and LLM API keys embedded in notebook cells risk accidental exposure. Review and harden before handling sensitive data.

Alternatives to consider

LangChain Templates / LangSmith Docs

Official LangChain maintained examples with ongoing support, versioning, and integration with LangSmith observability. More suitable if you need vendor-backed patterns.

Llamaindex (by Jerry Liu)

Alternative RAG orchestration framework with similar cookbook examples, stronger data indexing abstractions, and active maintainer community. Choose if you prefer different API design or ecosystem.

Internal experimentation + academic papers

If your domain is highly specialized (biomedical, financial), building custom RAG patterns directly from cited research papers may yield better results than generic recipes.

Software development agency

Build on rag-cookbooks with DEV.co software developers

Explore our advanced RAG implementation guides, adapt techniques to your domain, and evaluate performance with end-to-end examples.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

rag-cookbooks FAQ

Can I use these notebooks directly in production?
No. Notebooks are educational prototypes. For production, extract patterns into modular, tested code; add error handling, logging, secrets management, and performance monitoring. Evaluate LangChain, vector DB, and LLM service stability separately.
What LLM must I use?
Notebooks default to OpenAI (gpt-3.5, gpt-4). You can substitute any LLM with compatible prompt formats; open-source models (Llama, Mistral) via Hugging Face or local APIs require prompt engineering adjustments.
How do I evaluate if my RAG system is working?
Notebooks include Athina AI evaluation (retrieval relevance, generation quality). Supplement with domain-specific metrics: F1 for retrieval, ROUGE/BLEU for generation, user feedback loops, and hallucination audits. Build your own evaluation harness if Athina does not fit your stack.
Which vector database should I choose?
Repository demonstrates Pinecone (managed, closed-source), Chromadb (open, lightweight), Weaviate (open, production-ready), FAISS (CPU/GPU, no server), Qdrant (open, high-performance). Choice depends on scale, latency SLA, cost model, and operational overhead tolerance.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like rag-cookbooks. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across rag frameworks and beyond.

Build production RAG systems with proven patterns

Explore our advanced RAG implementation guides, adapt techniques to your domain, and evaluate performance with end-to-end examples.