-
-
Every client-facing action is approved, enforced in the backend and logged.
-
Autopilot finds due and overdue invoices and drafts reminders. Each one waits for your approval.
-
Tax worked out by a tested calculator under India’s Income-tax Act 2025, with TDS taken off.
-
Munshi as an MCP server: Claude Desktop reads your books and tax position, but can’t send money.
-
Sign-in protects private income data: hashed passwords, signed sessions, lockout after 5 failed tries.
-
Live PayPal invoices, created from plain-English requests, with one-click pay links and reminders.
-
The Tax advisor answers from a rules knowledge base, with citations, and explains the calculator’s steps.
-
One ledger from PayPal, Upwork and bank statements. Payouts already counted are caught, TDS is tracked, and uncertain credits wait for you.
-
The full working on request: projection, slabs, marginal relief and cess, all from the calculator, not the AI.
Inspiration
India has one of the world's largest freelance workforces, and a huge share is paid by foreign clients through PayPal. Every freelancer I know has the same mess:
- Money sits in PayPal, Upwork and the bank, and the same payment gets counted two or three times (an Upwork payment, then its withdrawal to the bank).
- On 1 April 2026 India's Income-tax Act 2025 replaced the 1961 Act. 44ADA became Section 58, 194J became Section 393, and most freelancers no longer know what they owe.
- Many over-pay, because they don't know that under the presumptive scheme someone earning ₹20 lakh can owe ₹0.
Traditionally, Indian businesses had a munshi, a bookkeeper who kept the bahi-khata (ledger). I wanted to give every freelancer an AI one.
What it does
- Bill clients in plain English. "Bill Kestrel Health $1,500 for app maintenance" becomes a real PayPal invoice with the RBI purpose code and the GST "export under LUT" line, shown as an editable approval card before anything is sent.
- Autopilot collections. An agent checks PayPal for new payments, finds late invoices and drafts reminders in the right tone. You approve every email.
- One unified ledger. PayPal, Upwork and bank statements (CSV or PDF), with foreign and Indian UPI clients and TDS tracked, and payouts already counted caught as duplicates. Uncertain credits wait for your decision.
- Tax under the 2025 Act. A tested calculator gives tax left to pay, how much to keep aside and the due date, with the full working shown step by step.
- Cited tax rules (RAG).It answers questions like "Do I need GST registration?" with citations, and says "ask a CA" when it doesn't know.
- MCP server. Claude Desktop or Cursor can read your books. Sending money is deliberately not exposed.
How we built it
Stack: Python, FastAPI, vanilla JS, SQLite, LangGraph, Groq (openai/gpt-oss-120b), PayPal REST APIs (OAuth, Invoicing v2, Webhooks), MCP Python SDK, deployed on Render.
Agents. A LangGraph supervisor routes each request to one of four specialists: Billing, Collections, Tax advisor and Statements. Each has its own small toolset, so the Tax advisor can't send invoices.
Human-in-the-loop, enforced in code. Every write follows the same path:
agent → validation guardrails → LangGraph interrupt (approve / edit / reject) → PayPal
The tool layer only runs a write when it has a one-time approval token whose hash matches the exact arguments. A tampered amount, a replayed approval or a rejection reused as an approval are all blocked.
The AI never does the maths. Tax comes from a deterministic engine. Projected receipts $R$ scale what you've earned so far, $E$, over $m$ months:
$$R = E \times \frac{12}{m}$$
Under the presumptive scheme (Section 58), taxable income is $T = 0.5R$ for professionals. Tax is then the slab tax $S(T)$ with the ₹12 lakh rebate and marginal relief, plus 4% cess, minus TDS already deducted:
$$\text{Tax} = \max\Big(0,\ 1.04 \times \min\big(S(T),\ T - 12\text{L}\big) - \text{TDS}\Big) \quad \text{for } T > 12\text{L}$$
The LLM only explains the result, walking through the calculator's own steps.
RAG. BM25 retrieval over our own summaries of Indian freelancer tax law (7 documents, 34 sections, each with sources), with citations, multi-hop search (search again before mentioning anything not yet retrieved) and abstention when a topic isn't covered.
Evals. 115 checks in 6 suites: tax maths, guardrails and approval enforcement, retrieval, routing, agent behaviour with human approval (PayPal mocked), and RAG faithfulness judged by an LLM.
Challenges we ran into
- Keeping AI away from the money. Early on, the agent tried to calculate tax itself, once with the old regime's slabs. We moved every number into a tested calculator and made the AI read its working.
- Making approval impossible to bypass. A prompt saying "ask first" isn't a control, so approval now lives in the backend with single-use, argument-bound tokens.
- The same money counted twice. Matching bank credits to PayPal and Upwork payments (within 12% for fees, and dated after the payment) worked, until it mistook an Indian client's UPI payment for a PayPal payout. Domestic payments are now excluded from that matching.
- A brand-new tax law. Section numbers and terms changed in April 2026, so every rule in the knowledge base was checked against current sources.
- Real-world flakiness. The PayPal sandbox returned
503s and Groq rate-limited us, so we added retries with backoff and stale-data fallback, and we never retry a write, so an invoice can't be sent twice.
Accomplishments that we're proud of
- 115/115 on our own eval suite, with every fix driven by a failing test
- Human approval that is enforced in code, not just in prompts
- Tax answers you can check: real numbers from a calculator, and rules with citations
- Built solo in four days
What we learned
- Evals are the most valuable part of an agent project. Our first run scored 92/93. The LLM judge caught a correct rule that wasn't written in our sources, so we fixed the knowledge base, not the test. A later failure taught us multi-hop retrieval.
- Human-in-the-loop only counts if the backend enforces it.
- Plain language matters. Freelancers want how much, when, and how much to keep aside. The slabs and cess belong behind a "show the working" button.
What's next for Munshi
- Multi-user: each freelancer connects their own PayPal account (Log in with PayPal), with a consent-based profile
- PayPal Payouts for paying collaborators, and the PayPal Agent Toolkit as a connector
- AIS / Form 26AS import to reconcile TDS automatically, a GST return helper, and per-receipt exchange rates