Compfigurator is a rule-based expert system for recommending complete PC builds based on a user’s intended workload and budget.
It uses:
- Experta for the knowledge-engine/rule system
- Streamlit for an interactive chat-style UI
- A JSON knowledge base containing tasks, budget allocation rules, components, and explanations
Given:
- a target workload (for example,
gamingormachineLearning) - a budget
the system selects compatible components and returns:
- a best configuration
- alternative configurations
- a confidence/score and itemized pricing
- short per-component explanations (task-aware where available)
Current workload/task keys in the knowledge base:
scientificmachineLearninggraphicDesignengineeringgamingofficesoftwareDevelopmentvideoEditingAndAnimationcontentCreationhomeTheatregeneral
compfigurator/
├── compfigurator/
│ ├── __init__.py
│ ├── main.py # Expert system engine (CLI entry style)
│ ├── streamlit_app.py # Streamlit UI
│ └── knowledge_base.json # Tasks, components, and explanation rules
├── tests/
├── pyproject.toml
└── README.md
- Python (project currently declares
^3.12inpyproject.toml) - Poetry for dependency management
Install Poetry (if needed):
pip install poetryFrom the repository root:
poetry installOptional Poetry environment commands:
poetry env use python3.12
poetry shellExit the virtual environment:
exitFrom repository root:
poetry run streamlit run compfigurator/streamlit_app.pyWhat to expect:
- On startup, the app lists available workload types.
- You provide workload, then budget.
- The app returns the best build and can show alternatives.
- “View Knowledge Base” displays loaded data in tabs.
From repository root:
poetry run python compfigurator/main.pyThe CLI prompts for workload and budget, then prints the selected configuration and an alternative.
The engine progressively applies compatibility and budget constraints in this order:
- CPU
- Motherboard (socket/chipset compatibility)
- GPU (PCIe slot and budget constraints)
- RAM (DDR type + speed constraints)
- Storage (interface compatibility)
- Monitor (remaining budget suitability)
Then it:
- computes a configuration score
- keeps the best-scoring option
- stores other valid options as alternatives
Main data file:
compfigurator/knowledge_base.json
You can customize:
- workload/task definitions (
taskRequirements) - budget allocation percentages (
budgetAlloc) - component catalogs (
processors,motherboards,gpus,ram,storage,monitors) - explanation strings per component (
explain)
When changing schema keys, ensure compfigurator/main.py still matches expected names.
Install/update/remove dependencies:
poetry add <package_name>
poetry remove <package_name>
poetry updateRun any command in the Poetry environment:
poetry run <command>Run tests:
poetry run pytestInstall Poetry first:
pip install poetryThis repository currently declares Python ^3.12 in pyproject.toml.
If you encounter runtime/dependency issues with experta in your local environment, use the same Python version configured for the project and recreate the Poetry environment:
poetry env remove --all
poetry env use python3.12
poetry installUse / separators in shell commands from this README. If you adapt commands for Windows shells, adjust paths accordingly.