#langchain

22 snippets tagged with #langchain

pythonbeginner

LangChain Prompt Chain (Python)

Build a simple LLMChain with a prompt template and ChatOpenAI in LangChain.

Best for: prompt chaining

#langchain#openai
typescriptadvanced

LangChain RAG Chain Pipeline

Build a retrieval-augmented generation chain with LangChain using vector store retrieval and prompt templates.

Best for: Document Q&A

#langchain#rag
pythonadvanced

Build a RAG Pipeline with LangChain

Implement retrieval-augmented generation using LangChain, embeddings, and a vector store.

Best for: Knowledge base Q&A

#ai#langchain
pythonintermediate

LangChain Conversation with Memory

Maintain conversation context across turns using LangChain memory modules.

Best for: Multi-turn chatbots

#ai#langchain
pythonintermediate

LangChain Tool-Using Agent

Build a LangChain agent with custom tools for web search, calculator, and Python REPL.

Best for: AI agents

#langchain#agent
pythonadvanced

RAG with FAISS and LangChain Python

Build a local RAG pipeline using FAISS vector store and LangChain for document Q&A.

Best for: document Q&A

#rag#faiss
pythonintermediate

Structured LLM Output with Pydantic

Parse LLM responses into validated Pydantic models using LangChain's structured output binding.

Best for: structured extraction

#langchain#pydantic
pythonintermediate

LangChain Conversation with Memory

Build a stateful chatbot that remembers conversation history using LangChain memory.

Best for: stateful chatbots

#langchain#memory
pythonadvanced

LangChain SQL Database Agent

Create an AI agent that answers natural language questions by querying a SQL database.

Best for: NL2SQL

#langchain#sql
pythonbeginner

LangChain Recursive Text Splitter

Split long documents into overlapping chunks optimised for LLM context windows.

Best for: PDF ingestion

#langchain#text-splitting
pythonintermediate

LangChain Few-Shot Prompt Examples

Improve LLM accuracy with dynamic few-shot examples selected by semantic similarity.

Best for: few-shot learning

#langchain#few-shot
pythonintermediate

LangChain Output Parser for Code

Parse AI-generated code blocks with LangChain's custom output parsers to extract clean code.

Best for: code extraction

#langchain#output-parser
pythonadvanced

LangChain ReAct Agent Pattern

Implement a ReAct (Reason+Act) agent that thinks step-by-step before calling tools.

Best for: reasoning agents

#langchain#react
pythonintermediate

LangChain create_sql_query_chain

Generate SQL from natural language using LangChain's create_sql_query_chain with schema awareness.

Best for: NL to SQL

#langchain#nl2sql
pythonintermediate

LangChain Sequential Multi-Step Chain

Build a multi-step reasoning pipeline where each step's output feeds into the next chain.

Best for: multi-step AI pipelines

#langchain#sequential
pythonintermediate

LangChain Streaming Callback Handler

Capture LLM tokens as they stream using a custom callback handler for real-time UI updates.

Best for: streaming UI

#langchain#callbacks
pythonintermediate

LangChain Pydantic Output Parser

Use LangChain's PydanticOutputParser to reliably parse structured data from LLM text responses.

Best for: information extraction

#langchain#pydantic
pythonadvanced

LangChain RAG Retrieval Chain

Build a full RAG pipeline with source citations using LangChain's create_retrieval_chain.

Best for: RAG with citations

#langchain#rag
pythonadvanced

LangChain Agent with Persistent Memory

Build an AI agent that persists conversation context across sessions using LangChain memory stores.

Best for: persistent agents

#langchain#agent
pythonintermediate

LangChain Agent with Tavily Web Search

Build a ReAct agent that searches the web in real-time using the Tavily search tool.

Best for: web search AI

#langchain#tavily
pythonadvanced

Graph RAG with Neo4j and LangChain

Build a graph-based RAG system using Neo4j knowledge graph for complex relationship queries.

Best for: knowledge graph Q&A

#neo4j#graph-rag
pythonadvanced

LangChain Self-Query Retriever

Enable natural language metadata filtering in vector search with LangChain's SelfQueryRetriever.

Best for: metadata filtering

#langchain#self-query