LangChain explained

LangChain
Logo Alt:️, the parrot and chain emojis
Developer:Harrison Chase
Released:October 2022
Genre:Software framework for large language model application development
Website:LangChain.com
Programming Language:Python and JavaScript
Repo:github.com/langchain-ai/langchain
License:MIT License

LangChain is a framework designed to simplify the creation of applications using large language models (LLMs). As a language model integration framework, LangChain's use-cases largely overlap with those of language models in general, including document analysis and summarization, chatbots, and code analysis.[1]

History

LangChain was launched in October 2022 as an open source project by Harrison Chase, while working at machine learning startup Robust Intelligence. The project quickly garnered popularity,[2] with improvements from hundreds of contributors on GitHub, trending discussions on Twitter, lively activity on the project's Discord server, many YouTube tutorials, and meetups in San Francisco and London. In April 2023, LangChain had incorporated and the new startup raised over $20 million in funding at a valuation of at least $200 million from venture firm Sequoia Capital, a week after announcing a $10 million seed investment from Benchmark.[3] [4]

In the third quarter of 2023, the LangChain Expression Language (LCEL) was introduced, which provides a declarative way to define chains of actions.[5] [6]

In October 2023 LangChain introduced LangServe, a deployment tool to host LCEL code as a production-ready API.[7]

Capabilities

LangChain's developers highlight the framework's applicability to use-cases including chatbots,[8] retrieval-augmented generation,[9] document summarization,[10] and synthetic data generation.[11]

As of March 2023, LangChain included integrations with systems including Amazon, Google, and Microsoft Azure cloud storage; API wrappers for news, movie information, and weather; Bash for summarization, syntax and semantics checking, and execution of shell scripts; multiple web scraping subsystems and templates; few-shot learning prompt generation support; finding and summarizing "todo" tasks in code; Google Drive documents, spreadsheets, and presentations summarization, extraction, and creation; Google Search and Microsoft Bing web search; OpenAI, Anthropic, and Hugging Face language models; iFixit repair guides and wikis search and summarization; MapReduce for question answering, combining documents, and question generation; N-gram overlap scoring; PyPDF, pdfminer, fitz, and pymupdf for PDF file text extraction and manipulation; Python and JavaScript code generation, analysis, and debugging; Milvus vector database[12] to store and retrieve vector embeddings; Weaviate vector database[13] to cache embedding and data objects; Redis cache database storage; Python RequestsWrapper and other methods for API requests; SQL and NoSQL databases including JSON support; Streamlit, including for logging; text mapping for k-nearest neighbors search; time zone conversion and calendar operations; tracing and recording stack symbols in threaded and asynchronous subprocess runs; and the Wolfram Alpha website and SDK.[14] As of April 2023, it can read from more than 50 document types and data sources.[15]

LangChain tools

!Tool name!Account required?!API key required?!Licencing!Features!Documentation URL
Alpha VantageNoYesProprietaryFinancial data, analyticshttps://python.langchain.com/docs/integrations/tools/alpha_vantage
ApifyNoYesCommercialWeb scraping, automationhttps://python.langchain.com/docs/integrations/tools/apify
ArXivNoNoOpen SourceScientific papers, researchhttps://python.langchain.com/docs/integrations/tools/arxiv
AWS LambdaYesYesProprietaryServerless computinghttps://python.langchain.com/docs/integrations/tools/awslambda
BashNoNoOpen sourceShell environment accesshttps://python.langchain.com/docs/integrations/tools/bash|-|Bearly Code Interpreter|No|Yes|Commercial|Remote Python code execution|https://python.langchain.com/docs/integrations/tools/bearly
Bing SearchNoYesProprietarySearch enginehttps://python.langchain.com/docs/integrations/tools/bing_search
Brave SearchNoNoOpen sourcePrivacy-focused searchhttps://python.langchain.com/docs/integrations/tools/brave_search|-|ChatGPT Plugins|No|Yes|Proprietary|ChatGPT|https://python.langchain.com/docs/integrations/tools/chatgpt_plugins|-|Connery|No|Yes|Commercial|API actions|https://python.langchain.com/docs/integrations/tools/connery
Dall-E Image GeneratorNoYesProprietaryText-to-image generationhttps://python.langchain.com/docs/integrations/tools/dalle_image_generator
DataForSEONoYesCommercialSEO data, analyticshttps://python.langchain.com/docs/integrations/tools/dataforseo|-|DuckDuckGo Search|No|No|Open source|Privacy-focused search|https://python.langchain.com/docs/integrations/tools/ddg|-|E2B Data Analysis|No|No|Open source|Data analysis|https://python.langchain.com/docs/integrations/tools/e2b_data_analysis|-|Eden AI|No|Yes|Commercial|AI tools, APIs|https://python.langchain.com/docs/integrations/tools/edenai_tools
Eleven Labs Text2SpeechNoYesCommercialText-to-speechhttps://python.langchain.com/docs/integrations/tools/eleven_labs_tts
Exa SearchNoYesCommercialWeb searchhttps://python.langchain.com/docs/integrations/tools/exa_search|-|File System|No|No|Open source|File system interaction|https://python.langchain.com/docs/integrations/tools/filesystem
Golden QueryNoYesCommercialNatural language querieshttps://python.langchain.com/docs/integrations/tools/golden_query|-|Google Cloud Text-to-Speech|Yes|Yes|Proprietary|Text-to-speech|https://python.langchain.com/docs/integrations/tools/google_cloud_texttospeech|-|Google Drive|Yes|Yes|Proprietary|Google Drive access|https://python.langchain.com/docs/integrations/tools/google_drive
Google FinanceYesYesProprietaryFinancial datahttps://python.langchain.com/docs/integrations/tools/google_finance|-|Google Jobs|Yes|Yes|Proprietary|Job search|https://python.langchain.com/docs/integrations/tools/google_jobs|-|Google Lens|Yes|Yes|Proprietary|Visual search, recognition|https://python.langchain.com/docs/integrations/tools/google_lens
Google PlacesYesYesProprietaryLocation-based serviceshttps://python.langchain.com/docs/integrations/tools/google_places
Google ScholarYesYesProprietaryScholarly article searchhttps://python.langchain.com/docs/integrations/tools/google_scholar|-|Google Search|Yes|Yes|Proprietary|Search engine|https://python.langchain.com/docs/integrations/tools/google_search
Google SerperNoYesCommercialSERP scrapinghttps://python.langchain.com/docs/integrations/tools/google_serper
Google TrendsYesYesProprietaryTrend datahttps://python.langchain.com/docs/integrations/tools/google_trends
GradioNoNoOpen sourceMachine learning UIshttps://python.langchain.com/docs/integrations/tools/gradio_tools|-|GraphQL|No|No|Open source|API queries|https://python.langchain.com/docs/integrations/tools/graphql|-|HuggingFace Hub|No|No|Open source|Hugging Face models, datasets|https://python.langchain.com/docs/integrations/tools/huggingface_tools
Human as a toolNoNoN/AHuman inputhttps://python.langchain.com/docs/integrations/tools/human_tools
IFTTT WebHooksNoYesCommercialWeb service automationhttps://python.langchain.com/docs/integrations/tools/ifttt
Ionic ShoppingNoYesCommercialShoppinghttps://python.langchain.com/docs/integrations/tools/ionic_shopping|-|Lemon Agent|No|Yes|Commercial|Lemon AI interaction|https://python.langchain.com/docs/integrations/tools/lemonai|-|Memorize|No|No|Open source|Fine-tune LLM to memorize information using unsupervised learning|https://python.langchain.com/docs/integrations/tools/memorize|-|Nuclia|No|Yes|Commercial|Indexing of unstructured data|https://python.langchain.com/docs/integrations/tools/nuclia
OpenWeatherMapNoYesCommercialWeather datahttps://python.langchain.com/docs/integrations/tools/openweathermap|-|Polygon Stock Market API|No|Yes|Commercial|Stock market data|https://python.langchain.com/docs/integrations/tools/polygon|-|PubMed|No|No|Open source|Biomedical literature|https://python.langchain.com/docs/integrations/tools/pubmed
Python REPLNoNoOpen sourcePython shellhttps://python.langchain.com/docs/integrations/tools/python|-|Reddit Search|No|No|Open source|Reddit search|https://python.langchain.com/docs/integrations/tools/reddit_search|-|Requests|No|No|Open source|HTTP requests|https://python.langchain.com/docs/integrations/tools/requests|-|SceneXplain|No|No|Open source|Model explanations|https://python.langchain.com/docs/integrations/tools/sceneXplain
SearchNoNoOpen sourceQuery various search serviceshttps://python.langchain.com/docs/integrations/tools/search_tools|-|SearchApi|No|Yes|Commercial|Query various search services|https://python.langchain.com/docs/integrations/tools/searchapi
SearxNGNoNoOpen sourcePrivacy-focused searchhttps://python.langchain.com/docs/integrations/tools/searx_search|-|Semantic Scholar API|No|No|Open source|Academic paper search|https://python.langchain.com/docs/integrations/tools/semanticscholar|-|SerpAPI|No|Yes|Commercial|Search engine results page scraping|https://python.langchain.com/docs/integrations/tools/serpapi
StackExchangeNoNoOpen sourceStack Exchange accesshttps://python.langchain.com/docs/integrations/tools/stackexchange
Tavily SearchNoYesCommercialQuestion answeringhttps://python.langchain.com/docs/integrations/tools/tavily_search
TwilioNoYesCommercialCommunication APIshttps://python.langchain.com/docs/integrations/tools/twilio|-|Wikidata|No|No|Open source|Structured data access|https://python.langchain.com/docs/integrations/tools/wikidata|-|Wikipedia|No|No|Open source|Wikipedia access|https://python.langchain.com/docs/integrations/tools/wikipedia|-|Wolfram Alpha|No|Yes|Proprietary|Computational knowledge|https://python.langchain.com/docs/integrations/tools/wolfram_alpha
Yahoo Finance NewsNoYesCommercialFinancial newshttps://python.langchain.com/docs/integrations/tools/yahoo_finance_news|-|Youtube|No|Yes|Commercial|YouTube access|https://python.langchain.com/docs/integrations/tools/youtube
Zapier Natural Language ActionsNoYesCommercialWorkflow automationhttps://python.langchain.com/docs/integrations/tools/zapier|}

External links

]

Notes and References

  1. Web site: Buniatyan . Davit . 2023 . Code Understanding Using LangChain . Activeloop.
  2. Book: Auffarth, Ben . Generative AI with LangChain . Packt Publishing . 2023 . 9781835083468 . Birmingham . 83.
  3. News: Palazzolo . Stephanie . 2023-04-13 . AI startup LangChain taps Sequoia to lead funding round at a valuation of at least $200 million . 2023-04-18 . Business Insider . en-US . 2023-04-18 . https://web.archive.org/web/20230418041335/https://www.businessinsider.com/sequoia-leads-funding-round-generative-artificial-intelligence-startup-langchain-2023-4 . live .
  4. News: Griffith . Erin . Metz . Cade . 2023-03-14 . 'Let 1,000 Flowers Bloom': A.I. Funding Frenzy Escalates . en-US . The New York Times . 2023-04-18 . 0362-4331 . 2023-04-18 . https://web.archive.org/web/20230418041335/https://www.nytimes.com/2023/03/14/technology/ai-funding-boom.html . live .
  5. Web site: Topic Modelling in production: Leveraging LangChain to move from ad-hoc Jupyter Notebooks to production modular service . Mansurova . Mariya . 2023-10-30 . towardsdatascience.com . 2024-07-08.
  6. Web site: LangChain Expression Language . . 2023-08-01 . langchain.dev . 2024-07-08.
  7. Web site: 2023-10-12 . Introducing LangServe, the best way to deploy your LangChains . 2023-10-17 . LangChain Blog . en.
  8. Web site: Chatbots ️ Langchain . 2023-11-26 . python.langchain.com . en.
  9. Web site: Retrieval-augmented generation (RAG) ️ Langchain . 2023-11-26 . python.langchain.com . en.
  10. Web site: Summarization ️ Langchain . 2023-11-26 . python.langchain.com . en.
  11. Web site: Synthetic data generation ️ Langchain . 2023-11-26 . python.langchain.com . en.
  12. Web site: Milvus — LangChain . 2023-10-29 . python.langchain.com .
  13. Web site: Weaviate . 2024-01-17 . python.langchain.com.
  14. Web site: Hug . Daniel Patrick . 2023-03-08 . Hierarchical topic tree of LangChain's integrations . GitHub . 2023-04-18 . 2023-04-29 . https://web.archive.org/web/20230429232148/https://objects.githubusercontent.com/github-production-repository-file-5c1aeb/552661142/10924044?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230429T232148Z&X-Amz-Expires=300&X-Amz-Signature=ead2143d9ccad64d8a8e65fdd942ab13835e59a339360351b7aaf9f370a351bd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=552661142&response-content-disposition=attachment%3Bfilename%3Dgl_tree_langchain.pdf&response-content-type=application%2Fpdf . live .
  15. Web site: Document Loaders — LangChain 0.0.142 . 2023-04-18 . python.langchain.com . 2023-04-18 . https://web.archive.org/web/20230418152614/https://python.langchain.com/en/latest/modules/indexes/document_loaders.html . live .