Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/arg-tech/xaif/llms.txt

Use this file to discover all available pages before exploring further.

The AIF class is the primary entry point for working with xAIF structures. It wraps an xAIF JSON document and exposes methods for adding components, querying the graph, and exporting data. Whether you are starting from a plain text string or loading a fully structured xAIF dict, AIF normalises the input into a consistent in-memory representation that all other methods operate on.

Import

from xaif import AIF

Constructor

AIF(xaif)
xaif
dict | str
required
Either an xAIF-compliant dict or a plain text string.
  • dict — The constructor reads the AIF key directly and populates all instance attributes from it. The dict must contain at minimum an AIF key whose value has nodes, edges, locutions, and participants sub-keys.
  • str — The constructor calls initilise_empty internally, which creates one L-node and one locution attributed to "Default Speaker" from the provided text, then parses the resulting JSON back into a dict. This is the fastest way to bootstrap a new argument graph from raw text.

Instance Attributes

After construction the following attributes are available on every AIF instance. They are live references into the underlying dict — mutations via add_component or remove_entry are immediately reflected.
xaif
dict
The full xAIF document, including all top-level keys (AIF, dialog, ova, text).
aif
dict
The AIF section of the document — equivalent to xaif["AIF"]. Contains nodes, edges, locutions, participants, schemefulfillments, and descriptorfulfillments.
nodes
list
Shortcut to aif["nodes"]. Each entry is a dict with keys nodeID, text, and type (one of "L", "I", "YA", "RA", "CA", "MA").
locutions
list
Shortcut to aif["locutions"]. Each entry is a dict with nodeID (the L-node this locution maps to) and personID (the participant who uttered it).
participants
list
Shortcut to aif["participants"]. Each entry is a dict with participantID, firstname, and surname.

Initialisation Examples

# From plain text — automatically creates an L-node and locution
# attributed to "Default Speaker"
aif = AIF("Climate change is accelerating.")
# From an existing xAIF dict
xaif_data = {
  "AIF": {
    "nodes": [{"nodeID": 0, "text": "Climate change is real.", "type": "I"}],
    "edges": [],
    "locutions": [],
    "participants": [],
    "schemefulfillments": None,
    "descriptorfulfillments": None
  },
  "dialog": False,
  "ova": [],
  "text": {"txt": "Climate change is real."}
}
aif = AIF(xaif_data)

add_component

Add locutions, propositions, argument relations, and segments to a graph.

Query Methods

Validate structure, look up speakers, traverse edges, and manage node IDs.

Export Methods

Export argument relations as DataFrames and serialise graphs to JSON.

Build docs developers (and LLMs) love