avatarLaxfed Paulacy

Summary

OpenGPTs is an open-source GPT store developed by LangChain, utilizing MessageGraph, cognitive architectures, persistence, and configurability to create and manage various types of bots.

Abstract

OpenGPTs, an initiative by LangChain, represents an open-source repository for GPT-based bots. It operates on MessageGraph, a graph structure within LangGraph, designed to handle message-based interactions efficiently. The platform supports diverse cognitive architectures for bot creation, including flexible Assistant bots with toolsets, retrieval-focused RAG bots, and simple ChatBot bots. Persistence is achieved through LangGraph's CheckPoint object, specifically using a RedisCheckPointer for storing conversation history. Configuration is streamlined with LangChain's primitives, allowing for customizable bot creation. OpenGPTs introduces new models like Google's Gemini and Mixtral, and tools such as Robocorp's Action Server. It also features the astream_events method for real-time event streaming. The entire system is accessible via API endpoints, facilitating integration and customization with other systems.

Opinions

  • The author suggests that technology, particularly when combined with liberal arts and humanities, is more impactful, implying a holistic approach to AI development.
  • The use of Richard Feynman's quote indicates a value for practicality and truth in technology over mere public relations.
  • The platform's design reflects a belief in the importance of flexibility, reliability, and modularity in bot development.
  • There is an emphasis on the community's role in enhancing OpenGPTs, suggesting an open and collaborative ethos.
  • The introduction of new models and tools demonstrates a commitment to innovation and adaptation to the evolving AI landscape.
  • The technical deep dive provided by the article shows an intent to inform and engage a technically-minded audience.

LANGCHAIN — What Is OpenGPTs?

For a successful technology, reality must take precedence over public relations, for nature cannot be fooled. — Richard Feynman

OpenGPTs is an open-source GPT store developed by LangChain. It is powered by an early version of LangGraph, which is an extension of LangChain aimed at building agents as graphs. OpenGPTs leverages MessageGraph, different cognitive architectures, persistence via LangGraph, and configuration using LangChain primitives to support the creation of various types of bots. Let’s deep dive into the technical aspects of OpenGPTs.

MessageGraph

OpenGPTs runs on MessageGraph, a specific type of graph introduced in LangGraph. This graph is designed to take in a list of messages and return messages to append to the list of messages. It is closely related to the I/O of new "chat completion" models, making it suitable for communication in distributed systems and visualization of the work being done.

Cognitive Architectures

OpenGPTs supports three different cognitive architectures for creating bots:

  1. Assistants: These bots can be equipped with various tools and use an LLM to decide when to use them. They are flexible but may be less reliable.
  2. RAG: These bots are retrieval-focused, equipped with a single retriever, and always use it.
  3. ChatBot: These bots are simple, just a call to a language model parameterized by a system message.

Persistence

Persistence is a fundamental requirement for OpenGPTs. LangGraph provides functionality for persistence of chat messages using a CheckPoint object. OpenGPTs uses a RedisCheckPointer to save the results to Redis, enabling the surfacing of messages from past conversations.

Configuration

OpenGPTs allows users to choose the LLM, system message, tools, etc., when creating bots. LangChain’s configurable fields feature enables the marking of certain fields as configurable, providing modular and consistent configurability.

New Models

OpenGPTs introduces new models, including Google’s Gemini model for assistants and Mixtral for ChatBot and RAGBot.

New Tools

A new tool, Robocorp’s Action Server, is introduced, providing an easy way to define and run arbitrary Python functions as tools.

astream_events

The new astream_events method is utilized to stream back all events, such as new tokens, function calls, and function results, and surface them to the user.

OpenGPTs is open to community assistance for enhancing prompting strategies, supporting other tools, and reliability with open-source models.

In conclusion, OpenGPTs offers a technical deep dive into creating and managing various types of bots, leveraging LangChain’s capabilities. The entire functionality behind OpenGPTs is exposed via API endpoints, allowing for customization and integration with other systems.

This technical overview provides valuable insights into the architecture and capabilities of OpenGPTs, demonstrating the extensibility and flexibility it offers for building and deploying GPT-based chatbots.

ChatGPT
Langchain
Recommended from ReadMedium