Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial cloud docs for data sources, knowledge bases, and structures #1110

Merged
merged 13 commits into from
Aug 29, 2024
21 changes: 21 additions & 0 deletions docs/griptape-cloud/data-sources/create-data-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Data Sources

Data Sources are the first step to Griptape's RAG pipeline. They allow you to bring your own data to ingest and transform for use with your AI applications via [Knowledge Bases](../knowledge-bases/create-knowledge-base.md).
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

## Create a Data Source
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

You can [create a Data Source](https://cloud.griptape.ai/data-sources/create) by specifying the required configuration for your chosen Data Source in the cloud console.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

If you do not see a Data Source configuration you'd wish to use, you can submit a request via [Discord](https://discord.gg/gnWRz88eym) or `[email protected]`.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

### Web Page

You can scrape and ingest a single, public web page by providing a URL. If you wish to scrape multiple pages, you must create multiple Data Sources. However, you can then add all of the pages to the same Knowledge Base if you wish to access all the pages together.

### Google Drive

You can ingest documents and spreadsheets stored in a Google Drive account. We support all standard file formats such as text, markdown, spreadsheets, and presentations.

### Confluence
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

emjay07 marked this conversation as resolved.
Show resolved Hide resolved
You can connect to your personal or company Confluence by providing a domain, [Atlassian API Token](https://id.atlassian.com/manage-profile/security/api-tokens), and the email address for the token holder's account. Each Confluence Data Source is limited to a single space in Confluence.
17 changes: 17 additions & 0 deletions docs/griptape-cloud/data-sources/refresh-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Refresh a Data Source

## Scheduled Refresh

By default your Data Source will not refresh automatically. When creating a Data Source, you can enable scheduled refresh and specify a [CRON expression](https://crontab.guru/). For example, if you wish your Data Source to refresh every day at midnight PDT you can use the following expression: `0 7 * * *`.

## Manual Refresh

If you wish to manually refresh a Data Source you can do so either via the `Refresh` button in the cloud console or by API using the `Data Source ID` on the `Config` tab and a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys).

The following shell commands will create a new data refresh job. You will need to specify your API key and data source id.

```shell
export GT_CLOUD_API_KEY=<your API key here>
export DATA_SOURCE_ID=<your data source id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{}' https://cloud.griptape.ai/api/data-connectors/${DATA_SOURCE_ID}/data-jobs
```
11 changes: 9 additions & 2 deletions docs/griptape-cloud/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Griptape Cloud

Griptape Cloud provides managed services for your AI app stack. Deploy and scale end-to-end solutions, from LLM-powered data prep and retrieval to AI agents, pipelines and workflows.
[Griptape Cloud](https://cloud.griptape.ai/) provides managed services for your AI app stack. Deploy and scale end-to-end solutions, from LLM-powered data prep and retrieval to AI Agents, Pipelines and Workflows.

To get started with AI Structures in the Cloud, check out the [managed-structure-template](https://github.com/griptape-ai/managed-structure-template) or deploy one of the [griptape-sample-structures](https://github.com/griptape-ai/griptape-sample-structures/tree/main).
## Build Your Own RAG Pipeline
Connect to your data with our [Data Sources](data-sources/create-data-source.md) and prepare them for retrieval with [Knowledge Bases](knowledge-bases/create-knowledge-base.md).

## Host and Run Your Code
emjay07 marked this conversation as resolved.
Show resolved Hide resolved
Have Griptape code? Have existing code with another LLM framework? You can host your python code using [Structures](structures/create-structure.md) whether it uses the Griptape Framework or not.

## APIs
All of our features can be called via API with a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys). See the [API Reference](api/api-reference.md) for detailed information.
33 changes: 33 additions & 0 deletions docs/griptape-cloud/knowledge-bases/accessing-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Accessing Data in a Knowledge Base

You can `Search` or `Query` the Knowledge Base for information contained in your Data Sources. `Search` will return a natural language response while `Query` will return the individual entries. Use whichever one best fits your use case.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

## From the Cloud Console

You can try out both actions from the cloud console on the `Test` tab of your Knowledge Base.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

## From the API

You can enact both `Query` and `Search` via the API by hitting their respective endpoints using a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the Knowledge Base ID found on the `Config` tab of your Knowledge Base.

The following example commands will send the query string "test query string" and return the results from the Knowledge Base.

### Query

```shell
export GT_CLOUD_API_KEY=<your API key here>
export KNOWLEDGE_BASE_ID=<your knowledge base id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${KNOWLEDGE_BASE_ID}/query
SavagePencil marked this conversation as resolved.
Show resolved Hide resolved
```

### Search

```shell
export GT_CLOUD_API_KEY=<your API key here>
export KNOWLEDGE_BASE_ID=<your knowledge base id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${KNOWLEDGE_BASE_ID}/search
```

## Using the Griptape Framework

You can use the [GriptapeCloudKnowledgeBaseVectorStoreDriver](../../griptape-framework/drivers/vector-store-drivers.md/#griptape-cloud-knowledge-base) to query your Knowledge Base with Griptape and the [GriptapeCloudKnowledgeBaseTool](../../griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md) to search.
7 changes: 7 additions & 0 deletions docs/griptape-cloud/knowledge-bases/create-knowledge-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Knowledge Bases

Use [Knowledge Bases](https://cloud.griptape.ai/knowledge-bases) to prep your data ingested from [Data Sources](../data-sources/create-data-source.md) for retrieval. You can specify multiple Data Sources per Knowledge Base in order to access data ingested from different sources all in one place.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

## Create a Knowledge Base

You can [create a Knowledge Base](https://cloud.griptape.ai/knowledge-bases/create) by specifying which Data Sources you wish to include. Once created, you can [access your data](accessing-data.md) instantly.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 16 additions & 0 deletions docs/griptape-cloud/structures/create-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Structures

Structures are the primary building block in the Griptape.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

## Create a Structure

1. [Connect Your GitHub Account](https://cloud.griptape.ai/account) in your Griptape Cloud account
1. Install the [Griptape Cloud GitHub app](https://github.com/apps/griptape-cloud/installations/new/) to any account or organization you'd like to pull code in from
- Be sure to allow the app access to `All Repositories` or select the specific repositories you need
1. Create a [Structure Config YAML](structure-config.md) in your repository

You can now [create a Structure](https://cloud.griptape.ai/structures/create) by providing your GitHub repository information.
emjay07 marked this conversation as resolved.
Show resolved Hide resolved

### Quickstart With Samples and Templates

To get started with Structures in the Cloud, check out the [managed-structure-template](https://github.com/griptape-ai/managed-structure-template) or deploy one of the [griptape-sample-structures](https://github.com/griptape-ai/griptape-sample-structures/tree/main).
32 changes: 32 additions & 0 deletions docs/griptape-cloud/structures/run-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Running a Structure

Once your Structure is created and deployed, you can run your Structure one of three ways outlined below. You view the output of any of your runs, no matter how you created them, in the `Runs` tab of your Structure.

## From the Cloud Console

In the cloud console, click on the name of the Structure you wish to run and then go to the `Test` tab. Here you can specify arguments to pass to your Structure run and any run-specific environment variables you need.

When passing arguments through the cloud console, pass each new argument on a new line. For example if your local code is ran with the inputs `-i input_file.txt` then the arguments you would pass in the cloud would be:

```
-i
input_file.txt
```

## From the API

You can run your Structure via the API using CURL or any other code that can make HTTP requests. You will need a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the `Structure Invocation URL` which is located on the `Config` tab of your Structure.

The example below will kick off a run with the args you pass as a json object.

```shell
export GT_CLOUD_API_KEY=<your API key here>
export INVOCATION_URL=<your structure invocation URL>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"args": ["arg1"], ""env_vars"": [{"name":"var1", "value": "value"}]}' ${INVOCATION_URL}
```

For more information on other Structure run APIs, check out the [StructureRuns API docs](../api/api-reference.md/#/StructureRuns).

## Using the Griptape Framework

You can use [StructureRunDrivers](../../griptape-framework/drivers/structure-run-drivers.md/#griptape-cloud) to run your Structure with Griptape.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Griptape Topic Guides discuss key topics at a high level and provide useful back

### Griptape Cloud

[Griptape Cloud](griptape-cloud/api/api-reference.md) provides an overview of the APIs available in the managed cloud service.
[Griptape Cloud](griptape-cloud/index.md) provides an overview of the features in Griptape's cloud offering.

### Griptape Framework

Expand Down
12 changes: 10 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,18 @@ nav:
- Contributing: "contributing.md"
- Cloud:
- Overview: "griptape-cloud/index.md"
- Data Sources:
- Create a Data Source: "griptape-cloud/data-sources/create-data-source.md"
- Refreshing Your Data: "griptape-cloud/data-sources/refresh-data.md"
- Knowledge Bases:
- Create a Knowledge Base: "griptape-cloud/knowledge-bases/create-knowledge-base.md"
- Accessing Your Data: "griptape-cloud/knowledge-bases/accessing-data.md"
- Structures:
- Create a Structure: "griptape-cloud/structures/create-structure.md"
- Structure Config YAML: "griptape-cloud/structures/structure-config.md"
- Running Your Structure: "griptape-cloud/structures/run-structure.md"
- Cloud API:
- API Reference: "griptape-cloud/api/api-reference.md"
- Structures:
- Structure Config: "griptape-cloud/structures/structure-config.md"
- Framework:
- Overview: "griptape-framework/index.md"
- Structures:
Expand Down
Loading