Python API
The public FrameX-Core Python package contains the client for the reasoning engine, an external-tool host, model-provider integration, dialogue flows and a coverage interviewer. It requires Python 3.10 or newer and has no third-party runtime dependencies. The Rust engine is installed separately.
Where the FrameX Syntax describes what you write, the Python API describes how a program drives the engine: loading programs, asking queries and revising state.
from framex import Client
with Client() as client:
client.load("world open.\n socrates:Human.\n ?X:Mortal <- ?X:Human.")
result = client.query("?- socrates:Mortal.")
print(result) # {'status': 'true'}
In the following chapters, the Python API will be explained:
- Installation and Quick Start
- Add FrameX to a uv Project
- Client
- Tool Calling
- Tool Reference
- Model Settings and Replay
- Dialogue and Interviews
The Python API Exercise teaches the persistent client. The hybrid section explains how to choose a coupling and keep acceptance decisions in rules.