Build and run the inference engine
1. Workflow
- Prepare facts and rules.
- Create an
InferenceEngine. - Build a
QueryStructure. - Run inference and inspect logs.
2. Prepare facts and rules
InferenceEngine can load knowledge in two ways:
- Pass Python lists (facts / rules).
- Pass a directory or file path to let
FactBase/RuleBaseload them.
from al_inference_engine.main import InferenceEngine
fact1 = ...
rule1 = ...
engine = InferenceEngine(
fact_base=[fact1],
rule_base=[rule1],
)
For configuration options such as interactive_query_mode and trace, see Config.
For customizing selection modules, see Custom Modules.