This is a submission for the Sanity Challenge, Path One: Ship an Agent That Queries Real Content
What I Built
a chat agent that answers tax questions for indian freelancers - devs, designers, consultants, a lot of us with foreign clients.
the problem: the income-tax act, 2025 replaced the 1961 act from 1 april 2026 and renumbered basically everything. 44ADA is now s.58. 194J is now s.393 table sl. 6. 208 is s.404. almost every blog, youtube video and chatgpt answer still uses the old numbers, and gst rules for exporting services also changed in oct 2023. so you get confident answers that mix two laws.
the agent does three things a keyword search can't:
- works out which tax year you're asking about first, then picks the right act
- maps old section numbers to new ones and shows both
- checks for known conflicts ("freelancers file under 44ADA" for FY 2026-27) and tells you which rule wins, with the source
every claim links to the section and the official source. if the content doesn't cover something, it says so instead of guessing.
Demo
live demo: https://freelance-tax-copilot-india.vercel.app (click an example question; answers cite the statute section and official source)
example questions to try:
- "i earn $40k/yr from a us client as a freelance dev. can i use 44ADA for tax year 2026-27?"
- "do i need gst registration if all my clients are abroad?"
- "is 194J still the tds section for professional fees?"
Code
https://github.com/MaybeSomeone-arc18/freelance-tax-copilot-india
How I Used Sanity
structured content first. the dataset models the law, not articles about it:
-
taxYear- which act applies to which year -
statute- ITA 1961, ITA 2025, CGST, IGST, withreplacedBy/ in-force dates -
provision- a section with a verbatim excerpt, a pinpoint, a plain-english line, andcorrespondsTolinks between old and new sections -
rule- the actual answer ("presumptive tax for professionals: 50% deemed profit, receipts up to ₹50L / ₹75L") pointing to its provisions and sources -
conflict- a common claim, why it's wrong or outdated, and thewinningRule -
deadline- advance tax dates etc. -
sourceDocument- official url, issuer, date
the provisions were checked against the official income tax department PDF of the act (as amended by finance act 2026) and cbic pages.
knowledge base. i pointed sanity context at the dataset plus the official sources (the ITA 2025 PDF from incometaxindia.gov.in, igst s.2 and s.16, cgst rule 96A, the cbic LUT master circular and circular 78/52/2018). it built 13 entries (presumptive taxation, tds, advance tax, gst registration, export of services, LUT...) each linked back to its sources. it also flagged one issue - the LUT entry had too few sources to stand alone.
the agent. next.js + vercel ai sdk, with two sanity context MCP endpoints:
- the dataset endpoint for exact structured lookups (
groq_query,schema_explorer) - e.g.*[_type=="conflict" && ...], followingcorrespondsTofrom 44ADA to s.58 - the knowledge base endpoint (
knowledge_base_read) for longer explanations
initial context from both is injected into the system prompt so the first answer doesn't waste a tool call. the model is gemini.
Sanity Project Details
project id: 7i4i5k0j, dataset: production (public)
How this was built
i built this with an AI agent doing most of the research, schema, seeding and code, and i steered and reviewed it. the facts in the dataset come from official sources linked in each document, not from the model.
not tax advice - check with a CA for your own case.
Top comments (0)