Hardcode Consulting

Engineering notes on fintech systems, cloud infrastructure, Spring Boot, PostgreSQL, and full-stack platforms.

Search, Don't Browse: Finding the Right Resource

Part of the Determesh series. What A company in Determesh may have hundreds of resources. The orchestrator never reads all their summaries. It searches them, reads the few that match, and searches again if those fall short. Search is keyword plus meaning, run in Postgres, limited to what the user may reach. Why Reading every summary does not scale The obvious first version puts every resource summary in the orchestrator’s prompt. With five resources that works. With two hundred, the prompt is huge, mostly irrelevant, and the model’s choice gets worse as the list grows. ...

November 12, 2026 · 4 min · 823 words · Sagar Nayak

Prompt Caching by Design

Part of the Determesh series. What Model APIs are stateless. Every call sends the whole prompt. Providers soften that with a prefix cache: if a request starts with exactly what an earlier request sent, that part is read from cache at a fraction of the price. Determesh builds every prompt so that as much of it as possible is an exact repeat of the last one. Measured on real traffic, 77 percent of the orchestrator’s prompt tokens are served from cache. ...

November 6, 2026 · 4 min · 766 words · Sagar Nayak

Running the Tool Loop Ourselves

Part of the Determesh series. What Determesh talks to the models through Spring AI, but it does not let Spring AI run the tool loop. The model returns tool calls, Determesh runs them one round at a time through Spring AI’s ToolCallingManager, records each step in the thread, and decides whether there is another round. Why A loop you cannot see into cannot be judged The convenient mode of any agent library is: give it tools, give it a prompt, get the final answer. The tool calls happen inside. For a demo that is ideal. For Determesh it hides exactly the things the system needs. ...

October 31, 2026 · 5 min · 854 words · Sagar Nayak

Threads as Postgres Rows, With No Queue Server

Part of the Determesh series. What Every conversation in Determesh, and every piece of work behind it, is a thread. A thread is a row in Postgres with a status. Workers claim runnable rows with SELECT ... FOR UPDATE SKIP LOCKED, run them, and write the result back. There is no message broker and no workflow engine. Postgres is the queue and the record at once. Why The design was already a queue of records The design said threads are loosely tied. A thread waiting on a manager’s approval holds nothing: no process, no timer, no connection. If the manager replies in five years, the thread picks up. A new message from the user reopens a thread that finished. A parent waits for its children, and children can wait for each other. ...

October 25, 2026 · 5 min · 1008 words · Sagar Nayak

Submit Only: Why Replies Come Back by Webhook

Part of the Determesh series. What The Determesh API does not return answers. A company’s backend submits a user’s message and gets 202 Accepted with a thread ID. The reply arrives later, as a signed webhook to the company’s endpoint. If the webhook cannot be delivered, the reply is still there to pull through the thread API. Why The work does not fit in a request A simple question takes a few seconds: the orchestrator searches, asks a resource, the reply is written and scored. A request like “send this month’s statements to my team” can take minutes, and sends progress along the way: “found 40 people, sending now”, “38 sent, 2 failed”. Some work waits on a person, such as an approval that may come tomorrow. ...

October 19, 2026 · 5 min · 889 words · Sagar Nayak