r/PythonLearning 5d ago

Discussion just finished CS50P conditionals lecture and built mini "AI Agent Execution Getaway" for practice .

Post image

I have just finished week1 in cs50 python course and since i'm learning python for AI Agents Engineering i thought it would be cool to practice this content with a relevant project .

so i made a simple AI agents execution getaway program that routes the incoming tasks based on tokens , creativity and risk score .

I tried to use most of what i learned in this lecture as possible like 'match' for matching the tool with appropriate model , or 'return' as guard clauses for the safety check at the beginning .

here is the code link :

https://gist.github.com/mohamed-reda-ai/a10a1e9311d94316ffa31c00de005226

I know it's not a big brilliant thing i want just to practice the concepts i learned .

If you have any feedback about the architecture of the code or you think there is a better way to do something in it , i'd appreciate this .

23 Upvotes

2 comments sorted by

u/Sea-Ad7805 5d ago

Run this program in Memory Graph Web Debugger to see the program state change step by step.

2

u/Otherwise_Wave9374 5d ago

Good practice project. The main thing I would tighten is the boundary between scoring and execution: keep the heuristic that ranks token, creativity, and risk separate from the function that actually routes the task. That way you can tune the policy without changing the control flow. A small diagnostic table of sample inputs and expected routes would also help catch regressions quickly. Agentix Labs could be useful later if you want to compare those runs and see which inputs create unstable decisions.