
Discover how LangChain, an open source Python and JavaScript framework, streamlines working with large language models by shaping prompts, building memory, chaining models, and using agents to access the internet.
Explore how large language models use transformer architectures to predict the next token from subword inputs, and how base lms are instruction-tuned via reinforcement learning from human feedback.
Learn to work with large language models in LangChain using OpenAI LLMs and Hugging Face, manage tokens and memory, test with T5, and compare base models to GPT.
Embed text with OpenAI text embedding A2002 via LangChain, obtain 1536-dimensional vectors, and compare positive and negative movie reviews using dot-product similarity to reveal sentiment.
Explore prompting best practices to improve model outputs, including clear, specific prompts; delimiter formatting to prevent injections; system messages; and few-shot and chain-of-thought techniques for robust reasoning.
Explore using LangChain's built-in prompt templates to build prompts, automate input formatting, and parse outputs into json, with a chat prompt template extracting a company's name, sector, and valuation.
Explore output parsers in LangChain to automate format instructions and parse json outputs using the response schema module and structured output parser within prompt templates.
Note: A small portion of the notebook was updated as of 02/2024 to use the new `langchain_openai` module.
Learn chaining in LangChain: a sequence of prompt–LM pairs where each link passes output to the next, forming simple single-input, single-output chains and more complex multiple-input, multiple-output chains.
Note: The notebook for this lecture was updated to reflect the newest updates to LangChain as of 02/2024.
Note: The notebook for this lecture was updated to reflect updates to LangChain as of 02/2024 and to fix an import error.
Build an Arxiv summarizer with LangChain agents, install Arxiv, load a chat model, and fetch the latest 2023 paper to extract its key insight on bias toward African languages.
Revisit vector stores with OpenAI embeddings and Chroma, loading and splitting documents to index chunks for similarity search. Retrieve relevant text as context for answering questions with a transformer-based encoder–decoder.
Apply maximal marginal relevance to retrieve diverse document chunks from a vector db after loading and splitting sources. Use metadata filtering and self query retrieval to focus on encoder content.
Load and split documents, store them in a vector store, and query chunks with LangChain and a GPT-3.5 turbo chat model to answer and return source documents.
Scale arxiv research bot by indexing ten PDFs from arxiv rss feeds into a chrome db using Lang Chain and embeddings, then use a conversational retrieval chain with Open Flamingo.
Hook your chatbot to Wikipedia using LangChain and OpenAI by loading Wikipedia documents, querying related topics, and building a retrieval chain with a vector store.
Learn function calling in LangChain with OpenAI LLMs by converting a math function into a tool, describing json arguments, and using a model with tools via the expression language.
Build agents with tools using LangChain to connect arithmetic tools to a GPT model, enabling automated problem solving with context via prompts and an agent scratchpad.
Build an economics chatbot with LangChain by connecting an LM to Bureau of Labor Statistics data, using tools to fetch CPI, PPI, and unemployment rate series.
Discover a free weekly AI research newsletter that curates arXiv papers on multimodal and text LLMs, embodied agents, robotics, and quantization, with summaries of research questions, methods, results, and takeaways.
This course is designed to empower developers, this comprehensive guide provides a practical approach to integrating LangcChain with OpenAI and effectively using Large Language Models (LLMs) in Python.
In the course's initial phase, you'll gain a robust understanding of what Langchain is, its functionalities and components, and how it synergizes with data sources and LLMs. We'll briefly dive into understanding LLMs, their architecture, training process, and various applications. We'll set up your environment with a hands-on installation guide and a 'Hello World' example using Google Colab.
Subsequently, we'll explore the LangChain Models, covering different types such as LLMs, Chat Models, and Embeddings. We'll guide you through loading the OpenAI Chat Model, connecting LangChain to Huggingface Hub models, and leveraging OpenAI's Text Embeddings.
The course advances to the essential aspect of Prompting & Parsing in LangChain, focusing on best practices, delimiters, structured formats, and effective use of examples and Chain of Though Reasoning (CoT).
The following sections focus on the concepts of Memory, Chaining, and Indexes in LangChain, enabling you to handle complex interactions with ease. We will study how you can adjust the memory of a chatbot, the significance of Chaining, and the utility of Document Loaders & Vector Stores.
Finally, you'll delve into the practical implementation of LangChain Agents, with a demonstration of a simple agent and a walkthrough of building an Arxiv Summarizer Agent.
By the end of this course, you'll have become proficient in using LangChain with OpenAI LLMs in Python, marking a significant leap in your developer journey. Ready to power up your LLM applications? Join us in this comprehensive course!