This project is a general-purpose AI agent built for AMD Hackathon Track 1, designed to answer a mixed batch of tasks spanning eight categories: factual knowledge, math reasoning, sentiment classification, summarization, named entity recognition, code debugging, logical deduction, and code generation. Rather than treating every task identically, the agent first classifies each prompt by category using lightweight regex-based rules, then routes it to an appropriately sized Fireworks AI model — reserving stronger models for math, logic, and code tasks, and cheaper models for simpler categories — since accuracy and token efficiency are both scored. The core optimization is a batching strategy discovered through empirical testing: independent tasks in the same category are grouped and answered in a single API call using a structured JSON request/response format, which measurably cuts token usage by roughly 50% on reasoning-heavy categories like code debugging and generation, without any loss of correctness. Every design choice — from model routing to batching thresholds — was validated against real API calls rather than assumed, with automatic fallback to individual calls if a batch response can't be parsed, ensuring no task is ever lost to a formatting hiccup.
Category tags: