Skip to main content

Vadalog API

The Vadalog API exposes JarvisPy routes for analyzing programs, managing bind annotations, and evaluating logic against the Vadalog engine.

Python SDK: There are no dedicated Vadalog helpers in prometheux_chain. Call these endpoints with your HTTP client (for example httpx or requests) against your JarvisPy base URL, with a valid JWT.


Analyze Program

Inspect a Vadalog program without executing it. Returns predicate structure derived from the parser.

HTTP: POST /api/v1/vadalog/analyze

Body (JSON)

FieldTypeRequiredDescription
programstringYesVadalog program source
conceptTypestringNoWhen "sql", program is treated as SQL (use with conceptName)
conceptNamestringNoConcept / output predicate name when using SQL mode

Response (data)

FieldDescription
headPredicatesHead predicates in the program
inputPredicatesInput predicates
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/analyze" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"program": "@input(\"products\").\n@output(\"expensive_products\").\nexpensive_products(Product, Price) <- products(Product, Price), Price > 100."
}'

Example shape of data:

{
"headPredicates": ["expensive_products"],
"inputPredicates": ["products"]
}

Parse Binds

Parse @bind / @qbind annotations from a program and separate rule code from datasource bindings.

HTTP: POST /api/v1/vadalog/parse-binds

Body (JSON)

FieldTypeRequiredDescription
programstringYesFull Vadalog source including annotations
outputPredicatestringNoExtra predicate name to treat as output when classifying binds

Response (data)

FieldDescription
codeProgram text without annotation lines
binds{ "input": [...], "output": [...] } — each entry includes predicate, annotation, and parsed fields when available
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/parse-binds" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"program": "@bind(\"data\",\"csv useHeaders=true\",\"/tmp\",\"test.csv\").\nresult(X) <- data(X).\n@output(\"result\").",
"outputPredicate": "result"
}'

Build Bind

Rewrite an existing bind annotation for a new predicate name. When isOutput is true, the output target (e.g. CSV filename or query name) is updated for output usage.

HTTP: POST /api/v1/vadalog/build-bind

Body (JSON)

FieldTypeRequiredDescription
bindAnnotationstringYesFull @bind(...) or @qbind(...) annotation
predicateNamestringYesNew predicate name
isOutputbooleanNoDefault false. If true, adjust output table/query naming

Response (data)

FieldDescription
annotationUpdated annotation string
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/build-bind" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"bindAnnotation": "@bind(\"old_pred\",\"csv useHeaders=true\",\"/tmp\",\"data.csv\").",
"predicateName": "new_pred",
"isOutput": false
}'

Evaluate Program

Run a Vadalog program with optional parameters and compute hints. JarvisPy parses the program and delegates execution to the engine (local or configured compute).

Not available in SDK — use REST API directly.

There is no evaluate_vadalog (or similar) in the Python SDK. Use POST /api/v1/vadalog/evaluate with requests, httpx, or another HTTP client.

Response

Successful responses use the standard JarvisPy envelope: status, message, and data. The data field contains the evaluation payload returned by the Vadalog client (structure depends on the program and engine).

{
"data": {},
"message": "Vadalog program evaluated successfully",
"status": "success"
}

Evaluate with parameters (engine proxy)

Proxy to the Vadalog engine's evaluateWithParams endpoint. Uses multipart form data (application/x-www-form-urlencoded / multipart/form-data), not JSON.

HTTP: POST /api/v1/vadalog/evaluateWithParams

InputDescription
Form: programRequired. Vadalog program text
Query: measureElapsedTimeOptional. Default false

JarvisPy forwards program and measureElapsedTime to the engine and supplies empty default params and databricksConfigs in the proxied request.

The response body is whatever the engine returns (not necessarily the same envelope as POST /evaluate).

curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/evaluateWithParams?measureElapsedTime=false" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
--form-string 'program=@input("x").@output("y").y(1).'

Stop Evaluation

Signals the engine to stop the current evaluation and breaks any in-flight wait on the JarvisPy side.

HTTP: GET /api/v1/vadalog/stop

curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/stop" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Get Engine Status

Lightweight JarvisPy health-style check for the evaluation service (not per-execution polling).

HTTP: GET /api/v1/vadalog/status

Response (data)

FieldDescription
statusService readiness indicator (e.g. "ready")
timestampISO timestamp
curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/status" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Example:

{
"data": {
"status": "ready",
"timestamp": "2026-03-30T12:00:00.000000"
},
"message": "Evaluation service status retrieved successfully",
"status": "success"
}

Complete Workflow Example

REST-only flow: analyze structure, optionally parse binds, then evaluate.

# 1. Analyze structure
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/analyze" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"program": "@input(\"products\").\n@output(\"expensive_products\").\nexpensive_products(Product, Price) <- products(Product, Price), Price > ?threshold."}'

# 2. Parse binds (skip if the program has no @bind / @qbind)
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/parse-binds" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"program": "@input(\"products\").\n@output(\"expensive_products\").\nexpensive_products(Product, Price) <- products(Product, Price), Price > ?threshold.", "outputPredicate": "expensive_products"}'

# 3. Evaluate with parameters
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/vadalog/evaluate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"program": "@input(\"products\").\n@output(\"expensive_products\").\nexpensive_products(Product, Price) <- products(Product, Price), Price > ?threshold.", "params": {"threshold": 100}}'

Replace YOUR_JWT_TOKEN and the org/user path with your values.