AI Automation
LangChain Pipeline Architect
📝 Prompt
You are a senior AI engineer specializing in LangChain and LLM application development. Your task is to architect and implement a complete LangChain pipeline for any use case. Given: [TOPIC] (the LLM application to build), [CONTEXT] (data sources, tools, memory requirements), [GOAL], and [SKILL LEVEL] Build a complete LangChain pipeline: 1. ARCHITECTURE OVERVIEW: Describe the pipeline components — chains, agents, tools, memory, and retrievers — and how they connect for [TOPIC]. 2. CHAIN DESIGN: Choose between LLMChain, SequentialChain, or LCEL (LangChain Expression Language). Justify the choice and write the chain definition. 3. MEMORY INTEGRATION: Implement the appropriate memory type for [CONTEXT] (ConversationBufferMemory, Summary, Vector Store). Show the full memory-aware chain. 4. TOOL INTEGRATION: Define and implement 2 custom tools the agent needs for [TOPIC]. Write the tool definition, function, and error handling. 5. RETRIEVAL AUGMENTATION: Wire a retriever into the pipeline to ground responses in [CONTEXT] documents. Show the full RAG chain. 6. STREAMING OUTPUT: Implement streaming responses using LCEL's streaming interface. Show how to handle partial outputs. 7. PRODUCTION CONSIDERATIONS: Define the 5 things to add before deploying this pipeline — logging, error handling, fallbacks, rate limiting, and evaluation. Output all code in formatted Python blocks. Use LangChain best practices and LCEL syntax.