In this article I do a complete end-to-end walkthrough of an Agent built using LangGraph, deployed to LangGraph Cloud & viewed via LangGraph Studio. Ending with LangSmith on managing applications & LLM performance.
Considering the intersection of language and AI, developments have been taking place at a tremendous pace. And LangChain finds itself at the forefront of shaping how generative AI applications are developed and managed.
A few initial observations regarding generative AI and language:
- A few months ago it was thought that OpenAI has captured the market with their highly capable LLMs.
- Then a slew of open-sourced models, most notably from Meta disrupted the perceived commercial model.
- LLM providers realised that Language Models will become a mere utility and started to focus on end-user applications and RAG-like functionalities referred to as grounding, agent-like functionality and personal assistants.
- Hallucination had to be solved for, and it was discovered that LLMs do not have emergent capabilities, but rather LLMs do exceptionally well at in-context learning (ICL). An application structure developed around implementing, scaling and managing ICL implementations; which we now know as RAG.
- RAG (non-gradient) started to be preferred above fine-tuning (gradient) approaches for reasons of being transparent, not as opaque as fine-tuning. Adding to generative AI apps being observable, inspectable and easy modifiable.
- Because we started using all aspects of LLMs (NLG, reasoning, planning, dialog state management, etc.) except the knowledge intensive nature of LLMs, Small Language Models become very much applicable.
- This was due to very capable open-sourced SLMs, quantisation, local, offline inference, advanced capability in reasoning and chain-of-thought training.
- And, the focus is shifting to two aspects…the first being a data centric approach. Where unstructured data can be discovered, designed and augmented for RAG and fine-tuning. Recent fine-tuning did not focus on augmenting the knowledge-intensive nature of Language Models, but rather to imbue the LMs with specific behavioural capabilities.
- This is evident in the recent acquisition bye OpenAI to move closer to the data portion and delivering RAG solutions.
- The second aspect the need for a no-code to low-code AI productivity suite providing access to models, hosting, flow-engineering, fine-tuning, prompt studio and guardrails.
- There is also a notable movement to add graph data…graph is an abstract data type…An abstract data type is a mathematical model for data types, defined by its behaviour (semantics) from the point of view of a user of the data. Abstract data types are in stark contrasts with data structures, which are concrete representations of data, and are the point of view of an implementer, not a user. This data structure is less opaque and easy to interpret.
langChain introduced LangSmith as a tool for detailed tracing and management of Generative AI applications. The offering included a prompt playground, and prompt hub.
langChain also recently introduced LangGraph, which adds to some degree structure to agentic applications.
An abstract data type is a mathematical model for data types, defined by its behaviour (semantics) from the point of view of a user of the data.
Abstract data types are in stark contrasts with data structures, which are concrete representations of data, and are the point of view of an implementer, not a user. This data structure is less opaque and easy to interpret.
Directed graph (or digraph) is a graph that is made up of a set of nodes connected by directed edges.
Graph data structure consists of a finite set of nodes together with a set of unordered pairs of these nodes for an undirected graph.
Considering the graph representation below, the nodes are shown, together with the edges and the edge options.