Zenmem
Login
๐Ÿงฎ

Tax structuring

TaxHNW tax planningPython ยท Zenmem SDKzenmem-open/tax-structuring-engine

View source

About this agent

A tax planning and advisory engine for CAs, tax advisors and HNWI/family-office teams, built on the Zenmem SDK. It models a closely-held group as a single relational graph โ€” director and partner PANs linked to their private companies, LLPs, HUFs and family trusts โ€” so that decisions made in isolation for one entity (a director's salary, a company's dividend, a trust's distribution) can be evaluated as one group-wide cash and profit-extraction problem instead. Against that graph it runs the Old and New (Section 115BAC) tax regimes in parallel across every entity, tracks multi-year loss set-offs and unabsorbed depreciation, simulates capital gains before a sale is executed and matches Section 54, 54F and 54EC roll-over exemptions, flagging the mandatory Capital Gains Account Scheme deposit deadlines. It also produces a quarterly advance-tax schedule against the statutory June 15 / September 15 / December 15 / March 15 instalment dates. The hard part the spec identifies is that this advisory work normally happens entity by entity, so opportunities for cross-entity balancing and regime optimisation get missed. The design keeps every group's entity graph, loss carryforwards and shareholding pattern isolated in its own project-scoped memory, while the tax slabs, 115BAC thresholds and indexation tables it calculates against are shared, company-scoped reference data common to every group.

RUNTIMEPython ยท Zenmem SDK
MEMORY TYPESession + project + company
SDKzenmem 0.4.4

What changed with Zenmem?

The same agent, built twice against the same contract โ€” once on Zenmem, once on MongoDB + LangChain/LangGraph.

Before โ†’ after

Code for the entity graphโˆ’32%

Code for scenario modellingโˆ’60%

New infrastructure to stand upnone

New dependencies to install0

Schema, collection and index worknone

Multi-entity graph, per groupone scope

Shared slab and section tablesone scope

Before With Zenmem

What the team gained

  • The family group's entity graph โ€” individuals, companies, LLPs, HUFs and trusts โ€” is one scope keyed by group PAN, so no relational schema has to model every entity type up front.
  • Slab tables and section references sit in company scope, defined once rather than copied into every group's file.
  • A what-if runs in session scope and only promotes into the group's history when the advisor keeps it, so modelling never pollutes the record.
  • Multi-year loss carryforwards live beside the graph they belong to, so a structuring call reads one scope rather than joining several.
  • A new entity type is a document, not a table and a set of foreign keys.

How memory is scoped

Session holds one interactive scenario-modelling conversation โ€” an advisor running a what-if on a capital gain or a dividend-versus-remuneration call โ€” and ending it promotes the decision context into the group's project memory. Project, keyed by the family or group's PAN, holds the multi-entity relational graph itself: which individuals, private companies, LLPs, HUFs and trusts are linked, director salaries and shareholding patterns, and multi-year loss carryforwards โ€” all specific to that one group and never shared with another. Company holds the reference data every group draws on equally: tax slab tables, Section 115BAC thresholds and capital-gains indexation multipliers, updated once and read by every engagement.

How it works

The four functional areas.

Build the entity graph

Individual, corporate, LLP, HUF and trust PANs are linked into one group structure, with salaries, profit shares and shareholding recorded against it.

Compare regimes

Old-regime (Chapter VI-A, Section 24, Section 10) and New-regime (Section 115BAC) tax are calculated in parallel across every entity in the group.

Simulate capital gains

LTCG/STCG across equity, real estate and unlisted securities is modelled before a sale, matching Section 54/54F/54EC roll-overs and their CGAS deposit deadlines.

Forecast advance tax

Quarterly instalments are computed against the 15% / 45% / 75% / 100% due dates, factoring in seasonal income and windfall gains.

What it does

The specified capabilities.

Capabilities

  • Links individual director/partner PANs to closely-held private companies, LLPs, HUFs and family trusts into one entity graph.
  • Models dividend distribution vs. director remuneration vs. profit-sharing ratios to find the most tax-efficient cash-extraction path.
  • Runs Old-regime and Section 115BAC New-regime calculations in parallel across all group entities.
  • Tracks multi-year intra-head and inter-head loss set-offs and unabsorbed depreciation carryforwards.
  • Simulates long-term and short-term capital gains across equity, real estate and unlisted securities before a transaction is executed.
  • Matches eligible Section 54 / 54F / 54EC roll-over exemptions and their mandatory Capital Gains Account Scheme deposit deadlines.
  • Computes quarterly advance-tax instalments due June 15, September 15, December 15 and March 15.