Modular Python framework for LLM workflows, tools, memory, and data.
Project description
griptape
Griptape offers developers the ability to build AI systems that operate across two dimensions: predictability and creativity.
For predictability, software structures like sequential pipelines and directed acyclic graphs (DAGs) are enforced. Creativity, on the other hand, is facilitated by safely prompting LLMs with tools that connect to external APIs and data sources. Developers can move between these two dimensions according to their use case.
Documentation
Please refer to Griptape Docs for:
- Getting started guides.
- Core concepts and design overviews.
- Examples.
- Contribution guidelines.
Quick Start
First, install griptape and griptape-tools:
pip install griptape griptape-tools -U
Second, configure an OpenAI client by getting an API key and adding it to your environment as OPENAI_API_KEY
. By default, Griptape uses OpenAI Completions API to execute LLM prompts.
With Griptape, you can create structures, such as Agents
, Pipelines
, and Workflows
, that are composed of different types of tasks. Let's build a simple creative agent that dynamically uses two tools with shared memory.
from griptape.memory.tool import TextToolMemory
from griptape.structures import Agent
from griptape.tools import TextProcessor, WebScraper
from griptape.utils import Conversation
"""
Define memory to be shared between tools.
"""
memory = TextToolMemory()
"""
WebScraper enables LLMs to load web pages.
"""
web_scraper = WebScraper(
memory={"get_content": {"output": [memory]}}
)
"""
TextProcessor enables LLMs to query
large chunks of text stored in memory
"""
text_processor = TextProcessor(
memory={"search": {"input": [memory]}}
)
"""
Agents can use multiple tools to creatively solve problems
"""
agent = Agent(
tools=[web_scraper, text_processor]
)
agent.run(
"based on https://www.griptape.ai/, tell me what Griptape is"
)
print(
Conversation(agent.memory)
)
And here is the output:
Q: based on https://www.griptape.ai/, tell me what Griptape is
A: Griptape is an opinionated Python framework that enables developers to fully harness the potential of LLMs while enforcing strict trust boundaries, schema validation, and activity-level permissions. It offers developers the ability to build AI systems that operate across two dimensions: predictability and creativity. Griptape can be used to create conversational and autonomous agents.
During the run, the Griptape agent loaded a webpage, stored its content in temporary memory, and passed the memory to TextProcessor
to query it.
Versioning
Griptape is in early development and its APIs and documentation are subject to change. Until we stabilize the API and release version 1.0.0, we will use minor versions (i.e., x.Y.z) to introduce features and breaking features, and patch versions (i.e., x.y.Z) for bug fixes.
Contributing
Contributions in the form of bug reports, feature ideas, or pull requests are super welcome! Take a look at the current issues and if you'd like to help please submit a pull request with some tests.
License
Griptape is available under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for griptape-0.10.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f500111eb939ca2b64dab4f36bf46e15e07d3dc32424dfe29bef5ce7abf280b6 |
|
MD5 | 869ea122f96f6ba21339c5339d464647 |
|
BLAKE2b-256 | d37df771ae06414f2ded04fb31470de79bbac2e7048022f70c2b8bd297103925 |