Skip to content

About

Minimal RAG example using LangChain + Claude

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

langchain-example

A minimal Retrieval-Augmented Generation (RAG) example using LangChain and Claude.

What it does

  • Loads a small markdown knowledge base from data/
  • Splits and embeds it locally with a HuggingFace sentence-transformers model (no embeddings API key needed)
  • Stores the embeddings in a Chroma vector index
  • Answers questions by retrieving relevant chunks and passing them to Claude (claude-opus-4-8 via langchain-anthropic)

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env
# edit .env and set ANTHROPIC_API_KEY

Run

python rag_example.py

This asks a few sample questions against data/orbit_notes.md and prints Claude's answers, including one question ("Does Orbit integrate with Jira?") that isn't covered by the docs, to show the model declining to guess.

Extending

  • Add more .md files under data/ — they're picked up automatically.
  • Swap Chroma for another LangChain-supported vector store (e.g. FAISS, Pinecone).
  • Swap the local embeddings model for a hosted one (e.g. Voyage AI, which Anthropic recommends for embeddings) by replacing HuggingFaceEmbeddings in rag_example.py.

About

Minimal RAG example using LangChain + Claude

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages