Moving from LangChain or LlamaIndex? The full guide with 5 real, runnable
side-by-side comparisons lives at
MIGRATION.md
in the repo root. This page is a short teaser.
What's covered in the full guide
- Basic ingest + query — LangChain/LlamaIndex need a text splitter,
embedding client, vectorstore, and chain/query-engine assembled
separately;
ragleap-ragis oneRagLeap(...)object. - Provider fallback — LangChain has no first-class automatic
fallback between providers;
ragleap-raghasfallbacks=built in, plusresult["provider_used"]to know which one actually answered. - Cost tracking — real per-call cost, monthly budgets, and automatic downgrade to a cheaper fallback when a budget is hit.
- Swapping vector backends — one line changes
(
vector_backend=FAISSBackend(...)vsPgVectorBackend(...)), rest of your ingest/query code is identical. - What you gain vs. give up — an honest comparison table, including where LangChain's larger ecosystem still wins (600+ integrations vs. ragleap-rag's 8 embedding providers + 6 vector backends).
Quick taste
# Before (LangChain): splitter, embeddings, vectorstore, chain — 4 objects
# After (ragleap-rag):
from ragleap import RagLeap, ProviderConfig, EmbeddingConfig
rag = RagLeap(
database_url="postgresql://user:pass@localhost:5432/mydb",
primary=ProviderConfig(provider="gemini", model="gemini-3.6-flash", api_key="..."),
embedder=EmbeddingConfig(provider="gemini", model="models/gemini-embedding-001",
dimensions=3072, api_key="..."),
)
rag.init_schema()
rag.ingest_text(filename="doc.txt", text=raw_text)
answer = rag.ask("What is the budget?")
A note on accuracy
LangChain's and LlamaIndex's APIs change fairly often between versions. The comparisons in the full guide reflect patterns that have been broadly stable, but verify against your own installed versions before relying on them for a real migration.
Read the full guide: MIGRATION.md