← All work

Mandate

02Multi-agent prototype · team of threeHackathon prototype

A multi-agent prototype that helps charities assess investments against their ethical policy, the financial evidence and their risk limits. I led the back end.

Role
Backend Lead, in a team of three
Context
Microsoft x LSEG Hackathon 2026
Stack
Python, Flask, Pydantic, asyncio
Source
Public on GitHub
Fig. 02 · Models make claims, code makes decisionsInteractive
Trace an outcome
LLMPolicy compilerPolicy text → rules, each with a verbatim quote
LLMMelchiorEthics: PASS, FAIL or FLAG per rule
LLMBalthasarFinancial health, from fundamentals only
LLMCasperRisk, from stats computed in code
CodeVerifyQuotes, metrics within 2%, source IDs
CodeDecideEthics veto and flags, in plain code
LLMChairFull, reduced or reject. Never sees a number it could allocate
CodeOptimiserMin-volatility, whole shares, simulated $100k
Drawn from the repository's own modules and decision logic. A diagram of the pipeline, not a screenshot of the app.

The problem

Charity trustees are often volunteers. They have a written ethical investment policy and a market full of companies, and checking one against the other takes time and expertise they may not have.

A language model can read both. But trustees shouldn't have to take a model's word for which companies to buy.

The idea

Mandate splits the work so that models make claims and code makes decisions.

  • A compiler turns the policy text into machine-checkable rules, each tied to a word-for-word quote from the policy.
  • Three specialists assess each company: Melchior on ethics, Balthasar on financial health, Casper on risk.
  • A verifier checks every quote, metric and source ID they cite. Metrics must match the data within 2%.
  • Decision logic in plain code applies the result: one verified ethics FAIL is a veto, and anything flagged or unverified goes to the trustees.
  • Only ethically clean companies reach the Chair, which chooses full, reduced or reject. A deterministic minimum-volatility optimiser then allocates a simulated $100,000 in whole shares.
  • A devil's advocate argues against the finished portfolio so trustees see the strongest objections before signing off.

My contribution

I led the back end. On my CV that is asynchronous agent orchestration, structured model outputs and evidence checks. In the commit history it is the pipeline built in five phases:

  • Configuration, Pydantic schemas and the LLM wrapper.
  • The data layer: market data, SEC EDGAR filings, news and the evidence store.
  • The agents, the verification engine and the decision logic.
  • The portfolio optimiser with its relaxation chain, and a backtest.
  • The pipeline orchestrator and CLI, an offline end-to-end test, a first Streamlit interface and a fix for a race between concurrent cache writes.

The React and TypeScript interface and other parts of the repository are team work. The contributor graph shows who did what.

What is verified

The repository's offline integration tests cover ethical vetoes, missing-evidence review and cache reuse, along with policy persistence and idempotent paper transactions. They run without network access or API keys.

This was built for a hackathon as an educational project. Allocations are paper transactions, it is not financial advice, and it is not affiliated with any charity. I'm not claiming a placing or award.

Built with

  • Python
  • Flask
  • Pydantic
  • asyncio
  • PyPortfolioOpt
  • React
  • TypeScript