Thinkflux Client

TFClient is the main class utilized to interface with a Thinkflux reasoning agent. It provides several helper functions and API calls to aid in data input, agent configuration, and debugging.


class ia.gaius.thinkflux_client.TFClient(tf_info: dict, verify: bool = True)

Bases: object

Thinkflux Client Wrapper (interface to TF REST API)

__init__(tf_info: dict, verify: bool = True) None
add_interface_nodes(agent_config: dict) dict

Add an interface node from GAIuS agent to Thinkflux

  • agent_config (dict) – dictionary with configuration details for interface node

  • fields (agent_config dict needs the following) –

  • { – “name”: str, “domain: str, “secure”: bool, “api_key”: str, “interface_nodes”: List[str]

  • }

add_schema_symbol_information() Response
bootstrap_concepts(hierarchy: bool = False, labelled: bool = False, use_labels_for_concepts: bool = False, use_labels_for_hierarchy: bool = False, subsequence_clustering: bool = False, **kwargs) Response


  • hierarchy (bool, optional) – Whether to generate a hierarchy of concepts. Defaults to False.

  • labelled (bool, optional) – If the dataset contains labels. Defaults to False.

  • use_labels_for_concepts (bool, optional) – Whether labels should be used for concept names. Defaults to False.

  • use_labels_for_hierarchy (bool, optional) – Make a hierarchy using labels. Defaults to False.

  • subsequence_clustering (bool, optional) – Perform subsequence clustering when generating concepts. Defaults to False.

  • **kwargs – Other arguments to pass


Response object from requests

Return type:


clear_all_emotives() dict
clear_all_kbs() dict
clear_concepts_and_instances() dict

Remove all Concepts and instances from Thinkflux



Return type:


clear_wm() dict
delete_interface_nodes(data: dict) Response
dreamer(data: dict) Response
evaluate_world(data: dict) dict
get_concept(concept_name: str) dict

Retrieve a single concept from Thinkflux by concept name


concept_name (str) – Name of the ooncept to retrieve

get_concepts() dict

Retrieve all concepts from Thinkflux

get_instances() dict

Retrieve current instances from Thinkflux

get_model_association_networks() Response
get_plan() dict
get_rules_kb() dict
get_symbolic_goal() dict
investigate(data: dict) Response
list_interface_nodes() dict
load_schema_base(schema_base: dict) Response

Load a SchemaBase on Thinkflux, from a dictionary object


schema_base (dict) – the SchemaBase to load


requests Response object

Return type:


observe(data: dict) dict

Observe data on Thinkflux


data (dict) – data percept to observe

ping() str

Ensure connection can be established with Thinkflux. Sanity check.


TFQueryError – _description_



Return type:


set_rules_kb(rules_kb: dict) dict
set_symbolic_goal(symbolic_goal: dict) dict
set_verify(verify: bool)
show_status() dict
timer() Response
update_schema(data: dict) Response