Graphon Docs

Create your first bucket

Write objects to a smart bucket with the Graphon API. Graphon indexes each object for search and query.

Overview

A Graphon bucket holds objects, like an S3 bucket. When you enable search, Graphon reads each object and indexes it. This guide creates a bucket, puts an object, and reads the same bytes back. It uses the graphon CLI. The CLI uses your API key from GRAPHON_API_KEY, or your graphon login.

1. Create a bucket

A name is enough. A bucket with no provider or region uses gcp and the US multi-region, and keeps --indexing enabled, so Graphon indexes new objects. In a terminal the command asks for those three first, because all three are fixed after creation. Run graphon buckets locations to see every region. Creation waits until the bucket is ready and its phase is active.

Names are unique within the selected workspace and are case-sensitive. Use 1–255 ASCII letters, digits, periods, underscores, or hyphens. The exact names . and .. are invalid. You can rename a bucket later.

CLI

graphon buckets create support-tickets

# Or name the settings yourself. They are fixed after creation.
graphon buckets create support-tickets \
  --provider gcp --location us-central1 --indexing enabled

Or create it with the Graphon HTTP API. Send your API key as a Bearer token:

cURL

curl --request POST \
  --url "$GRAPHON_STORAGE_ORIGIN/v1/workspaces/$GRAPHON_WORKSPACE_ID/buckets" \
  --header "Authorization: Bearer $GRAPHON_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"name": "support-tickets", "provider": "gcp", "location": "us-central1"}'

2. Put an object

Upload a file under a key. The CLI switches to a multipart upload for files over 64 MiB.

CLI

graphon objects put support-tickets incidents/checkout-timeout.json \
  --file ./checkout-timeout.json

Add metadata with --metadata key=value, once for each pair, or with x-amz-meta-key headers from S3 tools. A key is lowercase letters, digits, periods, underscores, or hyphens. A value is printable ASCII of at most 1,024 bytes, and all metadata of one object takes at most 2,048 bytes. Search uses metadata, and a search filter can match it: see Filter by metadata.

Prefer raw HTTP?

Working straight over HTTP? The JSON API returns a presigned S3 request for each upload and download, and each object key travels as a base64url segment. See Presign an S3 request.

Large files?

Uploading something big with an S3 tool? Check out our Uploading large files guide.

3. Read it back

Download the object and confirm the bytes match.

CLI

graphon objects get support-tickets incidents/checkout-timeout.json \
  --output ./roundtrip.json

4. List objects

List a folder with a prefix. Pass --json to get the raw response for a script.

CLI

graphon objects list support-tickets --prefix incidents/

Run it from the docs

You can run these calls without a terminal. Open the Storage reference, sign in, pick a workspace, and press Send.

Next

  1. Rank the objects of a bucket against a text in Search your objects.
  2. Get one answer with a citation for each source in Answer a question.
  3. Partition data by tenant in Tenant isolation.
  4. Share an object for 15 minutes with a presigned GetObject from Presign an S3 request.
Was this page helpful?
View as Markdown