AbstractBackend dataclass

Bases: ABC

facts abstractmethod property

Returns a set of facts.

heuristics abstractmethod property

Returns a set of heuristics.

inferencers abstractmethod property

Returns a set of inferencers.

add_fact(fact) abstractmethod

Adds a fact to the backend.

add_heuristic(heuristic) abstractmethod

Adds a heuristic to the backend.

add_inferencer(inferencer) abstractmethod

Adds an inferencer to the backend.

load(storage_dir) abstractmethod

Loads from the specified directory.

load_all() abstractmethod

Loads all facts, inferencers, and heuristics, if appropriate. Some backends may not need to, and only load on demand (e.g., a database backend).

query(user_input, conversation=None) abstractmethod

Queries the backend with the user input. Response may be in the form {"response": "some response", "response_object": some_object}

save(storage_dir) abstractmethod

Saves to the specified directory.

select_facts(criteria) abstractmethod

Returns a set of facts that match the criteria.

select_heuristics(criteria) abstractmethod

Returns a set of heuristics that match the criteria.

select_inferencers(criteria) abstractmethod

Returns a set of inferencers that match the criteria.