Griptape Documentation
repository·main·Indexed 25 days ago
https://github.com/griptape-ai/griptapeA modular Python framework (v1.11.0) for building generative AI applications. Griptape provides abstractions for LLM workflows, RAG, and tool integration through core components including Structures (Agents, Pipelines, Workflows), Tasks, Memory, Drivers, Engines, and Tools. It also includes Griptape Cloud for low-code Assistant creation, Knowledge Base management, and Data Lake integration.
What's inside Griptape
- Griptape Nodes is a visual AI development platform that allows you to create AI workflows and applications using a drag-and-drop interface with visual building blocks. For advanced customization, you can extend the platform's functionality using Python scripting.
Build applications with the Griptape Framework
mainThe Griptape Framework is an open-source library designed for creating robust generative AI (genAI) applications. It provides flexible abstractions and built-in tools to help developers manage the complexity of AI-driven software.Use Griptape Cloud for managed AI services
mainGriptape Cloud is a managed offering for deploying and scaling AI applications. It provides capabilities for setting up RAG (Retrieval-Augmented Generation) pipelines, code hosting, and managing custom Tools for LLM Agents. All cloud features are accessible via a dedicated API.What is a Pipeline and how does it differ from an Agent?
mainAPipelineis a structural component in Griptape designed to orchestrate multipleTaskobjects. While anAgenttypically focuses on a single goal or interaction loop, aPipelineallows you to chain or manage a sequence of distinct tasks. You can retrieve the final result of the entire pipeline execution by accessing itsoutputattribute.What is a Griptape Structure?
mainA Structure is a way to move beyond simple LLM prompting by providing programmatic control over application logic and data flow. Structures allow you to:
- Ensure agents perform specific tasks consistently.
- Provide access to specific datasets for querying.
- Access external APIs, services, and tools.
- Process user inputs and LLM responses.
- Define specific output formats and delivery methods.
- Prescribe a deterministic series of tasks.
- Connect multiple application components together.
What is Task Memory and when to use it
mainTask Memory is a feature in Griptape that controls where data returned by Tools is stored. Instead of sending all tool outputs directly to the LLM (the prompt), you can opt to store them in Task Memory.
Use Task Memory in these scenarios:
- Security/Regulatory requirements: To prevent sensitive data from being sent to an LLM provider's cloud.
- Large textual content: When tool output exceeds the LLM's token limit (context window). You can store the large content in Task Memory and use a specialized tool to query it.
- Non-textual content: To store and later act upon images, videos, or PDFs generated by tools.
What is a Task in Griptape
mainA
Taskis a purpose-built abstraction for the Large Language Model (LLM). Griptape provides various specialized Task types for different use cases (e.g., prompting, extraction, summarization, RAG).Tasks that take input use the
inputfield to define the objective. Within theinput, you can access several context variables:args: An array of arguments passed to the.run()method.structure: The structure that the task belongs to.- User-defined context variables.
- Additional context variables added by the parent Structure.
Identify Assets using Asset Aliases and Asset Paths
mainWhen working with Data Lake assets, use the following identifiers:
- Asset Alias: A unique identifier for an Asset formed by combining its Bucket ID and Name. The format is
<bucket_id>/<asset_name>. - Asset Path: A prefix filter used to encompass multiple assets within a Bucket. For example, an Asset Path of
foo/will include bothfoo/bar.txtandfoo/baz.txt.
- Asset Alias: A unique identifier for an Asset formed by combining its Bucket ID and Name. The format is
What are Embeddings in Griptape?
mainEmbeddings are multidimensional representations of text or image data that carry semantic information. They are primarily used for tasks like text or image similarity search, often within a Rag Engine.What are Loaders and how to use them
mainLoaders are components used to ingest data from various sources and parse them into Artifacts.
To use a loader, you can call:
load(): To load a single source.load_collection(): To load multiple sources at once.
Loaders act as the bridge between raw external data (files, web pages, databases, etc.) and the Griptape data model.
Understand Griptape data abstractions
mainGriptape uses a modular set of abstractions to handle data throughout an AI pipeline. Key components include:
- Artifacts: The primary mechanism for passing data (text, lists, blobs, etc.) between components.
- Loaders: Used to ingest textual data from various sources.
- Chunkers: Used to split long text into manageable chunks based on token length.
- Tokenizers: Used to tokenize and detokenize text to manage LLM token limits.
- Engines: Specialized components for specific tasks:
- RAG Engines: For modular Retrieval-Augmented Generation pipelines.
- Extraction Engines: For extracting structured content from unstructured data.
- Summary Engines: For summarizing text content.
- Drivers: Interfaces for interacting with external services:
- Embedding Drivers: To generate vector embeddings from text.
- Vector Store Drivers: To store and query vector databases.
- Prompt Drivers: To interface with LLM APIs.
Understand Assistant Runs
mainAn Assistant Run is an individual execution of an Assistant. While an Assistant represents the configuration and persona, a Run represents a specific session or interaction. During a run, you can send messages to the Assistant and subsequently inspect the run details, which include the history of sent and received messages as well as the specific configurations used for that execution.