Build Your Product
on Prometheux
Python and TypeScript libraries for the application you are shipping. Your code owns the product. Prometheux runs the rules and returns the result, the same one on every run.
| plant | supplier | tier |
|---|---|---|
| Lyon | Kora Steel | 2 |
| Turin | Kora Steel | 3 |
| Gdańsk | Kora Steel | 1 |
Call a Rule
from Your App
Install
pip install prometheux-chain or npm install @pmtx/chain.
Point it at your workspace
Set PMTX_TOKEN and JARVISPY_URL. The client reads them from the environment.
Call the rule
Run a concept that already exists, or send a Vadalog program your repository owns. Read the rows back.
Ship the product
The same calls run in a notebook, a service, a test suite or a browser app. The rule stays in Prometheux.
The Calls Your
Product Makes
Run a concept, read its output, stream the agent into your interface, or check a program in the test suite. The HTTP stays inside the library.
- A rule you already have:
run_conceptexecutes it.fetch_resultspages the output into your application. - A program in your repo: keep a
.vadafile next to the app and evaluate it on the Prometheux engine without saving it as a concept first. - The agent, in your UI: iterate the chat stream and render each event as it arrives.
# Python 3.9+ pip install --upgrade prometheux-chain # TypeScript, Node.js 22+ or a browser npm install @pmtx/chain
import os
import prometheux_chain as px
os.environ["PMTX_TOKEN"] = "YOUR_PMTX_TOKEN"
px.config.set("JARVISPY_URL", "https://api.prometheux.ai/jarvispy/{organization}/{username}")
px.run_concept(ontology_id=ontology_id, concept_name="at_risk")
rows = px.fetch_results(ontology_id=ontology_id, output_predicate="at_risk")
import { Prometheux } from "@pmtx/chain";
const px = new Prometheux();
const run = await px.concepts.run(ontologyId, "at_risk");
const page = await px.concepts.fetchResults(ontologyId, "at_risk", { pageSize: 50 });
console.log(run.total_records, page.results.columnNames);
import { readFile } from "node:fs/promises";
import { Prometheux } from "@pmtx/chain";
const px = new Prometheux();
const program = await readFile("programs/supplier-risk.vada", "utf8");
const result = await px.vadalog.evaluate(program);
def test_at_risk():
program = open("programs/supplier-risk.vada").read()
px.check_program(program, expect={"at_risk": "expected/at_risk.csv"}).assert_ok()
for event in px.agent_chat(ontology_id=ontology_id, message="Which plants are at risk?"):
if event["type"] == "content":
print(event["data"]["chunk"], end="")
Prometheux Behind
Your Interface
The library is how your product asks Prometheux a question it already knows how to answer. You do not rebuild the rule in application code.
Services and notebooks
Python functions for a backend, a job or a Jupyter notebook. Generators for runs and agent events that stream.
TypeScript, including the browser
Typed requests, responses and errors. ESM and CommonJS. An internal browser app can call Prometheux directly.
Tests for the rules you depend on
check_program compares a program's output with a CSV or a list. assert_ok() fails the pytest run when it changes.
The agent in your product
Stream tool calls and content into the interface you design. The facts still come from a rule.
Another language, or a pipeline that only needs HTTP? Use the API. The SDK is for the product you are writing.
Your App,
Our Rules
A service that returns a ruled answer
Your API receives the question, calls run_concept, and returns the result to the caller. The rule is not copied into the service.
An internal app in the browser
The TypeScript client runs in the browser, so an internal tool can call the engine without an application server of its own.
TypeScript SDK →Rules that live next to the app
Keep .vada files in the repository and evaluate them from the SDK. The engine runs them; the app reads the output.
Your interface, the Prometheux agent
Stream the agent's events into a chat you designed. Tool calls, proposals and the answer arrive as they happen.
Python SDK →Questions,
Answered
SDK, API, CLI or MCP?
Use the SDK when you are writing the product in Python or TypeScript. Use the API from any other language, or from a pipeline. Use the CLI to export an ontology as files, test it and apply it. Use MCP when a model or agent does the asking.
Which languages and runtimes?
prometheux-chain supports Python 3.9 or newer. @pmtx/chain supports Node.js 22 or newer and modern browsers.
Can a public website call the SDK from the browser?
The TypeScript client runs in the browser, which suits an internal tool. A public app must not ship the token to visitors. Keep it on your server and follow the frontend guide.
Can I run Vadalog that lives in my repository?
Yes. evaluate_program in Python and vadalog.evaluate in TypeScript send a program to the engine without saving it as a concept. Saving it into an ontology is a separate call.
How do I test a rule from pytest?
check_program runs the program and compares each output with the rows you expect. assert_ok() raises when they differ. A machine must be running. The CLI's px test runs the same check from files and writes JUnit XML.
Do the libraries cover the platform?
Yes. Concepts, data sources, apps, schedules, context, sharing and the agent are methods on the client. The function reference lists them.
Are they open source?
Yes. prometheux-chain and prometheux-chain-ts are on GitHub, with runnable TypeScript examples.
More Ways to Build
Call a Rule
from Your App
Install the library, point it at your workspace and run a concept you already have.