AIsaac works on any field with competing theoretical frameworks. Here's how to add yours:
Create a file like examples/domains/your_field.py with:
DOMAIN = {
"name": "Your Field",
"theories": [
{
"name": "Theory A",
"slug": "theory_a",
"key_object": "what this theory is built on",
"arxiv_categories": ["cond-mat.str-el"],
"search_queries": ["search terms for arXiv"],
"seed_papers": ["arXiv IDs of key papers"],
"key_parameters": ["coupling constants, etc."],
},
# ... more theories
],
"comparable_quantities": [
{
"slug": "observable_name",
"name": "Human Readable Name",
"description": "What this quantity measures",
"keywords": ["terms that identify this quantity in papers"],
},
# ... more quantities
],
}Convert your domain definition into TheoryDef entries in the THEORIES list. Update the QuantityType enum to include your comparable quantities.
In ingestion/extractor.py, update the quantity_type list in EXTRACTION_PROMPT to include your domain's quantity types with keyword descriptions.
In knowledge/known_connections.py, add KnownConnection entries for results that are already established in your field. The system should rediscover these — if it doesn't, something is wrong.
In demo.py, add manually curated seed formulas from your domain to validate the comparison engine offline before hitting the API.
uv run aisaac --tier 1The comparison engine in comparison/engine.py has multiple matchers. To add a new one:
- Create a class with a
compare(expr_a, expr_b) -> (score, details)method - Register it in
ComparisonEngine.__init__ - Add its score to the
combined_scorecalculation
The LLM extraction quality determines everything downstream. Key files:
ingestion/extractor.py— the extraction and normalization promptsingestion/latex_parser.py— pre-parsing LaTeX to feed the LLM structured inputknowledge/normalizer.py— notation standardization rules
To improve extraction:
- Add more examples to the extraction prompt for your domain
- Add domain-specific notation aliases to
normalizer.py - Test on 10 papers manually before scaling up
pip install black ruff
black aisaac/
ruff check aisaac/ --fix- Fork the repo
- Create a feature branch
- Make your changes
- Run the offline demo:
uv run python -m aisaac.demo - Submit a PR with a description of what you changed and why