Introduction

Introducing PAC-1

PAC-1 is the first-generation program synthesis engine we're building at Maya Labs. It's a prototype natural language interpreter that converts the symbols in which humans think (natural language) to symbols in which machines think (programs).

The PAC scripting language is built from the ground-up to write discrete programs which describe their own behaviour - making it easy for both a machine to write precise code, and for a human to interpret the generated code.

1. trigger on receive
2. research {{term}} on wikipedia
3. extract 'title' and 'summary' from tabular data
4. send response back

SDK

The Maya Labs Python SDK (opens in a new tab) provides easy access to PAC-1. Broadly, it does the following :

  1. Takes in a list of steps written in English / pseudocode.
  2. Generates a discrete program graph step-wise.
  3. Deploys ready-to-use software on our on-demand compute.

For edits, PAC-1 incrementally detects, generates and deploys only changes. By abstracting away the code, dependencies and deployment, it centers focus on just instructing the machine what to do.

Follow the quickstart guide below or a slightly more detailed tutorial here to learn more about how it works.

Installation

Run the command below to install the mayalabs package locally.

pip install mayalabs

Quickstart

Write steps in natural language.

main.py
import mayalabs
 
script = """
1. trigger on receive
2. research {{term}} on wikipedia
3. extract 'title' and 'summary' from tabular data
4. send response back
"""

Generate & deploy as a function.

main.py
function = mayalabs.Function(name="WikiScrape")
# Creating new worker...
 
function.update(script=script)
# Generating program graph...
# Starting worker...
# Installing dependencies...
# Deployed!

Call the function to run it.

main.py
output = function.call({"term": "Dr. Vikram Sarabhai"})
print(output)
# finds and outputs title and summary from wikipedia results

Setting the API key

Get the Maya Labs API key from the Settings > Developers (opens in a new tab) section.

export MAYA_API_KEY = "mayakey-..."

Or set mayalabs.api_key to its value:

main.py
import mayalabs
 
mayalabs.api_key = "mayakey-..."
 
script = """
1. trigger on receive
2. research {{term}} on wikipedia
3. extract 'title' and 'summary' from tabular data
4. send response back
"""
 
function = mayalabs.Function(name="Scrape2")
 
function.update(script=script)
 
output = function.call({"term": "Dr. Vikram Sarabhai"})
print(output)
 

Requirements

  • Python 3.7.1+

Issues

All feedback and bug reports welcome! Report in the issues section (opens in a new tab), or mail us at humans@mayalabs.io.

Roadmap

  • Cleaner logs and exception handling
  • Dependency configuration UX improvement
  • Import skill repositories for reusing skills created by user or present in store
  • Create and call downstream auto-deployed functions
  • Allow multi-profile and team profile access