How I combined a verified financial ledger with Hindsight persistent memory to build an AI assistant that understands repayment history without inventing financial facts.

The Problem: Money Is Easy to Transfer, but Promises Are Easy to Forget

Imagine lending ₹10,000 to a friend.

You agree that the money will be returned next month. A few weeks later, your friend repays ₹2,500 and promises to send another ₹3,000 after receiving their salary.

Eventually, both of you may remember the arrangement differently.

Who promised what? How much has actually been repaid? Was a payment confirmed? Did the repayment deadline change?

A spreadsheet can track amounts, but it doesn't naturally capture the context behind financial commitments.

That observation inspired PAKKA — Every Rupee. Every Promise. Remembered.

PAKKA is a prototype for personal debt accountability, combining structured financial records, bilateral confirmations, and persistent AI memory.

The goal isn't to lend money or process payments. It's to help two people maintain a shared, understandable record of their agreements.

What PAKKA Does

PAKKA provides a shared environment for borrowers and lenders to manage personal financial commitments.

Its core features include:

Two-party agreements: Both participants must accept the terms before an agreement becomes active.

Verified repayments: Reported repayments affect the confirmed balance only after counterparty confirmation.

Protected agreement terms: Changes require bilateral approval.

Promise tracker: Borrowers can record repayment intentions that both participants can view.

Smart repayment suggestions: Advisory suggestions use verified financial information and optional affordability input.

AI memory timeline: Displays historical events, intentions, and retrieved memories with distinct labels.

Polite reminders: Generates messages users can copy and send manually.

Memory ON/OFF comparison: Demonstrates what persistent AI memory adds beyond the current ledger.

These features were designed around a simple principle:

An AI assistant should remember financial history, but it should never become the authority over financial truth.

The Technical Architecture

PAKKA is built using a lightweight full-stack architecture.

Component

Technology

Frontend

Next.js, React, TypeScript

Backend

Next.js server routes

Database

SQLite using Node.js native SQLite support

Validation

Zod

Persistent AI memory

Hindsight by Vectorize

Styling

Responsive custom CSS

Testing

Automated application tests and live integration verification

The application uses server-managed sessions and validates agreement membership before allowing participants to access financial records.

Financial values are stored in integer paise rather than floating-point rupees. This helps avoid common rounding errors in money calculations.

For example, a confirmed ₹2,500 repayment against ₹10,000 leaves a verified outstanding balance of ₹7,500.

The calculation comes from the ledger, not from an AI-generated response.

PAKKA's current architecture is intended for a local, single-process demonstration. It is not a production banking platform.

Why Persistent Memory Matters

Traditional AI conversations often rely heavily on the context provided in the current request.

That creates a problem for applications where historical actions matter.

A borrower might ask:

"What have I promised so far, and what should I repay next?"

A system without historical memory may only know the outstanding balance and final due date.

But a useful accountability assistant should also understand previous commitments, confirmed repayments, and relevant agreement changes.

This is where Hindsight, a persistent memory system by Vectorize, becomes valuable.

PAKKA integrates Hindsight through its REST API and uses three important operations:

  1. Retain: Remembering Events

When relevant financial events occur, PAKKA prepares structured records that can be retained in Hindsight.

Examples include agreement acceptance, approved amendments, confirmed repayments, and borrower promises.

These events are labeled carefully.

A borrower's promise to pay ₹3,000 is an intention. It is not evidence that ₹3,000 has already been repaid.

Similarly, a repayment report awaiting confirmation cannot reduce the verified balance.

This distinction helps prevent AI memory from turning unverified claims into financial facts.

  1. Recall: Retrieving Relevant History

When users request memory-powered insights, PAKKA recalls relevant information from the agreement's Hindsight memory bank.

The application uses agreement-specific memory banks and validates the current user's membership before accessing them.

This keeps the memory retrieval process tied to the correct agreement.

For example, the assistant may retrieve historical information about confirmed repayments and earlier commitments.

Instead of depending only on the current conversation, it can reference stored context.

  1. Reflect: Generating Contextual Insights

PAKKA uses Hindsight's reflect capability to generate insights based on relevant remembered information.

The application also supplies current, verified ledger information.

The important design decision is that AI-generated suggestions remain advisory.

They cannot independently confirm repayments, change agreement terms, or modify outstanding balances.

Any contractual amendment still requires approval from both participants.

Memory ON vs. Memory OFF

One of my favorite parts of PAKKA is its memory comparison feature.

I wanted users to see the difference persistent memory actually makes.

Consider a fictional agreement:

Original amount: ₹25,000

Confirmed repayment: ₹5,000

Remaining balance: ₹20,000

Final due date: November 10, 2026

With Memory OFF, the application can explain the current balance, confirmed payment count, and due date using its structured ledger.

With Memory ON, the application can additionally retrieve relevant historical context through Hindsight and show evidence references.

The interface separates the concise summary from expandable supporting evidence.

This creates a more understandable experience while keeping the ledger authoritative.

It also makes the role of persistent memory visible instead of treating AI as an unexplained black box.

Building a Promise Tracker

Another important feature is the promise tracker.

Suppose a borrower records:

"I'll repay ₹2,000 by Friday."

PAKKA stores the promised amount, date, and optional note.

Both participants can see the promise.

However, recording a promise doesn't reduce the debt.

The application determines fulfillment using qualifying, counterparty-confirmed repayments reported after the promise was created.

Pending or disputed payments cannot fulfill it.

The tracker can distinguish pending, fulfilled, and overdue promises, including partial repayments.

This makes promises useful accountability records without confusing intentions with completed financial actions.

Smart Repayment Suggestions

PAKKA also provides affordability-based repayment suggestions.

The borrower can optionally specify an amount they can afford and a date when that money will be available.

The application considers the verified outstanding balance and pending payment reservations.

With Memory ON, relevant Hindsight repayment context can enrich the recommendation.

For example, the assistant might suggest a smaller repayment rather than recommending an amount the borrower has not said they can afford.

But it never assumes a user's salary, income, or financial capacity.

The suggestions do not automatically create promises or execute repayments.

If a proposed date goes beyond the agreed deadline, PAKKA identifies that an amendment would require both parties' approval.

Making AI Outputs Explainable

Persistent memory is useful only when users can understand what the system remembers.

PAKKA's timeline distinguishes between:

Verified events: Accepted agreements, approved changes, and confirmed repayments.

Intentions: Promises recorded by borrowers.

Unconfirmed activity: Claims that have not become verified repayments.

AI memories: Historical information retrieved from Hindsight, including supporting evidence references where available.

The application also avoids presenting retrieved memories as additional ledger transactions.

This prevents the same repayment from appearing as multiple financial events simply because it exists in both the database and memory system.

When Hindsight is unavailable, PAKKA provides a truthful offline fallback using local financial records rather than inventing remembered history.

Testing and Verification

The implementation underwent several rounds of testing.

The final development verification reported:

36 passing automated tests.

Successful linting and TypeScript type checking.

Successful production build.

Live Hindsight retain, recall, and reflect operations.

Browser verification of core user workflows.

Confirmation that the original demo agreements remained unchanged.

The tests cover financial state transitions, participant access, promise fulfillment, reminders, and memory-related behavior.

One important distinction is that automated tests use mocked provider transport, while separate live verification exercises the real Hindsight service.

The public repository includes the implementation, setup instructions, and verification documentation.

Challenges and Lessons Learned

Building PAKKA highlighted several important lessons.

Financial correctness comes first

AI should not calculate or overwrite authoritative balances when deterministic ledger calculations are available.

Memory needs provenance

Remembering a promise is different from remembering a confirmed payment. Both can be useful, but they must remain distinguishable.

AI features should fail safely

A memory provider outage should not prevent users from viewing their verified financial information.

Simplicity improves trust

Concise insights, visible evidence, and clear status labels can be more useful than long AI-generated explanations.

Human approval still matters

For sensitive actions such as changing financial agreements, AI can provide context, but the participants must remain in control.

Current Limitations and Future Possibilities

PAKKA is currently a working local prototype using fictional demo accounts and records.

It does not transfer money, verify real-world identities, send automatic external notifications, or guarantee repayment.

A production-ready version would require stronger identity verification, secure hosting, rate limiting, backups, more robust transaction handling, and additional privacy safeguards.

Future possibilities include better repayment visualizations, richer user-controlled memory management, and improved accessibility.

However, the central principle would remain unchanged:

Persistent AI memory should strengthen accountability without replacing verified records or human consent.

Final Thoughts

PAKKA started with a simple question:

What if a financial tracking app could remember not only how much money was owed, but also the commitments people made along the way?

By combining a structured ledger with Hindsight's retain, recall, and reflect capabilities, I explored how persistent memory can make AI-powered applications more contextual, explainable, and useful.

The most important takeaway from building PAKKA is that a trustworthy AI agent needs more than memory.

It needs boundaries around what it remembers, what it can infer, and what it is allowed to change.

Every Rupee. Every Promise. Remembered.