Developer Documentation & Code Layout
Modifying LLM Prompts
If you need to change how the system parses BODMAS rules, modify the ChatPromptTemplate inside src/agents/planner.py.
prompt = ChatPromptTemplate.from_messages([
("system", "You are a mathematical expression parser..."),
("user", "Expression: {expression}")
])
Adding New Operations (e.g. Exponents)
- Add a new agent file
src/agents/exponent.py. - Update
OperationTokeninsidesrc/agents/planner.pyto allow"exponent"in theopfield description. - Import the new node into
src/graph.py. - Add the node to the
workflow:workflow.add_node("exponent", exponent_node). - Add the routing logic in
route_from_planner:elif op == "exponent": return "exponent". - Add the return edge:
workflow.add_conditional_edges("exponent", route_from_math, ...).
Running the Test Suite
The system uses pytest. Telemetry is explicitly disabled during testing to avoid polluting your Langfuse dashboard with test runs.
./scripts/test_all.sh