learning-langchain  by langchain-ai

Code examples for building AI and LLM applications

Created 1 year ago
255 stars

Top 98.8% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides Python and JavaScript code examples accompanying the "Learning LangChain" book, enabling users to build AI and LLM applications. It targets developers and researchers seeking practical implementations of LangChain and LangGraph, offering a hands-on approach to mastering these frameworks.

How It Works

The project structures code by book chapters, covering fundamental LangChain components like LLMs, document loaders, embeddings, and retrieval strategies (RAG). It progresses to advanced topics including memory management, agent construction with tools, LangGraph for stateful applications, and productionizing techniques. Examples are provided in both Python and JavaScript.

Quick Start & Requirements

Clone the repository and set up a Python virtual environment (python -m venv .venv, activate, pip install -e .) or Node.js environment (npm install). Essential environment variables include OPENAI_API_KEY, LANGCHAIN_API_KEY, and LANGCHAIN_TRACING_V2=true. Chapter 9 requires Supabase credentials (SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY). Docker is necessary for running a PostgreSQL container with the pgvector extension for specific examples. The Chinook SQLite database is also used.

Highlighted Details

  • Comprehensive examples span basic LLM interaction, document processing, RAG variations (multi-query, RAG fusion), agent development, and chatbot construction.
  • Features detailed guidance on LangGraph for complex agentic workflows, including subgraphs and supervisors.
  • Includes sections on productionizing applications (structured/streaming output, authorization) and evaluation methodologies.
  • Docker setup instructions are provided for a PostgreSQL instance with the pgvector extension.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), contribution guidelines, or project roadmaps are provided.

Licensing & Compatibility

The license type and any compatibility notes for commercial use or closed-source linking are not specified.

Limitations & Caveats

Functionality is dependent on external API keys (OpenAI, LangChain, Supabase), potentially incurring costs. Setup requires managing dependencies, virtual environments, and optionally Docker for database services, increasing the initial barrier to entry. The examples are directly tied to the book's curriculum.

Health Check
Last Commit

10 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
23 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
20 more.

dify by langgenius

0.7%
125k
Open-source LLM app development platform
Created 2 years ago
Updated 19 hours ago
Feedback? Help us improve.