Inspiration

As a first-year student from a STEM background and a young investor, getting started with the Pakistan Stock Exchange was not easy. Most tools either assume you already know what you're doing, or they confidently tell you what to buy — which is exactly the thing a beginner shouldn't be trusting an algorithm for.

PSX War Room came out of that gap. It isn't only a hackathon project; it's an idea we think can genuinely help students and first-time investors in Pakistan reason about the market instead of being handed answers.

What it does

PSX War Room runs four specialist AI agents in parallel on a single PSX ticker, each analysing it from a different angle:

  • Quant — price and volume technicals
  • Macro — SBP policy rate, inflation, PKR movement, IMF program status
  • Geo-Sentiment — political and regional risk
  • Fundamentals — valuation ratios, debt, revenue and earnings trends

A fifth agent, the Moderator, calls all four as tools and synthesises their conflicting views into one verdict.

The core design rule: the system never makes buy or sell calls and never predicts a price. Every agent outputs only a direction, a confidence score, and a one-sentence basis:

SIGNAL: BULLISH | CONFIDENCE: 0.4 | BASIS: ...

That constraint is enforced in three places — the system prompts, a banned-language validator, and a format parser. An LLM asserting a price target is the failure mode we specifically designed against.

How we built it

Python, built end-to-end with Codex. The agent layer uses the OpenAI Agents SDK with an agents-as-tools architecture, and the demo runs on Streamlit.

The piece we're most pleased with is how the system handles its own uncertainty. It currently runs on dated mock fixtures, so every agent detects this and caps its confidence accordingly, stating the reason in its output. If a specialist fails or returns a malformed signal, it's excluded with a stated reason and shown in the UI rather than silently dropped. The Moderator's confidence can never exceed its least confident specialist — uncertainty propagates upward instead of getting averaged away.

What we learned

A lot of it was practical: virtual environments, dependency management, and one memorable hour lost to a local package named agents shadowing the SDK's own agents module.

The bigger lesson was architectural. Our first instinct was to let the agents output whatever they wanted and clean it up afterwards. That doesn't work — an LLM will happily produce a confident price target if nothing stops it. Constraining the output format in code, and validating it, turned out to matter more than prompt engineering.

We also learned that graceful degradation is worth building early. A system that loses one agent and still returns a useful, honest answer is far more valuable than one that crashes.

Challenges we ran into

The hardest call was one we couldn't engineer around: we had no OpenAI API key during the build window. Rather than hardcode a workaround, we refactored model selection into a provider-agnostic factory, so the entire system switches between providers with a single line in .env. The code path for GPT-5.6 is in place and the project currently runs on Gemini. This is disclosed openly in our README.

Beyond that: getting agents to reliably emit a strict single-line format took a validator plus a retry rather than prompting alone, and building the whole thing to a hard deadline as first-year students meant constantly deciding what to cut.

Accomplishments that we're proud of

As first-year college students, none of this was easy, and it was a genuine learning experience. We're proud that the system is honest about what it doesn't know — that it caps its own confidence on weak data and shows its failures instead of hiding them.

What's next for PSX War Room

Right now it covers three tickers as a prototype. Next is a live PSX data feed to replace the mock fixtures, expanding coverage to the full KSE-100 index, and then opening it up for public use.

Built With

Share this project:

Updates