Skip to content

BrightforestX/restack_get_started

Repository files navigation

Restack AI SDK - Get Started Example

This repository contains a simple example project to help you get started with the Restack AI SDK. It demonstrates how to set up a basic workflow and functions using the SDK.

Prerequisites

  • Python 3.8 or higher
  • Poetry (for dependency management)
  • Docker (for running the Restack services)

Usage

  1. Run Restack local engine with Docker:

    docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main
  2. Open the web UI to see the workflows:

    http://localhost:5233
  3. Clone this repository:

    git clone https://github.com/restackio/examples-python
    cd examples-python/examples/get-started
  4. Install dependencies using Poetry:

    poetry env use 3.12
    poetry shell
    poetry install
    poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.)
  5. Run the services:

    poetry run dev

    This will start the Restack service with the defined workflows and functions.

  6. In a new terminal, schedule the workflow:

    poetry shell
    poetry run schedule

    This will schedule the GreetingWorkflow and print the result.

  7. Optionally, schedule the workflow to run on a specific calendar or interval:

    poetry run calendar
    poetry run interval

Project Structure

  • src/: Main source code directory
    • client.py: Initializes the Restack client
    • functions/: Contains function definitions
    • workflows/: Contains workflow definitions
    • services.py: Sets up and runs the Restack services
  • schedule_workflow.py: Example script to schedule and run a workflow

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •