How fanxxxks/engineering-problem-solving-agent works
This is a competition-oriented engineering problem-solving agent for calculus, linear algebra, circuits, and physics. A user’s question is normalized, routed to a subject, and solved through UnifiedAgent’s selectable modes. The main reasoning path uses a ReAct loop with LLM calls and tools; legacy analysis-and-drafting and tool-only modes are also supported. Retrieval supplies similar examples and formulas, while numerical, image, and unit tools cover distinct capabilities. The README documents these product branches; some internal tool-dispatch links are not visible in the sampled excerpts and are omitted.
Main entry points: unified_agent.py Unified solver · tool_dispatcher.py Tool dispatcher · reasoning_engine.py ReAct reasoning · similarity_tool.py Similar-problem search
Components 21
Question orchestration
- Question normalization
eng_solver_agent/adapter.py - Subject router
eng_solver_agent/router.py - Unified solver
eng_solver_agent/unified_agent.py - Question and result schemas
eng_solver_agent/schemas.py - Submission formatter
eng_solver_agent/formatter.py - Result verifier
eng_solver_agent/verifier.py
Reasoning and LLM
- ReAct reasoning
eng_solver_agent/reasoning_engine.py - Prompt builder
eng_solver_agent/llm/prompt_builder.py - Kimi client
eng_solver_agent/llm/kimi_client.py
Solving tools
- Tool dispatcher
eng_solver_agent/tool_dispatcher.py - Numerical computation
eng_solver_agent/tools/numerical_tool.py - Image interpretation
eng_solver_agent/tools/image_tool.py - Similar-problem search
eng_solver_agent/tools/similarity_tool.py - Unit conversion
eng_solver_agent/tools/unit_tool.py
Knowledge retrieval
- Hybrid vector retrieval
eng_solver_agent/retrieval/langchain_retriever.py - Keyword retrieval
eng_solver_agent/retrieval/retriever.py - Result reranking
eng_solver_agent/retrieval/reranker.py - Knowledge-base loader
eng_solver_agent/retrieval/kb_loader.py
Other components
- Question submitter
- Kimi API
- Formula and example data
Connections 22
- Question submitter → Unified solver: submits question
- Unified solver → Question normalization: normalizes input
eng_solver_agent/unified_agent.py - Unified solver → Subject router: routes subject
eng_solver_agent/unified_agent.py - Unified solver → ReAct reasoning: runs ReAct
eng_solver_agent/unified_agent.py - Unified solver → Tool dispatcher: dispatches tools
eng_solver_agent/unified_agent.py - Unified solver → Submission formatter: formats answer
eng_solver_agent/unified_agent.py - Unified solver → Result verifier: validates result
eng_solver_agent/unified_agent.py - ReAct reasoning → Prompt builder: builds prompts
- ReAct reasoning → Kimi client: requests reasoning
- Kimi client → Kimi API: calls API
eng_solver_agent/llm/kimi_client.py - ReAct reasoning → Tool dispatcher: invokes actions
- Tool dispatcher → Numerical computation: runs computation
- Tool dispatcher → Similar-problem search: searches examples
- Tool dispatcher → Image interpretation: interprets images
- Tool dispatcher → Unit conversion: converts units
- Similar-problem search → Hybrid vector retrieval: searches semantically
eng_solver_agent/tools/similarity_tool.py - Similar-problem search → Result reranking: reranks results
eng_solver_agent/tools/similarity_tool.py - Similar-problem search → Keyword retrieval: uses fallback search
eng_solver_agent/tools/similarity_tool.py - Hybrid vector retrieval → Knowledge-base loader: loads records
eng_solver_agent/retrieval/langchain_retriever.py - Keyword retrieval → Knowledge-base loader: loads records
eng_solver_agent/retrieval/retriever.py - Knowledge-base loader → Formula and example data: reads records
eng_solver_agent/retrieval/kb_loader.py - Unified solver → Question submitter: returns answer