Today we will look at Griptape, a framework for building AI applications, which offers a clean Pythonic API for those tired of LangChain’s abstraction layers. It provides primitives for building assistants, RAG systems, and integrating with external tools. Honestly, in my experience, most people tired of LangChain switch to custom-written wrappers around lower-level libraries like OpenAI or LiteLLM. But who knows, maybe they’re missing out. Let’s dive in.
A Bit of History
Personally, I’ve been hearing about Griptape for about a year and a half. As far as I remember, It started as a sort of LangChain competitor with quite similar primitives, but their paths gradually diverged. As of the time of the writing, it has 2.3k stars on GitHub, which is somewhat less than LangChain’s 109k, but still enough to consider the project quite mature. Besides the open-source framework, it has also developed its own cloud where you can run your applications, ETLs, and RAGs, and a visual builder, Griptape Nodes, allowing non-professionals to click together applications in minutes. 1
The Framework
Let’s get to the framework itself. It introduces several primitives that are worth understanding before starting the actual use.
Drivers: Essentially the main tool, abstracting specific implementations of anything and allowing them to be changed on the fly without breaking business logic. There are drivers for almost everything, be it assistants, prompts, models, embedding systems, or databases. Basically, they look (and implemented) as abstract classes and their implementations.
Engines: Provide ready-made implementations for core tasks such as RAG and summarization.
Structures: Basic building blocks for constructing applications. Among them, you can find:
Tasks: An abstraction over some action, for example, querying a model, processing a response, loading data from a file, and so on.
Agents: A somewhat strange wrapper around a single task 2. It allows passing input and a list of tools that this task can use.
Pipelines: Like an agent, but can run multiple tasks sequentially, passing the output of one to the input of another.
Workflows: Directed acyclic graphs (DAGs) consisting of tasks. Allows for optimal planning and execution of parallel tasks. The documentation states they are non-sequential, although it later provides examples of quite sequential workflows. In this case, it’s somewhat unclear why pipelines are needed at all.
Overall, this organization is quite flexible and allows for creating fairly complex execution flows. The fact that it’s a DAG imposes certain limitations on creating agents in the sense that some futuristically-minded people envision, but it allows for building reliable 3 and well-thought-out systems.
Tools: Functions available to LLMs. These functions can be passed to the primitives mentioned above, thus giving the LLM the ability to generate a sequence of calls to these functions to perform actions. Griptape provides quite a few such tools, but you can also add your own.
Task Memory: One of Griptape’s interesting features. Often, the data to be processed is either very sensitive or very large, and sending it directly to the LLM can be impractical. In such cases, you can ask the tool not to provide this data to the LLM, but to return some descriptor of this data that allows the LLM to reference it for use in other tools.
Conversation Memory: Enabled by default, and passed to the model between runs of the same workflow.4 Can be disabled if not required. Essentially, useful only for chatbots and potentially harmful for everything else.
Rulesets: LLM behavior settings that are passed into every prompt. Something like system prompts, but to understand exactly what they are, one needs to dig deeper.
That covers the main primitives; there are a few other concepts that aren’t too important at this stage, so I’ll skip them.
What’s Next?
Next, I plan to dig deeper into:
- When and why to use agents, pipelines, and workflows
- The framework’s capabilities for ETL and RAG
- How Off-Prompt Memory works
- Integration and customization
- What can be done in their cloud
- And also what Griptape Nodes is good for
And, of course, run some of the examples they provide. I’ll describe my progress as I go.