Skip to main content

DDx: Dynamic Diagnosis System for Mathematical Problem Solving

DDx (Dynamic Diagnosis) is an intelligent, iterative problem-solving system inspired by the critical-thinking process seen in House M.D.. It is designed to break down complex mathematical problems into manageable phases, leveraging multiple agents to collaboratively solve and refine solutions.


🚀 Features

  • Phased Problem Solving: DDx splits problem-solving into six logical phases:

    1. Understanding: Decipher the problem statement and identify goals.
    2. Decomposition: Break the problem into smaller, solvable components.
    3. Planning: Create a strategy to solve the subproblems.
    4. Execution: Solve each component systematically.
    5. Verification: Validate the solutions against the original problem.
    6. Compilation: Combine results into a cohesive final answer.
  • Interactive Agents: Mimics the dynamic interaction of "House" (critical guide) and "Team" (problem solvers) to iteratively improve solutions.

  • Tool Integration: Leverages symbolic computation (e.g., SymPy) for mathematical operations during the execution phase.

  • Verbose Debugging: Option to enable detailed output for tracking agent reasoning and decision-making.


🧠 How It Works

  1. Input a Problem: Provide a complex mathematical or symbolic problem to DDx.
  2. Iterative Problem-Solving:
    • The "House" agent oversees the process, iteratively questioning and refining the solution.
    • The "Team" agent generates outputs for each phase.
  3. Tools & Execution: Utilize computational tools like SymPy for precise calculations.
  4. Verification & Refinement: Validate and refine solutions until the "House" agent is satisfied.
  5. Final Answer: Output a fully solved and explained solution.

🔨 How to use?

Ensure you have OPENAI_API_KEY in the environment and the API is just one function.

from ddx_ai import DDx

DDx("<question>", verbose=False)

📄 Example Usage

Input Problem

Nondimensionalize the polynomial: [ P(x) = a_1 x^{25} + a_2 x + a_3 ] into the form: [ \epsilon y^{25} + y + 1 ] Express (\epsilon) as a function of (a_1), (a_2), and (a_3).

Output

  1. Understanding Phase:

    • Identify the goal: Transform the polynomial into the specified nondimensional form.
    • Extract key coefficients: (a_1), (a_2), (a_3).
  2. Decomposition Phase:

    • Break the problem into:
      • Variable scaling ((L)) to make (y^1) coefficient equal to 1.
      • Normalizing the constant term to 1.
      • Calculating (\epsilon).
  3. Execution Phase:

    • Perform substitutions: (x = L y), where (L = \frac{1}{a_2}).
    • Solve for (\epsilon = \frac{a_1 a_3^{24}}{a_2^{25}}).
  4. Verification Phase:

    • Substitute back into the polynomial to ensure it matches the desired form.
  5. Compilation Phase:

    • Final answer: [ \boxed{\epsilon = \frac{a_1 a_3^{24}}{a_2^{25}}} ]

💡 Key Design Principles

  1. Iterative Refinement:
    • Mimics real-world diagnostic processes to refine solutions through critical questioning.
  2. Dynamic Interactions:
    • Encourages agents to think critically, ensuring high-quality solutions.
  3. Phased Approach:
    • Logical segmentation for tackling complex problems methodically.

Metadata

Release files for ddx-ai 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ddx-ai 0.1.5
File Size Uploaded
ddx_ai-0.1.5.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ddx-ai 0.1.5
File Interpreter ABI Platform
ddx_ai-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 kB

Release files / ddx_ai-0.1.5.tar.gz

Download URL ddx_ai-0.1.5.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
29d6b155da5422bd14651d893b00de8e15ca3b2bfb0cf26df431e1e1bfcbcb64
BLAKE2b-256 checksum
How to use checksums
3e90d192fe69acdf9d89e060edd202867c7dfa346930deb5b5e004550e5cbf01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.15

Release files / ddx_ai-0.1.5-py3-none-any.whl

Download URL ddx_ai-0.1.5-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd1c3482813b1b4dc2f789b4458d6a66380548326a357c561aa4439c9b02b88f
BLAKE2b-256 checksum
How to use checksums
8457a58f9400002802d8d11d1c2aa695ac95f7e49af786cf1c2dd56cbdfe0f1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.15

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page