<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://girisandeep.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://girisandeep.com/" rel="alternate" type="text/html" /><updated>2026-05-31T02:11:39+00:00</updated><id>https://girisandeep.com/feed.xml</id><title type="html">Sandeep Giri</title><subtitle>I am the founder of CloudxLab and Terno AI. I write about artificial intelligence, learning by inventing, secure enterprise analytics, entrepreneurship and ideas that challenge conventional thinking.</subtitle><author><name>Sandeep Giri</name></author><entry><title type="html">Domain-Focused PCA on Text Embeddings Improves Semantic Retrieval</title><link href="https://girisandeep.com/2026/05/28/domain-focused-pca-embeddings-semantic-retrieval/" rel="alternate" type="text/html" title="Domain-Focused PCA on Text Embeddings Improves Semantic Retrieval" /><published>2026-05-28T00:00:00+00:00</published><updated>2026-05-28T00:00:00+00:00</updated><id>https://girisandeep.com/2026/05/28/domain-focused-pca-embeddings-semantic-retrieval</id><content type="html" xml:base="https://girisandeep.com/2026/05/28/domain-focused-pca-embeddings-semantic-retrieval/"><![CDATA[<p>One of the core problems in building a reliable AI system for enterprise data is
retrieval: given a user’s question, can you find the right context quickly and
accurately?</p>

<p>Modern retrieval systems depend heavily on text embeddings — dense vector
representations produced by models like OpenAI’s <code class="language-plaintext highlighter-rouge">text-embedding-3-small</code>. These
embeddings are trained on enormous general-purpose corpora. They work remarkably
well as a starting point. But “general purpose” is not the same as “domain optimal.”
A model trained on the entire internet does not distribute its representational
capacity the way a medical, legal or financial corpus would want it to.</p>

<p>The question I wanted to answer: can we improve retrieval accuracy in a specific
domain without fine-tuning the embedding model — which is expensive, slow, and
requires labelled data?</p>

<p>The answer turned out to be yes, with a surprisingly simple technique.</p>

<h2 id="the-idea">The Idea</h2>

<p><a href="https://en.wikipedia.org/wiki/Principal_component_analysis">Principal Component Analysis</a>
(PCA) is one of the oldest ideas in machine learning. It finds the directions of
maximum variance in a set of vectors and projects everything onto those directions.
Applied to text embeddings from a domain-specific corpus, it does something useful:
it rotates the embedding space so that the axes align with the directions that
actually matter for <em>this</em> domain, rather than the directions that mattered across
the general training data.</p>

<p>The intuition is straightforward. A general embedding model uses many dimensions
to represent distinctions that are important across all domains. In a medical corpus,
most of those dimensions are irrelevant noise. PCA finds the dimensions that carry
real signal for the documents you actually have, and discards the rest.</p>

<p>Crucially: we fit the PCA transform <em>only on the document corpus</em>, not on queries.
This turns out to matter.</p>

<h2 id="what-we-tested">What We Tested</h2>

<p>We ran experiments on a medical domain corpus covering 20 clinical topics, using
OpenAI’s <code class="language-plaintext highlighter-rouge">text-embedding-3-small</code> as the base embedding model. We tested five
hypotheses about when and why domain-focused PCA helps:</p>

<ol>
  <li>Does PCA on a domain corpus improve MAP over the raw baseline?</li>
  <li>Is 32 dimensions the sweet spot, or does more always help?</li>
  <li>Does fitting PCA on corpus-only data outperform fitting on corpus + queries?</li>
  <li>Do random projections produce the same gains? (Spoiler: they do not.)</li>
  <li>Does the improvement hold as corpus diversity increases?</li>
</ol>

<h2 id="the-results">The Results</h2>

<p>The best configuration — <strong>PCA-32, fitted on the document corpus only</strong> —
achieved a Mean Average Precision (MAP) of <strong>0.9203</strong> against a baseline of
<strong>0.8750</strong>. That is a <strong>+5.2% improvement</strong> in retrieval accuracy.</p>

<p>Two other numbers from the results matter practically:</p>

<ul>
  <li>
    <p><strong>2.5× increase in similarity gap</strong> — the distance between a correct match and
the nearest incorrect one grows substantially. This makes retrieval more robust
in real systems where you are using a threshold to decide what to include.</p>
  </li>
  <li>
    <p><strong>48× reduction in storage</strong> — going from 1536-dimensional to 32-dimensional
vectors. For large enterprise corpora, this is not a minor convenience.
It is the difference between retrieval that fits in memory and retrieval that
requires expensive infrastructure.</p>
  </li>
</ul>

<p>The random projection control was important. When we projected embeddings onto
32 random directions instead of 32 PCA-derived directions, accuracy did not
improve. The gain comes specifically from aligning dimensions with the domain —
not just from reducing dimensionality. That rules out the possibility that we
were simply compressing away noise randomly.</p>

<p>The corpus-only fitting result was also notable. Adding query vectors to the
PCA fitting data slightly reduced performance compared to fitting on documents
alone. The retrieval task is fundamentally about the document space; letting
query variation influence the principal components adds irrelevant structure.</p>

<p>Finally, as corpus diversity increased across our 20-topic dataset, performance
<em>improved</em> rather than degrading. This is encouraging for practical deployment:
the technique scales with the breadth of the domain corpus rather than
becoming less useful.</p>

<h2 id="why-this-matters-for-enterprise-ai">Why This Matters for Enterprise AI</h2>

<p>At Terno AI, we think a lot about how to make retrieval accurate and efficient
for enterprise data. The problem is not just finding relevant content — it is
finding it reliably enough to trust the downstream reasoning.</p>

<p>Enterprise corpora are not the internet. They are specific: a legal firm’s
contracts, a hospital’s clinical notes, a manufacturer’s technical documentation.
The variance structure in these corpora is nothing like the variance structure
of a general embedding model’s training data.</p>

<p>Domain-focused PCA offers a lightweight path to alignment without fine-tuning:</p>
<ul>
  <li>No labelled data required</li>
  <li>No model training</li>
  <li>Runs in seconds on a modern laptop</li>
  <li>Composable with any embedding model</li>
  <li>Interpretable — you can inspect the principal components</li>
</ul>

<p>It fits naturally into a semantic layer architecture where you want retrieval to
be accurate <em>and</em> fast <em>and</em> auditable.</p>

<h2 id="the-paper-and-code">The Paper and Code</h2>

<p>The full paper is published on Zenodo:</p>

<p><strong><a href="https://zenodo.org/records/20320367">Domain-Focused PCA on Text Embeddings Improves Semantic Retrieval: A Medical Domain Study</a></strong>
DOI: 10.5281/zenodo.20320367</p>

<p>The code — including the full experiment, figure generation, and a cached
embedding pipeline that avoids repeated API calls — is on GitHub:</p>

<p><strong><a href="https://github.com/cloudxlab/pca_embeddings">github.com/cloudxlab/pca_embeddings</a></strong></p>

<p>To run it yourself:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/cloudxlab/pca_embeddings
pip <span class="nb">install </span>openai scikit-learn numpy pandas matplotlib seaborn
<span class="nb">export </span><span class="nv">OPENAI_API_KEY</span><span class="o">=</span>your-key
python3 pca_experiment_v2.py
</code></pre></div></div>

<p>Embeddings are cached locally after the first run, so subsequent experiments
cost nothing in API calls.</p>

<h2 id="what-is-next">What Is Next</h2>

<p>This study used a medical corpus as a controlled testbed. The obvious questions
for follow-up are: does the gain hold in legal, financial, and technical domains?
What is the relationship between corpus size and optimal PCA dimensionality?
Can the principal components themselves be used to understand what a corpus is
“about” — as a form of automatic semantic layer construction?</p>

<p>These are the questions we are working on. If you are building retrieval systems
for enterprise domains, I would be interested to hear what you find.</p>

<hr />

<p><em>The paper is open access under Creative Commons Attribution 4.0. The code is
MIT licensed. Both are free to use and build on.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Building Terno AI" /><category term="research" /><category term="embeddings" /><category term="pca" /><category term="semantic-retrieval" /><category term="nlp" /><category term="enterprise-ai" /><summary type="html"><![CDATA[We published a paper showing that applying PCA to domain-specific text embeddings — fitted only on the target corpus — improves retrieval accuracy by 5.2%, increases the similarity gap 2.5×, and compresses storage 48× with no fine-tuning required.]]></summary></entry><entry><title type="html">The Clubs That Said No</title><link href="https://girisandeep.com/2026/05/28/the-clubs-that-said-no/" rel="alternate" type="text/html" title="The Clubs That Said No" /><published>2026-05-28T00:00:00+00:00</published><updated>2026-05-28T00:00:00+00:00</updated><id>https://girisandeep.com/2026/05/28/the-clubs-that-said-no</id><content type="html" xml:base="https://girisandeep.com/2026/05/28/the-clubs-that-said-no/"><![CDATA[<p>In my first year at IIT Roorkee, I wanted to belong somewhere.</p>

<p>Every new student feels this. You arrive at college and the world suddenly seems full
of interesting people doing interesting things. There are clubs for music, drama,
literature, debate, photography. You go to the trials, you put your name forward,
and you wait to find out which version of yourself college is going to let you become.</p>

<p>I tried several. The Music club. Dramatics. The campus magazine, <em>Watch Out</em>. One by
one, they said no.</p>

<p>I did get selected in the Light section — the group that managed stage lighting for
events. I joined, attended a few sessions, and decided it was not what I was looking
for. So I left that too.</p>

<p>By the end of my first year, I had been rejected by or had walked away from every
student group I had tried. It was a quiet kind of failure — not dramatic, not
catastrophic, just a series of doors that did not open.</p>

<h2 id="the-redirect">The Redirect</h2>

<p>I made a decision that I did not think much of at the time. I would stop trying to
find a group to join and start learning computing as seriously as I could.</p>

<p>I had always been drawn to it. I spent long evenings in the computer lab. I read
whatever I could find. I wrote programs, broke them, fixed them, wrote more. I had
no particular goal other than getting better — not better than someone else, just
better than I had been the week before.</p>

<p>By the time third year arrived, something had happened that I had not planned for.
I had become genuinely capable.</p>

<h2 id="building-img">Building IMG</h2>

<p>A couple of seniors and classmates were thinking about the same problem I was
thinking about: the institute’s website and online systems were in poor shape.
The information students needed was scattered or absent. There was no good way
to search for people, manage library resources, or handle placements online.</p>

<p>We started building.</p>

<p>The Notice Board. A People Search. A library management system. Recruitment
management for placements. Each one was a real piece of software solving a
real problem for real people on campus.</p>

<p>We formed a group to do this properly. We called it IMG — Information Management
Group.</p>

<p>It was not glamorous. We were not doing anything that would have impressed the
students who ran the music club or the drama society. We were fixing unglamorous
things: how do you find a professor’s contact details, how do you know when a
book is available, how does a company post a recruitment notice.</p>

<p>But the work was ours. And it was needed.</p>

<h2 id="what-happened-next">What Happened Next</h2>

<p>IMG became the most sought-after group on campus.</p>

<p>I find this genuinely funny to think about now. The clubs that had no room for me
in my first year remained what they always were — good clubs, doing good work,
meaningful to the people in them. But the group we built from scratch, out of
necessity and stubbornness, grew into something that outlasted all of us.</p>

<p>IMG is still running today, more than twenty years later. It is still considered
the most competitive and prestigious student group at IIT Roorkee. The alumni who
came through it have gone on to build companies, lead engineering teams, and do
work that has reached millions of people.</p>

<p>None of that was planned. We were just trying to make the campus work better.</p>

<h2 id="the-thing-about-rejection">The Thing About Rejection</h2>

<p>I want to be careful here, because I am not going to tell you that rejection is
always a gift or that every closed door leads to a better one. That is not
always true and it would be dishonest to pretend otherwise.</p>

<p>But I do think there is something specific that happened to me that is worth
naming.</p>

<p>When every existing group said no, I had no ready-made identity to slot into.
I could not become “the magazine person” or “the theatre person.” I had to
figure out what I actually wanted to spend my time on — not what label I wanted,
but what <em>work</em> I wanted to do.</p>

<p>And the work I chose was building things.</p>

<p>That choice, made mostly by default in the quiet aftermath of a series of
rejections, turned out to be the most important choice of my college years.
Everything that came after — the companies, the products, the teams —
grew from the habit of mind I developed during those hours in the computer
lab when no club wanted me.</p>

<p>The doors that stayed closed pushed me toward the one I did not know I was
looking for.</p>

<hr />

<p><em>If you are a student reading this and you have just been rejected from something
you wanted: I am not going to promise it works out. But I will say — the question
worth asking is not “why didn’t they want me?” It is “what do I actually want to
spend the next three years getting good at?”</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Founder Journey" /><category term="iit-roorkee" /><category term="img" /><category term="rejection" /><category term="college" /><category term="building" /><summary type="html"><![CDATA[In my first year at IIT Roorkee, almost every student club rejected me — Music, Dramatics, the magazine. I redirected everything into computing instead. By third year, we had built something that is still running twenty years later.]]></summary></entry><entry><title type="html">The Stars Are Closer Than You Think</title><link href="https://girisandeep.com/2026/05/28/the-stars-are-closer-than-you-think/" rel="alternate" type="text/html" title="The Stars Are Closer Than You Think" /><published>2026-05-28T00:00:00+00:00</published><updated>2026-05-28T00:00:00+00:00</updated><id>https://girisandeep.com/2026/05/28/the-stars-are-closer-than-you-think</id><content type="html" xml:base="https://girisandeep.com/2026/05/28/the-stars-are-closer-than-you-think/"><![CDATA[<p>When I was in class 11th, I fell in love with a book.</p>

<p>It was <em>Concepts of Physics</em> by H. C. Verma. If you grew up in India and studied science,
you probably know it. For many of us, it was not just a textbook — it was the first book
that made physics feel like something alive, something that could be understood rather
than merely memorised.</p>

<p>I was living in a tiny village in Uttar Pradesh at the time. I had no tutor, no
coaching centre, no older student I could call on. What I had was curiosity, a stack
of books, and a habit of reading the same passage ten times until something clicked.</p>

<p>While reading H. C. Verma, I hit a wall. There were concepts I could not resolve no
matter how many times I went back to the page. I looked through other books —
I used to hoard books by multiple authors on every subject, hoping that one
author’s explanation would unlock what another’s had obscured. Sometimes it worked.
This time, it did not.</p>

<h2 id="the-letter">The Letter</h2>

<p>I am not sure exactly when the idea came to me. But at some point I thought: why not
write to H. C. Verma directly?</p>

<p>He was a professor at IIT Kanpur. I was a schoolboy in a village. I had no connection
to him, no introduction, no reason to expect anything. But I had his doubts in my head
and his address — printed right there in the book.</p>

<p>So I wrote a letter. I described my questions as clearly as I could. I folded the
pages, addressed the envelope, and posted it.</p>

<p>I had no real expectation of a reply. I told myself I probably would not hear back.
But I had asked the question, and there was something satisfying in that alone.</p>

<p>Then his reply arrived.</p>

<p><img src="/assets/images/letter_hc_verma.jpg" alt="H. C. Verma's letter — page 1" /></p>

<p><img src="/assets/images/letter_hc_verma_2.jpg" alt="H. C. Verma's letter — page 2" /></p>

<p>He had written back — in Hindi, in a warm and careful hand. He addressed my questions
one by one. He did not write like a busy professor brushing off a student. He wrote
like someone who genuinely cared that the ideas landed. The letter was patient and
kind and precise.</p>

<p>I have thought about that moment many times since. A professor at one of India’s
most demanding institutions, receiving a letter from an unknown schoolboy in a village
he had never heard of, and choosing to sit down and write back. In Hindi. With care.</p>

<p>Something shifted in me that day. Not just because my doubts were cleared — though
they were — but because of what the gesture meant. The world was not as closed as it
had seemed from where I was standing. The distance between a student and a teacher
was not fixed. It was crossable. By a letter.</p>

<h2 id="bjarne-stroustrup">Bjarne Stroustrup</h2>

<p>A few years later, when I reached college, the same instinct resurfaced.</p>

<p>I had become absorbed in C++. I was reading everything I could find, writing
programs, trying to understand the language at a deeper level. And I found myself
with questions that books did not answer — questions about design decisions,
about why the language worked the way it did.</p>

<p>Bjarne Stroustrup had invented C++. He was at Bell Labs and later at Texas A&amp;M,
one of the most influential computer scientists alive. I wrote to him.</p>

<p>He wrote back. Not once — several times. In detail. He engaged with the questions
as if they were worth engaging with, because to him, perhaps, any sincere question
about the language he had spent his life building <em>was</em> worth engaging with.</p>

<p>I want to be careful not to overstate this. These were not long friendships or
mentorships in any formal sense. They were exchanges — brief, specific, generous.
But they were enough to teach me something I have carried ever since.</p>

<h2 id="what-i-learned">What I Learned</h2>

<p>The lesson is not about networking. It is not a productivity tip or a career hack.</p>

<p>It is something more fundamental: <strong>most people who have built something meaningful
care deeply about the ideas behind it.</strong> Ask them a sincere question about those
ideas, and there is a real chance they will answer.</p>

<p>The famous scientist, the author whose book you loved, the founder whose work
changed how you think — they are not behind a wall. They are human beings with
email addresses and, sometimes, a genuine pleasure in being asked something
real by someone who clearly cares.</p>

<p>The worst that can happen when you reach out is silence. You were already in
silence before you asked. The asking costs almost nothing. The answer, when it comes,
can change everything.</p>

<p>I have been on the other side of this now. As someone who has taught many thousands
of people, I receive messages from students and learners asking questions — sometimes
deeply technical, sometimes personal, sometimes just a thought they wanted to share.
I try to reply to as many as I can.</p>

<p>Because I remember what it felt like to post that letter from a village in UP, with
no confidence it would reach anyone, and then to find that it had.</p>

<h2 id="the-stars">The Stars</h2>

<p>There is a line I keep coming back to, one I used when I shared this story on LinkedIn:</p>

<p><em>The stars are closer than you think.</em></p>

<p>The people whose work has shaped you — the authors, the teachers, the builders — often
feel remote. Their names are on book covers and conference programmes. They exist at
a distance that seems unbridgeable from wherever you are standing.</p>

<p>But the distance is mostly in our heads. It is made of the assumption that we are
not important enough to ask, that our questions are not interesting enough to warrant
a reply, that the gap between where we are and where they are is too large to cross
with something as simple as a letter.</p>

<p>It is usually not.</p>

<p>Ask the question. Write the letter. Send the email.</p>

<p>The answer might be silence. But it might be a reply in Hindi, written by hand,
from a professor at IIT Kanpur, that changes the way you see the world.</p>

<hr />

<p><em>If you have a similar story — of reaching out to someone whose work mattered to you,
and being surprised by what happened — I would genuinely love to hear it.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Education and Careers" /><category term="mentorship" /><category term="learning" /><category term="courage" /><category term="letters" /><category term="personal" /><summary type="html"><![CDATA[When I was in class 11th in a tiny village in UP, I wrote a letter to H. C. Verma at IIT Kanpur with no hope of a reply. He wrote back. That moment changed me forever.]]></summary></entry><entry><title type="html">Building an Open-Source Autonomous Agent SDK</title><link href="https://girisandeep.com/2025/11/15/building-open-source-autonomous-agent-sdk/" rel="alternate" type="text/html" title="Building an Open-Source Autonomous Agent SDK" /><published>2025-11-15T00:00:00+00:00</published><updated>2025-11-15T00:00:00+00:00</updated><id>https://girisandeep.com/2025/11/15/building-open-source-autonomous-agent-sdk</id><content type="html" xml:base="https://girisandeep.com/2025/11/15/building-open-source-autonomous-agent-sdk/"><![CDATA[<p>We are at an interesting moment in the development of AI.</p>

<p>The underlying models — the large language models that reason, write code, and
follow complex instructions — have reached a capability level where they can be
genuinely useful for tasks that require multiple steps, tool use, and judgment.</p>

<p>But the infrastructure for building agentic systems — systems that can plan, take
actions, use tools, remember context, and operate autonomously toward a goal —
remains surprisingly immature.</p>

<p>Existing frameworks make certain things easy. But they often sacrifice transparency
for convenience, or make it hard to audit what the agent actually did and why.</p>

<p>I have been thinking about what a well-designed open-source agent SDK would look like.
Here are my current thoughts.</p>

<h2 id="what-makes-a-good-agent">What Makes a Good Agent</h2>

<p>Before thinking about the SDK, it helps to be clear about what a good agent actually is.</p>

<p>An agent is a system that can:</p>
<ol>
  <li>Receive a goal or task in natural language</li>
  <li>Decompose that task into steps</li>
  <li>Execute those steps using available tools</li>
  <li>Observe the results of each step</li>
  <li>Adjust its plan based on what it observes</li>
  <li>Complete the task or report why it cannot</li>
</ol>

<p>This sounds simple. But building a system that does this reliably — that does not
hallucinate tool calls, that handles errors gracefully, that does not lose track of
the original goal, that can be safely stopped or interrupted — is genuinely hard.</p>

<p>The hardest parts are:</p>

<p><strong>Planning under uncertainty.</strong> The agent must decide what to do next without full
information about whether its previous steps worked as intended, and without certainty
about what future steps will be needed.</p>

<p><strong>Tool reliability.</strong> Tools fail, return unexpected outputs, or produce results that
require interpretation. The agent must handle this gracefully.</p>

<p><strong>Context management.</strong> Long tasks require the agent to maintain coherent state over
many steps. Current language models have context windows that become a bottleneck in
long tasks.</p>

<p><strong>Safety and auditability.</strong> For any serious use case, you need to be able to inspect
what the agent did, why it made the decisions it made, and where things went wrong.</p>

<h2 id="what-current-frameworks-get-wrong">What Current Frameworks Get Wrong</h2>

<p>Most current agent frameworks optimise for getting demos working quickly. This is
understandable — demos attract attention and demonstrate capability. But it creates
problems when you try to use these frameworks for production work.</p>

<p><strong>Opacity.</strong> Many frameworks make it easy to run an agent but hard to understand what
it is doing internally. You get an output, but you cannot easily reconstruct the
reasoning chain that produced it.</p>

<p><strong>Tight coupling.</strong> Frameworks often tightly couple the agent logic to a specific
model provider or a specific tool interface. This makes it hard to swap components,
run tests with mock tools, or migrate between providers as models improve.</p>

<p><strong>Weak error handling.</strong> When a tool fails or returns unexpected output, many frameworks
either crash or retry indefinitely. Production agents need explicit, configurable
error handling at every step.</p>

<p><strong>No audit trail.</strong> For enterprise or safety-critical applications, you need a complete
record of what the agent did — every tool call, every observation, every decision.
Most frameworks treat this as an afterthought.</p>

<h2 id="what-a-good-sdk-should-provide">What a Good SDK Should Provide</h2>

<p>Based on these observations, here is what I think a good open-source agent SDK should
prioritise:</p>

<p><strong>Explicit, inspectable state.</strong> Every step of the agent’s reasoning and action should
be represented as an explicit, serialisable data structure. You should be able to pause
an agent, inspect its complete state, and either resume it or understand what it did.</p>

<p><strong>Composable tools with typed interfaces.</strong> Tools should be defined with explicit input
and output types, validation logic, and error handling. The agent should be able to
discover available tools and understand their capabilities from their definitions.</p>

<p><strong>Modular planning.</strong> The planning component should be separated from the execution
component. This makes it possible to test planning logic without running tools, and to
swap planning strategies without changing execution code.</p>

<p><strong>First-class memory.</strong> Long-running agents need to store and retrieve information across
steps. This should be a first-class concept — not an afterthought implemented by
appending to a prompt.</p>

<p><strong>Permission model.</strong> Different tools should have different permission levels. A tool that
reads a file is different from a tool that writes one, which is different from a tool
that makes a network request. The agent should require explicit authorisation for
operations above a certain permission level.</p>

<p><strong>Complete audit logging.</strong> Every action taken by the agent — including its internal
reasoning, tool calls, observations and decisions — should be logged in a structured
format that can be queried and analysed.</p>

<h2 id="the-memory-problem">The Memory Problem</h2>

<p>One of the most underappreciated challenges in building agentic systems is memory.</p>

<p>Language models do not have persistent memory. Everything they know about the current
task must be present in their context window at the time of each call. For short tasks,
this works fine. For long tasks, it becomes a serious bottleneck.</p>

<p>A good agent SDK should provide abstractions for different types of memory:</p>

<p><strong>Working memory</strong> — the current state of the task, including the goal, the steps
completed so far, and the current plan.</p>

<p><strong>Episodic memory</strong> — records of past interactions that may be relevant to the current
task. The agent should be able to retrieve relevant past episodes when they are helpful.</p>

<p><strong>Semantic memory</strong> — general knowledge about the domain, the user’s preferences, and
the tools available.</p>

<p><strong>Procedural memory</strong> — learned patterns for how to accomplish common subtasks.</p>

<p>These do not need to be implemented as separate systems. But they need to be thought
about as distinct concepts, because the criteria for what to store, when to retrieve,
and how to keep them current are different for each.</p>

<h2 id="interface-diversity">Interface Diversity</h2>

<p>I am also interested in agents that can interact through multiple interfaces: not just
a chat window, but a command line, a browser, an API, or a messaging application.</p>

<p>A well-designed agent should be able to adapt its behaviour to the interface it is
operating through. The way you express a complex analytical task through a terminal
command is different from the way you express it through a conversational interface.
An agent that is tightly coupled to one interaction model will be limited in how it
can be deployed.</p>

<h2 id="what-i-am-working-toward">What I Am Working Toward</h2>

<p>I do not have a complete answer yet. But I find the design space of reliable,
transparent, composable agent systems genuinely interesting — and I think there is
real value to be created by building infrastructure that makes it easier to build
agents that work well in production, not just in demos.</p>

<p>If you are building in this space, I would be glad to compare notes.</p>

<hr />

<p><em>This essay is part of my writing on Agentic Systems. The ideas here connect to
the design work I am doing at Terno AI around secure, auditable AI workflows.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Agentic Systems" /><category term="agents" /><category term="ai" /><category term="open-source" /><category term="sdk" /><category term="autonomous-systems" /><category term="tools" /><summary type="html"><![CDATA[Agentic AI systems are becoming genuinely capable. But the infrastructure for building reliable, auditable, multi-tool agents remains immature. Here is how I am thinking about what a useful open-source agent SDK should look like.]]></summary></entry><entry><title type="html">A World Without Countries</title><link href="https://girisandeep.com/2025/11/10/world-without-countries/" rel="alternate" type="text/html" title="A World Without Countries" /><published>2025-11-10T00:00:00+00:00</published><updated>2025-11-10T00:00:00+00:00</updated><id>https://girisandeep.com/2025/11/10/world-without-countries</id><content type="html" xml:base="https://girisandeep.com/2025/11/10/world-without-countries/"><![CDATA[<p>I want to begin with a provocation.</p>

<p>The country you were born in — the specific rectangle of territory — has determined
more about the conditions of your life than almost any other factor. More than your
intelligence, more than your effort, more than your character. Where you were born
determines your access to education, healthcare, safety, opportunity, legal protection
and economic mobility.</p>

<p>You did not choose this. You cannot change it. It is a lottery at birth, with
consequences that last a lifetime.</p>

<p>This seems like the kind of thing worth thinking about.</p>

<h2 id="nations-are-not-natural">Nations Are Not Natural</h2>

<p>The nation-state, as a political form, is a relatively recent invention. For most of
human history, people organised themselves into much smaller units — tribes, city-states,
small kingdoms — or into very large, loosely held empires that made no claim to
representing a coherent national identity.</p>

<p>The modern nation-state — with fixed borders, a centralised government claiming
sovereignty over a territory, a single legal system, and the idea that the citizens
of the state share a common identity — emerged primarily in the eighteenth and
nineteenth centuries.</p>

<p>This does not make nations illegitimate. Things can be recent and still valuable.
But it does mean that the permanence we feel when we think about the nation — the sense
that it is simply the natural unit of human organisation — is an illusion produced by
familiarity rather than by any deep structural necessity.</p>

<h2 id="what-nations-do-well">What Nations Do Well</h2>

<p>I am not arguing that nations have produced nothing of value. I think they have
produced a great deal.</p>

<p>Nations enabled the kind of large-scale coordination that built modern infrastructure,
legal systems, public education, healthcare systems and scientific research. The state
creates a shared framework within which large numbers of people can cooperate with
strangers — paying taxes, obeying laws, trusting that contracts will be enforced and
that institutions will function predictably.</p>

<p>This is genuinely valuable. Coordination at scale is not easy, and the nation-state
has been a reasonably effective mechanism for achieving it.</p>

<p>Nations have also provided, at their best, a framework for democratic accountability.
The idea that citizens can, through political participation, influence the rules that
govern them is one of the most important political ideas ever developed.</p>

<h2 id="what-nations-do-poorly">What Nations Do Poorly</h2>

<p>But nations also produce costs that we often accept as inevitable when they are not.</p>

<p><strong>Wars.</strong> The most catastrophic consequence of the nation-state system is its tendency
to produce wars between nations. When the world is divided into territorial units with
independent militaries and competing interests, conflict is a predictable consequence.
The twentieth century’s wars — which killed somewhere between 100 and 200 million people
— were largely products of the nation-state system’s internal logic.</p>

<p><strong>Arbitrary restriction of movement.</strong> The current system severely restricts the freedom
of people to live and work where they wish. A highly skilled worker in a poor country
who wishes to move to a richer country faces legal barriers that a skilled worker
born in the richer country never faces. This produces massive economic inefficiency
and enormous human suffering.</p>

<p><strong>Competitive undermining of shared challenges.</strong> Climate change, pandemic preparedness,
financial contagion, and the governance of powerful technologies are all problems that
cannot be solved by individual nations acting alone. The nation-state system makes
global cooperation on these issues structurally difficult.</p>

<p><strong>Identity-based violence.</strong> When national identity becomes associated with ethnic,
religious or cultural identity, the nation-state becomes an instrument of exclusion
and persecution. The history of the twentieth century contains many examples of what
happens when national identity is mobilised this way.</p>

<h2 id="imagining-something-different">Imagining Something Different</h2>

<p>I am not proposing a specific alternative. I am not sure there is one obvious alternative,
and I am sceptical of anyone who claims to have the blueprint for a better world order.</p>

<p>But I find it useful to imagine what a different system might value.</p>

<p>What if political boundaries were permeable to movement? What if human beings could
live and work where they chose, the way goods and capital now largely move freely?</p>

<p>What if there were more robust mechanisms for addressing challenges that cross
national borders — not just in rhetoric, but with real authority and resources?</p>

<p>What if political identity were based less on territory and birth and more on
voluntary association with a set of shared values or institutions?</p>

<p>These are not new ideas. Various forms of cosmopolitanism have been argued for by
philosophers for centuries. The European Union, despite its difficulties, represents
a serious attempt to move beyond the pure nation-state model within a region.</p>

<p>But the ideas remain marginal in mainstream political discourse, in part because
the people who benefit most from the current system — those born into prosperous,
stable nations with strong legal protections — tend to dominate that discourse.</p>

<h2 id="the-limits-of-this-thinking">The Limits of This Thinking</h2>

<p>I am aware of the objections.</p>

<p>Human beings form strong attachments to particular places, cultures, languages and
communities. The nation-state, at its best, provides a framework for protecting and
nurturing these attachments. Any replacement would need to take them seriously.</p>

<p>Large-scale coordination without the nation-state is genuinely hard. We do not have
good models for global democratic accountability. What exists — the United Nations,
international courts, multilateral agreements — works poorly and commands little
genuine loyalty.</p>

<p>And there are serious risks in moving too quickly away from existing structures.
Stability, even imperfect stability, has value. The periods when nation-states have
collapsed or been violently reorganised have generally been terrible for the people
living through them.</p>

<h2 id="why-i-think-about-this">Why I Think About This</h2>

<p>I am a technologist, not a political scientist. I am not in a position to design
alternative world orders, and I am not sure I would trust anyone who claimed to be.</p>

<p>But I think there is value in asking the question: what do we assume is permanent
because we grew up with it, and what would we think about it if we encountered it
for the first time?</p>

<p>The nation-state is one of those things. It is not eternal. It did not always exist
in its current form. It has costs as well as benefits. And there are, at least
conceptually, other ways of organising collective human life.</p>

<p>I do not know what those ways are. But I think asking the question is worth doing —
especially now, when the challenges that face humanity most urgently are ones that
individual nations cannot solve on their own.</p>

<hr />

<p><em>This essay is part of my Beyond Common Sense series — essays on ideas that challenge
assumptions I find it useful to examine. I am not proposing political programmes. I
am trying to think clearly about things that are often treated as beyond question.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Beyond Common Sense" /><category term="society" /><category term="nations" /><category term="philosophy" /><category term="future" /><category term="institutions" /><summary type="html"><![CDATA[Nations feel permanent because they have been present for every moment of our individual lives. But the nation-state is a surprisingly recent invention. What would we lose, and what might we gain, in a world that organised itself differently?]]></summary></entry><entry><title type="html">What Teaching Thousands of Learners Taught Me About Intelligence</title><link href="https://girisandeep.com/2025/11/05/what-teaching-thousands-taught-me-about-intelligence/" rel="alternate" type="text/html" title="What Teaching Thousands of Learners Taught Me About Intelligence" /><published>2025-11-05T00:00:00+00:00</published><updated>2025-11-05T00:00:00+00:00</updated><id>https://girisandeep.com/2025/11/05/what-teaching-thousands-taught-me-about-intelligence</id><content type="html" xml:base="https://girisandeep.com/2025/11/05/what-teaching-thousands-taught-me-about-intelligence/"><![CDATA[<p>I have watched thousands of people learn.</p>

<p>Not in the passive sense of attending a lecture, but in the active sense of working
through a problem they have not seen before. Forming a hypothesis. Testing it.
Discovering they were wrong. Revising. Trying again.</p>

<p>There is something you notice, if you watch enough people learn, that is not captured
in how we usually talk about intelligence.</p>

<h2 id="the-story-we-tell-about-intelligence">The Story We Tell About Intelligence</h2>

<p>The standard story about intelligence goes roughly like this.</p>

<p>Some people are good at mathematics and logical reasoning. Others are better at
verbal things. Some people “get” technical concepts quickly. Others find them difficult.
These differences are relatively stable — your capacity for technical thinking is
something you have, like the colour of your eyes.</p>

<p>This story shapes how learners approach unfamiliar material. The person who was told
at some point that they were “not a maths person” approaches a new quantitative
concept not with curiosity but with pre-emptive defeat. They expect to fail before
they begin.</p>

<p>And the tragedy is: this expectation is self-fulfilling. Not because they genuinely
lack the capacity, but because the expectation changes their behaviour in a way that
produces the predicted failure.</p>

<h2 id="what-i-actually-see">What I Actually See</h2>

<p>After teaching thousands of learners in AI, machine learning and data science, I have
come to believe the standard story is almost entirely wrong about most people.</p>

<p>What I actually see is this:</p>

<p><strong>Lack of confidence masquerades as lack of ability.</strong> When a learner says “I’m not
good at this,” what they almost always mean is “I have not yet had an experience in
this domain that made me feel capable.” The incapacity is not cognitive. It is historical.</p>

<p><strong>Most people can learn technically demanding material when given the right conditions.</strong>
The conditions that matter are: a pace appropriate to where they currently are, problems
that are approachable but genuinely challenging, and feedback that helps them understand
their errors rather than just marking them wrong.</p>

<p><strong>The moment of real learning feels like surprise.</strong> Not the mild surprise of getting
an answer right, but the deeper surprise of suddenly seeing something you did not see
before. When I ask learners to describe what learning actually feels like when it is
working, they often use words like: <em>I suddenly saw it</em>, <em>something clicked</em>, <em>it felt
like a fog clearing</em>.</p>

<p><strong>Confidence compounds.</strong> A learner who successfully works through one challenging
problem approaches the next one differently. The evidence of their own capability
changes their internal model of what they can do. And that changed model makes them
more likely to persist, which makes them more likely to succeed, which generates more
evidence of capability.</p>

<p>This is why the moment of discovery matters so much. A learner who discovers something
for themselves does not just gain knowledge. They gain a data point about their own
capacity to think.</p>

<h2 id="a-specific-memory">A Specific Memory</h2>

<p>One interaction has stayed with me more than most.</p>

<p>A learner — a working professional, probably in her thirties — sent me a message
after completing one of my courses. She wrote that she had spent her whole life
believing she was simply not good at mathematics.</p>

<p>She described how this belief had shaped her choices. She had avoided quantitative
courses. She had apologised for herself when numbers came up in professional contexts.
She had come to accept it as a fixed fact about herself.</p>

<p>After the course, she said something had shifted. She was not suddenly a mathematician.
But she had had the experience of working through problems she had previously considered
beyond her, and of actually succeeding. She could feel that the boundary she had
accepted was not real.</p>

<p>She ended by saying she had started teaching mathematics to her young niece — not
because she had become an expert, but because she had developed enough confidence in
her own thinking to trust herself to guide someone else.</p>

<p>That message changed how I think about education.</p>

<h2 id="what-this-means-for-how-we-teach">What This Means for How We Teach</h2>

<p>If intelligence is more about confidence and accumulated experience than about fixed
capacity, then the most important thing an educator can do is not to deliver information
efficiently. It is to create conditions for genuine discovery.</p>

<p>The learner who discovers something has a different relationship to that knowledge
than one who received it. They know, through direct experience, that their mind
worked on something hard and found an answer. That experience is evidence they can
draw on in every future encounter with something difficult.</p>

<p>Conversely, the learner who is always receiving pre-formed knowledge has no evidence
that their own mind can do the work. Even if they can recall and apply what they
were taught, they have no reason to trust themselves in the face of something new.</p>

<h2 id="the-implication-for-ai-and-education">The Implication for AI and Education</h2>

<p>I am often asked what I think about AI tutors and AI-based education.</p>

<p>My view is: it depends entirely on what model of intelligence the AI system is built
on.</p>

<p>An AI that treats learning as information transfer — that answers every question immediately,
that provides hints before the learner has struggled, that optimises for correct answers
rather than productive struggle — will be efficient and useless in the way that bad
lectures are useless.</p>

<p>An AI that understands that the goal is the development of a learner’s confidence and
self-trust — that knows when to be quiet, that recognises the moment before discovery
and does not disturb it, that celebrates the learner’s reasoning rather than just their
answers — that AI would be genuinely valuable.</p>

<p>The technology to build the second kind of AI exists. What is needed is the right
model of what learning actually is.</p>

<hr />

<p><em>I write about education at the intersection of technology and human development.
The <a href="/learning-by-inventing">Learning by Inventing</a> section of this site explores
these ideas in more depth.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Education and Careers" /><category term="teaching" /><category term="education" /><category term="intelligence" /><category term="confidence" /><category term="learning" /><category term="cloudxlab" /><summary type="html"><![CDATA[I have watched thousands of people encounter new ideas — some with fear, some with curiosity, some with both. What I have learned is that intelligence is far less fixed and far more social than most of us were taught to believe.]]></summary></entry><entry><title type="html">Why LLMs Should Generate Code Instead of Guessing Answers From Data</title><link href="https://girisandeep.com/2025/11/01/llm-generate-code-not-guess-data-answers/" rel="alternate" type="text/html" title="Why LLMs Should Generate Code Instead of Guessing Answers From Data" /><published>2025-11-01T00:00:00+00:00</published><updated>2025-11-01T00:00:00+00:00</updated><id>https://girisandeep.com/2025/11/01/llm-generate-code-not-guess-data-answers</id><content type="html" xml:base="https://girisandeep.com/2025/11/01/llm-generate-code-not-guess-data-answers/"><![CDATA[<p>Let me describe two ways an AI can respond to the question:
<em>“What was our best-performing product category last quarter?”</em></p>

<p><strong>Approach One:</strong> The AI reads the question, accesses some information about your
business, and generates a response: <em>“Based on available information, your Electronics
category showed the strongest performance last quarter, with revenue growth of approximately
18% compared to the prior period.”</em></p>

<p><strong>Approach Two:</strong> The AI generates the following code, executes it, and returns the result:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="n">pandas</span> <span class="k">as</span> <span class="n">pd</span>

<span class="n">df</span> <span class="o">=</span> <span class="nf">query_database</span><span class="p">(</span><span class="sh">"""</span><span class="s">
    SELECT
        category,
        SUM(revenue) as total_revenue,
        SUM(revenue) - LAG(SUM(revenue)) OVER (PARTITION BY category ORDER BY quarter) as qoq_growth
    FROM sales
    WHERE quarter = </span><span class="sh">'</span><span class="s">2025-Q3</span><span class="sh">'</span><span class="s">
    GROUP BY category
    ORDER BY total_revenue DESC
    LIMIT 5
</span><span class="sh">"""</span><span class="p">)</span>

<span class="n">best_category</span> <span class="o">=</span> <span class="n">df</span><span class="p">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">Best category: </span><span class="si">{</span><span class="n">best_category</span><span class="p">[</span><span class="sh">'</span><span class="s">category</span><span class="sh">'</span><span class="p">]</span><span class="si">}</span><span class="sh">"</span><span class="p">)</span>
<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">Revenue: </span><span class="si">{</span><span class="n">best_category</span><span class="p">[</span><span class="sh">'</span><span class="s">total_revenue</span><span class="sh">'</span><span class="p">]</span><span class="si">:</span><span class="p">,.</span><span class="mi">0</span><span class="n">f</span><span class="si">}</span><span class="sh">"</span><span class="p">)</span>
<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">QoQ growth: </span><span class="si">{</span><span class="n">best_category</span><span class="p">[</span><span class="sh">'</span><span class="s">qoq_growth</span><span class="sh">'</span><span class="p">]</span><span class="si">:</span><span class="p">,.</span><span class="mi">0</span><span class="n">f</span><span class="si">}</span><span class="s"> (</span><span class="si">{</span><span class="n">best_category</span><span class="p">[</span><span class="sh">'</span><span class="s">qoq_growth</span><span class="sh">'</span><span class="p">]</span><span class="o">/</span><span class="n">df</span><span class="p">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="sh">'</span><span class="s">total_revenue</span><span class="sh">'</span><span class="p">]</span><span class="o">*</span><span class="mi">100</span><span class="si">:</span><span class="p">.</span><span class="mi">1</span><span class="n">f</span><span class="si">}</span><span class="s">%)</span><span class="sh">"</span><span class="p">)</span>
</code></pre></div></div>

<p>The difference between these two approaches is not stylistic. It is fundamental.</p>

<h2 id="what-approach-one-is-actually-doing">What Approach One Is Actually Doing</h2>

<p>Approach One uses a language model’s text generation capability to produce something
that resembles an answer. The model has learned, from training data, what analytical
answers look like. It knows that such answers typically contain category names,
percentages, comparisons to prior periods, and confident-sounding phrasing.</p>

<p>But here is what the model cannot do: it cannot know whether its output is correct.</p>

<p>The number “18%” was generated because it sounds plausible in this context. The word
“Electronics” was selected because it sounds like a plausible best-performing category.
The model has no mechanism to verify these claims against actual data.</p>

<p>This is what we mean when we say that language models hallucinate. It is not a bug
that can be fixed with a better prompt. It is a property of the underlying approach.
Text generation produces text that is <em>plausible given its training</em>, not text that is
<em>verified against the actual state of the world</em>.</p>

<p>For answering general knowledge questions, this limitation is manageable.
For answering questions about your specific business data, it is not.</p>

<h2 id="what-approach-two-is-actually-doing">What Approach Two Is Actually Doing</h2>

<p>Approach Two uses a language model’s code generation capability to produce an
analytical program. The program is then executed against the actual data.</p>

<p>This changes the reliability property completely.</p>

<p>The answer now comes from running the analysis. The number returned is the actual
number in the database. The category returned is the category that actually has the
highest revenue. These facts are computed, not generated.</p>

<p>The language model can still make errors — it might write syntactically incorrect
code, or make incorrect assumptions about the database schema. But these errors are
of a completely different character:</p>

<ol>
  <li>
    <p><strong>They are often visible.</strong> Code that is wrong frequently fails to run, rather
than running and producing a plausible-looking wrong answer.</p>
  </li>
  <li>
    <p><strong>They are auditable.</strong> You can inspect the code and see exactly what analysis
was performed. A data analyst can review the SQL and confirm that it answers
the intended question.</p>
  </li>
  <li>
    <p><strong>They are reproducible.</strong> Running the same code against the same data will
always produce the same result. The answer is not different every time you ask.</p>
  </li>
  <li>
    <p><strong>They are correctable.</strong> If the code is wrong, you can fix it. If a text
generation output is wrong, you have no mechanism for correction other than
asking again and hoping the next generation is better.</p>
  </li>
</ol>

<h2 id="why-this-matters-for-enterprise-use">Why This Matters for Enterprise Use</h2>

<p>Imagine a product manager making a headcount decision based on analysis of customer
acquisition data. Or a finance leader using AI-generated analysis to inform an
investment decision. Or a supply chain team using AI to forecast inventory needs.</p>

<p>In these contexts, the difference between an answer that is computed and an answer
that is generated is not academic. It is the difference between reliable intelligence
and sophisticated-sounding noise.</p>

<p>The enterprises that will benefit most from AI analytics are not those with the
highest tolerance for occasional errors. They are those who can apply AI to decisions
that matter — which requires a level of reliability that text generation cannot provide.</p>

<h2 id="the-code-quality-challenge">The Code Quality Challenge</h2>

<p>I want to be honest about the limitations of the code generation approach as well.</p>

<p>Generating correct analytical code is harder than generating correct text. Language
models can produce code that is syntactically valid but semantically wrong — querying
the right table but computing the wrong metric, applying the right function but to
the wrong column, producing results that look plausible but measure the wrong thing.</p>

<p>Addressing this requires several things working together:</p>

<p><strong>A rich semantic layer.</strong> The model needs to know what the data actually means —
not just the schema, but the business context. What does “revenue” mean in your
system? Is it net or gross? Does it include refunds? Are there edge cases in how
certain categories are classified?</p>

<p><strong>Schema validation.</strong> The generated code should be checked against the actual
schema before execution to catch references to non-existent tables or columns.</p>

<p><strong>Output validation.</strong> Where possible, the results should be checked for plausibility —
are these numbers in the expected range? Do the totals add up correctly?</p>

<p><strong>Iterative refinement.</strong> When code fails or produces unexpected output, the system
should be able to diagnose the problem and generate a corrected version.</p>

<p>None of these are fully solved. But they are solvable in a way that the fundamental
reliability problem of text generation is not.</p>

<h2 id="the-right-tool-for-the-right-problem">The Right Tool for the Right Problem</h2>

<p>I am not arguing that text generation is useless for analytical work. There are
contexts where it is exactly right: summarising results, explaining analysis in
plain language, generating hypotheses to investigate, answering questions about
general methodology.</p>

<p>But for the core task of answering specific factual questions about enterprise data,
code generation and execution is the right approach. Not because it is more
impressive, but because it is more honest about what AI can and cannot reliably do.</p>

<p>The goal is not an AI that always sounds confident. The goal is an AI that is
genuinely trustworthy — that fails visibly when it fails, that produces verifiable
results when it succeeds, and that gives the humans who use it real information
rather than the appearance of it.</p>

<p>That is the kind of AI that enterprises actually need.</p>

<hr />

<p><em>This is part of my ongoing writing on building Terno AI. Previous essays in this
series cover <a href="/essays">why I am building an AI data scientist</a> and
<a href="/essays">enterprise AI security</a>.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Building Terno AI" /><category term="llm" /><category term="data-analytics" /><category term="code-generation" /><category term="reliability" /><category term="enterprise-ai" /><summary type="html"><![CDATA[When an AI is asked a question about data, it faces a choice: generate text that sounds like the answer, or generate code that computes the answer. These are not the same. Here is why the distinction matters enormously for enterprise use.]]></summary></entry><entry><title type="html">Can an AI Teacher Help a Child Discover the Pythagorean Theorem?</title><link href="https://girisandeep.com/2025/10/25/ai-teacher-pythagorean-theorem/" rel="alternate" type="text/html" title="Can an AI Teacher Help a Child Discover the Pythagorean Theorem?" /><published>2025-10-25T00:00:00+00:00</published><updated>2025-10-25T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/25/ai-teacher-pythagorean-theorem</id><content type="html" xml:base="https://girisandeep.com/2025/10/25/ai-teacher-pythagorean-theorem/"><![CDATA[<p>I want to try something in this essay that I do not usually do: I want to show you
a conversation.</p>

<p>Not a conversation that happened, but one that I have been designing in my head for
a long time. A conversation between an AI teacher — built on the philosophy I call
Learning by Inventing — and a child learning about the Pythagorean theorem.</p>

<p>I want to walk through this conversation not just to describe the idea, but to make
it concrete. Because I think the gap between “teaching through discovery” as an
abstract philosophy and “this is exactly what the teacher says and what happens next”
is where most attempts at this approach fail.</p>

<hr />

<h2 id="the-conversation">The Conversation</h2>

<p><strong>Child:</strong> I want to learn about triangles.</p>

<p><strong>AI Teacher:</strong> Great. Let me give you something to do first, before we talk much.
Can you draw a square on a piece of paper — any size you like?</p>

<p><strong>Child:</strong> [draws a square]</p>

<p><strong>AI Teacher:</strong> How many small squares fit inside it, if each small square is one
unit wide? Count them.</p>

<p><strong>Child:</strong> Sixteen. It’s four by four.</p>

<p><strong>AI Teacher:</strong> So the area is sixteen. Now can you draw another square — smaller
this time?</p>

<p><strong>Child:</strong> [draws a three by three square] Nine squares.</p>

<p><strong>AI Teacher:</strong> Good. Now here’s something to try. Can you cut out both squares,
and see if you can arrange them — without overlapping — inside a larger square?
Can you make a bigger square from two smaller ones?</p>

<p>[The child tries. It doesn’t quite work with 16 and 9.]</p>

<p><strong>AI Teacher:</strong> What happens when you try?</p>

<p><strong>Child:</strong> It almost works, but not quite. There’s a gap in the corner.</p>

<p><strong>AI Teacher:</strong> Let me ask you something different. What if I told you that with
the right two squares, you <em>can</em> always make a bigger square — but the sizes of the
three squares have to be related to each other in a very specific way?</p>

<p><strong>Child:</strong> What way?</p>

<p><strong>AI Teacher:</strong> That’s what I want you to discover. Let me give you a different
pair of squares to try: one with area 9 and one with area 16. But this time, arrange
them together in an L-shape. Can you see what bigger square you could make?</p>

<hr />

<p>This is only the beginning of the conversation, but you can already see what is
different about it.</p>

<h2 id="what-makes-this-different">What Makes This Different</h2>

<p>The AI teacher in this conversation has not explained anything yet. It has not said
the words “Pythagorean theorem.” It has not drawn a right triangle. It has not
written any equations.</p>

<p>What it has done is given the child something to do. And the sequence of what to do
is designed to make the child encounter the key relationship on their own.</p>

<p>When children cut squares and try to fit them together, they are building an intuition.
They are feeling the relationship between area and sides. They are noticing that some
combinations work and some do not. The frustration of the combination that doesn’t
quite fit is, paradoxically, one of the most valuable moments — because it means they
are not just following steps, they are genuinely grappling with the problem.</p>

<h2 id="what-the-ai-teacher-must-know">What the AI Teacher Must Know</h2>

<p>Building an AI teacher that can do this well is technically harder than building an
AI that can explain the Pythagorean theorem.</p>

<p>An AI that explains can follow a script. An AI that teaches through discovery must:</p>

<p><strong>Maintain a model of where the learner currently is.</strong> Not just what they know, but
what they are attending to, what they have just tried, and where their understanding
is currently incomplete.</p>

<p><strong>Know when to be silent.</strong> If the child is working through a problem, the teacher
must not interrupt. The productive struggle is the learning. Breaking it prematurely
by offering hints is one of the most common errors in discovery-based teaching.</p>

<p><strong>Know when and how to offer a nudge.</strong> When a child is stuck in a way that is no
longer productive — genuinely confused rather than productively grappling — the
teacher must find the smallest possible intervention that redirects attention without
removing the work from the learner.</p>

<p><strong>Recognise the moment of discovery.</strong> When the child says “I think I see it” — or
something close to that — the teacher must notice this and respond in a way that
helps the child articulate their own understanding.</p>

<p>This last point is the most important. The moment of discovery is fragile. If the
teacher immediately validates it too enthusiastically, the child may stop exploring.
If the teacher ignores it, the moment passes. The right response is something like:
“What do you see? Tell me in your own words.”</p>

<h2 id="the-design-problem">The Design Problem</h2>

<p>I have been thinking about this AI teacher for several years.</p>

<p>The hardest design problem is not the AI capability — current language models are
good enough to have sophisticated conversations and to generate appropriate exercises.</p>

<p>The hardest design problem is the curriculum of discovery.</p>

<p>For any given concept — the Pythagorean theorem, the idea of a derivative, the
intuition behind gradient descent — someone needs to design the sequence of problems
that leads a learner toward it. This sequence must be:</p>

<ul>
  <li>Simple enough that each individual step is approachable</li>
  <li>Designed so that working through the steps makes the key pattern visible</li>
  <li>Flexible enough to respond to learners who go in unexpected directions</li>
  <li>Calibrated to the age and background of the learner</li>
</ul>

<p>This design work is, I think, some of the most intellectually demanding work in
education. It requires a very deep understanding of the concept itself — not just
the final form, but the path of understanding that leads there.</p>

<h2 id="what-i-am-building-toward">What I Am Building Toward</h2>

<p>I believe an AI teacher that genuinely teaches through discovery is one of the most
valuable things we could build with current AI technology.</p>

<p>Not because it would replace human teachers — I do not believe it would or should —
but because it would make the experience of guided discovery available to learners
who do not currently have access to teachers who can offer it.</p>

<p>Many of the most effective discovery-based teaching experiences happen in one-on-one
or small-group settings with a skilled human teacher. That kind of teaching cannot be
scaled to reach hundreds of millions of learners.</p>

<p>An AI that could do something approaching this — while a human teacher focuses on the
social, emotional and motivational dimensions that AI cannot yet handle — might
genuinely change the quality of education available to people who currently have
access only to lectures and textbooks.</p>

<p>That seems worth pursuing.</p>

<hr />

<p><em>This essay is part of my ongoing thinking about <a href="/learning-by-inventing">Learning by Inventing</a>.
If you are an educator, researcher or builder interested in these ideas, I would be
glad to connect.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Learning by Inventing" /><category term="ai-teacher" /><category term="education" /><category term="mathematics" /><category term="discovery" /><category term="learning-by-inventing" /><summary type="html"><![CDATA[What would it look like if an AI teacher guided a child toward discovering the Pythagorean theorem for themselves — rather than simply explaining it? Here is a concrete walkthrough of how that conversation might go, and what makes it different.]]></summary></entry><entry><title type="html">Why Enterprise AI Must Be Secure by Design</title><link href="https://girisandeep.com/2025/10/20/enterprise-ai-secure-by-design/" rel="alternate" type="text/html" title="Why Enterprise AI Must Be Secure by Design" /><published>2025-10-20T00:00:00+00:00</published><updated>2025-10-20T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/20/enterprise-ai-secure-by-design</id><content type="html" xml:base="https://girisandeep.com/2025/10/20/enterprise-ai-secure-by-design/"><![CDATA[<p>Here is a scenario that I think about often.</p>

<p>A company deploys an AI assistant connected to its internal data. Employees start
asking it questions. The system is useful and popular. Then, one day, someone asks
a question that the system was never designed to handle — and it answers anyway,
drawing on data that the questioner was never supposed to access.</p>

<p>No malicious intent. No external attacker. Just an AI doing what it was designed to do —
helping the user — in a situation where helping meant revealing something it should not.</p>

<p>This is not a hypothetical risk. It is a category of failure that any organisation
connecting AI to its data must take seriously. And I think the industry has not yet
fully reckoned with it.</p>

<h2 id="the-demo-vs-production-gap">The Demo vs. Production Gap</h2>

<p>AI applications for enterprise data analytics face a specific and underappreciated
challenge: the gap between what works in a demonstration and what is safe in production.</p>

<p>In a demonstration, you show the system answering questions correctly on a carefully
chosen dataset. The data is clean. The questions are well-posed. The access rules are
simple. Everything works as expected.</p>

<p>In production, the data is messy. The questions are unexpected. The users have varying
levels of access rights. There are sensitive columns and confidential rows. The system
operates continuously and handles requests from many users with different roles.</p>

<p>Many AI applications that look excellent in demos fail in one or more of these
dimensions when deployed for real enterprise use.</p>

<h2 id="what-genuine-enterprise-security-requires">What Genuine Enterprise Security Requires</h2>

<p>When I talk about secure enterprise AI, I mean something more specific than just
encrypting data in transit or requiring authentication to use the system.</p>

<p>I mean the following:</p>

<p><strong>Data should stay in your environment.</strong> The most sensitive enterprise data should
not need to leave the company’s security perimeter to receive AI analysis. A system
that requires all data to flow to an external API creates both privacy risk and
compliance risk. Terno AI is designed to support deployment within the customer’s
own private cloud or on-premises environment.</p>

<p><strong>Access controls must be deterministic, not AI-dependent.</strong> Here is a subtle but
important point. If your system relies on an AI model to decide whether a user is
allowed to see a particular piece of data, you are trusting a probabilistic system
with a binary security decision. AI models can be prompted, confused, or led astray.
Access to sensitive data must be enforced through deterministic rules — not through
another model’s judgment.</p>

<p><strong>Code execution must be sandboxed.</strong> When AI systems can execute code, there is
potential for that code to interact with systems beyond its intended scope. A
well-designed analytical AI should execute code in a strict sandbox — with defined
resource limits, no ability to make network requests, no file system access beyond
what is explicitly permitted, and isolated from other users’ computation.</p>

<p><strong>Audit logs must be maintained.</strong> In enterprise contexts, it is not sufficient for
a system to be secure — it must also be auditable. You need to be able to answer:
who asked what, when, what analysis was run, and what was returned. This is both
a compliance requirement and a practical necessity for investigating anything unexpected.</p>

<p><strong>Security must cover the data, not just the interface.</strong> A system can require login
and still leak data through its outputs. If an AI will answer any natural language
question by summarising data, a sophisticated user can effectively reconstruct
sensitive information through a series of carefully posed queries. Real security
requires thinking about what information can be inferred from outputs, not just
what data is directly returned.</p>

<h2 id="the-semantic-layer-and-security">The Semantic Layer and Security</h2>

<p>There is a connection between data security and the semantic layer that I have come
to find important.</p>

<p>A well-designed semantic layer does not just improve accuracy. It also provides a
natural place to enforce data governance rules.</p>

<p>When the system has an explicit, maintained model of what each piece of data means —
what tables exist, what columns contain, what data is sensitive, what access a
particular user role should have — security rules can be expressed and enforced at
the level of meaning rather than just at the level of raw tables and columns.</p>

<p>A user who should not see salary data should be prevented from accessing any analysis
that would reveal it — even indirectly, even through an aggregation that seems
innocuous, even through a question that does not mention “salary” but could
reconstruct the information.</p>

<p>This kind of protection is much harder to implement when security is bolted on to
a system as an afterthought. It requires being designed in from the beginning.</p>

<h2 id="the-trust-problem-is-the-hard-problem">The Trust Problem Is the Hard Problem</h2>

<p>I believe the central challenge of enterprise AI is not capability. Current AI systems
can perform impressive analytical work.</p>

<p>The central challenge is trust.</p>

<p>For an enterprise to genuinely rely on an AI system for analytical work that drives
real decisions, they need to trust that the system will be correct when it matters,
that it will not leak data it should not reveal, that its behaviour is predictable
and auditable, and that it will fail safely and visibly rather than silently and dangerously.</p>

<p>Building AI systems that deserve this trust requires making different choices at every
layer of the design — from how data is stored and accessed, to how code is generated
and executed, to how outputs are validated before they are returned.</p>

<p>This is harder than building impressive demos. But it is the only kind of enterprise
AI that is genuinely worth building.</p>

<hr />

<p><em>This essay is part of my ongoing writing about what I am learning while building
Terno AI. For more on the technical approach, see my essay on
<a href="/essays">why AI should generate code rather than guess answers</a>.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Building Terno AI" /><category term="enterprise-ai" /><category term="security" /><category term="data-privacy" /><category term="architecture" /><category term="terno-ai" /><summary type="html"><![CDATA[Many AI applications are impressive in demonstrations but become dangerous when connected to real enterprise data. Security cannot be an afterthought. Here is how I am thinking about building AI that enterprises can genuinely trust.]]></summary></entry><entry><title type="html">From IIT Roorkee to Terno AI: My Journey Through Technology and Teaching</title><link href="https://girisandeep.com/2025/10/15/iit-roorkee-to-terno-ai-journey/" rel="alternate" type="text/html" title="From IIT Roorkee to Terno AI: My Journey Through Technology and Teaching" /><published>2025-10-15T00:00:00+00:00</published><updated>2025-10-15T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/15/iit-roorkee-to-terno-ai-journey</id><content type="html" xml:base="https://girisandeep.com/2025/10/15/iit-roorkee-to-terno-ai-journey/"><![CDATA[<p>I am a Chemical Engineer who became a software engineer. A software engineer who
became an entrepreneur. An entrepreneur who became a teacher. And a teacher who
returned to building products.</p>

<p>That is the short version. The longer version is more interesting — not because of
where I ended up, but because of how each chapter prepared me for the next in ways
I did not anticipate.</p>

<h2 id="iit-roorkee-learning-to-build">IIT Roorkee: Learning to Build</h2>

<p>I arrived at IIT Roorkee to study Chemical Engineering. What I actually spent most of
my time doing was computing.</p>

<p>I want to be precise about this: it was not that I was a reluctant engineer. I was
genuinely interested in the curriculum. But I was more interested in computers. I spent
hours learning to program, building small systems, solving problems. I read widely and
stayed up late working through things I had not been taught in class.</p>

<p>Looking back, this was my first experience of a truth I would return to many times:
the things you choose to spend your discretionary time on usually point toward where
you should go.</p>

<p>The other significant thing that happened at IIT Roorkee was co-founding IMG — the
Information Management Group. We built and maintained online systems and resources
that the whole campus depended on. This was my first experience of building something
real for real users.</p>

<p>What I remember most is the feedback loop. When something broke, people noticed
immediately. When something worked well, you could see people using it. Building
for a community of users who actually depend on what you built is a very different
experience from building for a course assignment.</p>

<h2 id="d-e-shaw-learning-to-think-rigorously">D. E. Shaw: Learning to Think Rigorously</h2>

<p>My first job after graduation was at D. E. Shaw, then one of the most technically
sophisticated firms in the world. This was in the early 2000s, before the vocabulary
of data science or machine learning had entered mainstream usage.</p>

<p>What I took from D. E. Shaw was not a specific set of technologies — those changed
quickly. What I took was a standard of rigour.</p>

<p>There was a culture there of thinking very carefully before concluding anything. Of not
accepting an answer simply because it seemed right or because it was fast to arrive at.
Of being sceptical of your own reasoning. Of building things with the assumption that
they would be scrutinised.</p>

<p>I still carry this. When I am building something — whether code, an argument or a
product feature — I hear an internal voice asking: are you sure? Have you checked this?
What are you assuming?</p>

<h2 id="amazon-learning-scale">Amazon: Learning Scale</h2>

<p>At Amazon, I worked on the product detail page — one of the most-visited pages in
internet commerce — and on recommendation systems and image selection frameworks.</p>

<p>Scale changes the nature of engineering problems in interesting ways. When something
runs for millions of users, the difference between a decision that is right 95% of the
time and one that is right 99% of the time is enormous in absolute terms. Small gains
compound. Small errors multiply.</p>

<p>I also learned something about customer thinking at Amazon that has stayed with me.
There was a genuine insistence on starting from what the customer actually needs, rather
than from what was technically interesting or convenient to build. This sounds obvious.
In practice, it is surprisingly hard to maintain.</p>

<h2 id="inmobi-learning-data-at-scale">InMobi: Learning Data at Scale</h2>

<p>At InMobi, I worked with very large datasets — recommendation systems operating on
hundreds of terabytes. This deepened my understanding of the practical challenges of
building machine learning systems in production.</p>

<p>Reading papers about machine learning is one thing. Building systems that produce
useful outputs on real data, with real latency constraints, with real distribution
shift as the world changes — that is something else. The gap between the theoretical
ideal and the practical working system is always larger than it looks from the outside.</p>

<h2 id="tbits-learning-to-build-a-company">tBits: Learning to Build a Company</h2>

<p>Founding tBits was my first experience of the full cycle of company building.</p>

<p>Technical problems have right answers — or at least, better and worse approaches that
can be evaluated objectively. Business problems often have no right answer. There are
decisions that must be made with incomplete information, under pressure, with real
consequences for real people.</p>

<p>The most important thing I learned at tBits was about people. Hiring, mentoring,
creating conditions where talented engineers could do their best work — this is
a skill that does not come from studying computer science. It comes from paying
attention to people and taking seriously your responsibility toward them.</p>

<p>Several of the engineers I hired at tBits have gone on to build strong careers.
That matters to me more than the technical achievements of the company itself.</p>

<h2 id="cloudxlab-learning-what-learning-actually-is">CloudxLab: Learning What Learning Actually Is</h2>

<p>CloudxLab changed me more than any other chapter.</p>

<p>I expected to be a teacher who knew the material well and could explain it clearly.
What I discovered was that knowing the material and being able to explain it clearly
is not enough — and sometimes not even the most important thing.</p>

<p>The learners who transformed most were not the ones who sat through the best
explanations. They were the ones who struggled productively and experienced the
moment of understanding something for themselves.</p>

<p>This is what led me toward what I now call Learning by Inventing. The realisation
that the teacher’s job is not primarily to deliver information — it is to design
conditions in which the learner discovers it.</p>

<p>Teaching hundreds of thousands of people also gave me something that no amount of
reading about education could have given: a deep empirical sense of how people learn,
where they get stuck, what creates confidence and what destroys it.</p>

<h2 id="terno-ai-bringing-it-all-together">Terno AI: Bringing It All Together</h2>

<p>When I started thinking about Terno AI, I could trace a line from every earlier chapter.</p>

<p>The rigour from D. E. Shaw told me that plausible-sounding was not good enough.
The scale thinking from Amazon told me to think carefully about reliability at
production levels. The data systems work from InMobi told me the gap between demo
and production is real. The company-building at tBits told me that the user matters
more than the technology. And teaching at CloudxLab told me that things need to
work in the hands of real people with real needs, not just in ideal conditions.</p>

<p>Terno AI is an AI data scientist for enterprises. But in a sense, it is built on
everything I have learned about how people and technology interact — which is to say,
on twenty years of increasingly specific and hands-on work.</p>

<h2 id="what-i-would-tell-my-earlier-self">What I Would Tell My Earlier Self</h2>

<p>Looking back, a few things stand out.</p>

<p><strong>The work you do in your discretionary time usually tells you what you care about.</strong>
I spent my free time at IIT Roorkee programming when I could have been studying
Chemical Engineering more diligently. I should have listened to that signal sooner.</p>

<p><strong>Every chapter teaches you something that the next chapter needs.</strong> I could not have
built CloudxLab without what I learned at Amazon about scale, or without what I
learned at tBits about building a company. I could not have built Terno AI without
what CloudxLab taught me about what real users need.</p>

<p><strong>Teaching is a form of learning.</strong> The best way to discover the limits of your own
understanding is to try to guide someone else toward it.</p>

<p>And perhaps most importantly: <strong>the interesting questions are usually at the
intersection of things</strong>. My most productive work has always been where technology
meets human need, where engineering meets teaching, where product meets idea.</p>

<hr />

<p><em>This essay is part of my writing on the Founder Journey. If you are interested in
the technical side of what I am building now, the
<a href="/essays/?category=building-terno-ai">Building Terno AI</a> essays go deeper into the
product and engineering thinking.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Founder Journey" /><category term="career" /><category term="entrepreneurship" /><category term="iit-roorkee" /><category term="amazon" /><category term="cloudxlab" /><category term="personal" /><summary type="html"><![CDATA[I studied Chemical Engineering but became absorbed in computers. I worked on recommendation systems at Amazon but then founded an education company. I taught hundreds of thousands of learners but then returned to building AI products. Here is how each chapter prepared me for the next.]]></summary></entry><entry><title type="html">Why I Am Building an AI Data Scientist</title><link href="https://girisandeep.com/2025/10/10/why-building-ai-data-scientist/" rel="alternate" type="text/html" title="Why I Am Building an AI Data Scientist" /><published>2025-10-10T00:00:00+00:00</published><updated>2025-10-10T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/10/why-building-ai-data-scientist</id><content type="html" xml:base="https://girisandeep.com/2025/10/10/why-building-ai-data-scientist/"><![CDATA[<p>I want to tell you about a problem I have seen repeatedly.</p>

<p>A business leader wants to understand something about their company. Maybe it is why
churn increased last quarter. Maybe it is which customer segment is driving most of
the growth. Maybe it is whether the promotional campaign actually worked, after
controlling for seasonality.</p>

<p>These are not unusual questions. They are exactly the kind of question that good
businesses ask constantly.</p>

<p>Now watch what happens next.</p>

<p>The leader opens their BI dashboard. They find some charts. The charts show overall
trends but not the specific slice they need. They submit a request to the data team.
The data team is busy. Three days later, a report comes back. But the question has
slightly changed — and the report does not quite answer the new version.</p>

<p>This cycle plays out thousands of times a day in organisations around the world.</p>

<h2 id="the-wrong-tool-for-the-job">The Wrong Tool for the Job</h2>

<p>The standard response to this problem has been dashboards. Build more dashboards.
Add more pre-built reports. Create more self-service analytics tools.</p>

<p>I think this is the wrong tool for the problem.</p>

<p>Dashboards are good at showing you what you already know you want to see. They are
built around anticipated questions. But the most valuable analytical work is almost
always about unanticipated questions — the question that occurs to you in the middle
of a meeting, the follow-up that emerges from an answer, the investigation that was
triggered by something unexpected.</p>

<p>For that kind of work, a dashboard is useless.</p>

<h2 id="the-ai-promise--and-the-ai-problem">The AI Promise — and the AI Problem</h2>

<p>The obvious modern answer is: use AI. Ask your data a question in plain English.</p>

<p>And to be fair, there are now many tools that let you do something like this. You type
a question, the AI generates SQL or a summary, and an answer appears.</p>

<p>But there is a problem with this approach that I became increasingly uncomfortable with
the more I thought about it.</p>

<p>When a language model reads your question and produces an answer, it is doing text
generation. It is producing text that sounds like the right answer to your question,
based on patterns it learned during training. It has learned, in some sense, what
analytical answers look like.</p>

<p>But there is a fundamental difference between text that resembles an answer and an
answer that is actually correct.</p>

<p>A language model can write “revenue grew 23% in Q3” with exactly as much confidence
whether the actual number is 23% or 7% or -4%. It cannot distinguish between a
statistically sound conclusion and a plausible-sounding fabrication, because it is
not doing statistics. It is doing writing.</p>

<p>For most applications, this is an acceptable limitation. But for business decisions —
for the kind of analysis that drives headcount decisions, investment choices, product
roadmaps — it is not acceptable.</p>

<h2 id="a-different-approach">A Different Approach</h2>

<p>The approach I am taking with Terno AI starts from a different premise.</p>

<p>Rather than asking a language model to produce an answer, I am asking it to produce
<em>code that computes</em> the answer. The code is then executed in a secure, sandboxed
environment against the actual data. The result is computed, not composed.</p>

<p>This changes the reliability property completely. The answer comes from running the
analysis, not from generating text. You can inspect the code. You can verify the logic.
You can reproduce the result. And if the code is wrong, it will often fail visibly
rather than silently — which is itself useful information.</p>

<p>This is what I mean when I say Terno AI is an AI data scientist rather than an
AI answer-generator. It is designed to actually perform the analysis.</p>

<h2 id="the-semantic-layer-problem">The Semantic Layer Problem</h2>

<p>There is a second, less obvious challenge that I have become increasingly focused on.</p>

<p>Real enterprise databases are messy in ways that make naive AI applications fail.</p>

<p>Table names were chosen by engineers, not by business users. Column names are often
abbreviations or legacy codes. Business concepts are not documented anywhere in the
schema. The relationship between what a user means by “active customer” and what the
database actually contains requires knowledge that is not in the data itself.</p>

<p>I have come to believe that an AI data scientist that ignores this problem will produce
unreliable results even if the underlying analysis engine is perfect. The analytical
code might be syntactically correct but semantically wrong — computing the right
operation on the wrong thing.</p>

<p>Terno AI addresses this through what I call a semantic layer: a maintained, structured
understanding of what the data actually means. What tables represent. How columns map
to business concepts. What business formulas mean. Which terms users commonly use and
what they refer to.</p>

<p>This is unglamorous work. But I have become convinced it is the difference between
a demo that looks impressive and a product that actually works reliably.</p>

<h2 id="why-now">Why Now</h2>

<p>Two things have come together to make this tractable now.</p>

<p>The first is the quality of current language models. The ability to generate analytically
correct code from a natural language description of a task has improved dramatically in
the last few years. It is not perfect — but it is good enough to be genuinely useful,
and it is improving rapidly.</p>

<p>The second is the broader enterprise appetite for AI that actually works. There is a
growing frustration, in my view, with AI applications that are impressive in
demonstrations but unreliable in production. Enterprises are looking for AI they can
trust for real work — and they are willing to pay for it.</p>

<h2 id="the-larger-question">The Larger Question</h2>

<p>I am building Terno AI partly because I think it is commercially valuable. But I am
also building it because I think it addresses a real problem in how organisations make
decisions.</p>

<p>Most organisations have data. Few of them can ask real questions of it. The people
who can ask — skilled data analysts and data scientists — are expensive, scarce and
slow compared to the rate at which analytical questions arise.</p>

<p>An AI data scientist that can be trusted to perform real analysis — securely, correctly,
reproducibly — is not just a convenience. It is a capability that changes the nature
of how organisations can think about their work.</p>

<p>That seems worth building.</p>

<hr />

<p><em>To learn more about how Terno AI approaches enterprise analytics, visit the
<a href="/terno-ai">Terno AI page</a>. For the technical thinking behind secure, reliable
AI analytics, read my next essay on why AI must generate code rather than guessing answers.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Building Terno AI" /><category term="terno-ai" /><category term="enterprise-ai" /><category term="data-science" /><category term="analytics" /><category term="product" /><summary type="html"><![CDATA[Every enterprise has data. Very few have the people, time and tools to ask real questions of it. I am building Terno AI because I believe the right solution is not more dashboards — it is an AI that can actually perform analysis.]]></summary></entry><entry><title type="html">AI Can Do a Lot. But Can It Think Beyond Common Sense?</title><link href="https://girisandeep.com/2025/10/05/ai-beyond-common-sense/" rel="alternate" type="text/html" title="AI Can Do a Lot. But Can It Think Beyond Common Sense?" /><published>2025-10-05T00:00:00+00:00</published><updated>2025-10-05T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/05/ai-beyond-common-sense</id><content type="html" xml:base="https://girisandeep.com/2025/10/05/ai-beyond-common-sense/"><![CDATA[<p>I want to begin with a thought experiment.</p>

<p>Imagine training a language model on all the text produced in England in the year 1800.
The model learns language, facts, customs, arguments, newspapers, laws, philosophy and
literature. It becomes very good at generating text that sounds like 1800.</p>

<p>Now ask it: what do you think about slavery?</p>

<p>The model will likely produce something that reflects the dominant views of the period.
Because those views — repugnant to us now — were common sense in 1800. They were woven
through the legal system, the economy, the literature, the science, the church sermons
and the political speeches. They were what people said and wrote and assumed.</p>

<p>The people who argued against slavery in that era were, by definition, arguing against
common sense. They were not extrapolating from dominant patterns. They were imagining
something that had not yet existed.</p>

<h2 id="what-language-models-are-good-at">What Language Models Are Good At</h2>

<p>I do not want to minimise what language models can do. It is extraordinary.</p>

<p>They can write code, summarise research, answer questions across a remarkable range of
domains, reason through problems, explain complex ideas clearly and translate between
languages with impressive accuracy. They have absorbed an enormous amount of human
knowledge and can deploy it flexibly.</p>

<p>This is genuinely useful. In my own work building Terno AI and teaching at CloudxLab,
I see daily how much AI can accelerate work that previously required significant time
and expertise.</p>

<p>But what a language model is doing, fundamentally, is pattern completion. It has learned
an extraordinarily rich and nuanced model of what human expression looks like — what
comes after what, what ideas tend to appear together, what kind of text fits what kind
of context. It is, in a deep sense, a machine that has learned common sense from the
accumulated record of human expression.</p>

<p>That is its power. But it is also a limit.</p>

<h2 id="the-ideas-that-changed-everything-were-not-common-sense">The Ideas That Changed Everything Were Not Common Sense</h2>

<p>Let me give a few examples.</p>

<p><strong>Gandhi’s ahimsa.</strong> Non-violent resistance as a political strategy was not an obvious
extrapolation from the dominant models of political conflict in the early twentieth
century. Most political conflict — including anti-colonial resistance — assumed that
power required force. Gandhi’s insight was that there was a different kind of force.
This was not common sense. It was moral and strategic imagination that went against
almost everything the existing evidence suggested.</p>

<p><strong>The abolition of slavery.</strong> The argument that people could not be owned as property
ran directly against centuries of law, custom, religion, economics and received
wisdom. The people who made this argument were not slightly adjusting the existing
consensus. They were insisting on something that the world had not yet accepted.</p>

<p><strong>The germ theory of disease.</strong> When Semmelweis argued that doctors were transmitting
illness by not washing their hands, he was rejected by the medical establishment. The
idea that invisible organisms caused disease contradicted what was considered obvious
and was professionally dangerous to assert.</p>

<p>These were not insights that could have been generated by averaging existing knowledge.
They required someone to step outside the prevailing pattern and see something that
the pattern obscured.</p>

<h2 id="ai-and-the-amplification-of-what-already-is">AI and the Amplification of What Already Is</h2>

<p>There is a specific risk that concerns me about AI systems that are primarily trained
on what humans have already said and written.</p>

<p>Such systems are very good at reinforcing existing patterns. They are good at producing
things that fit within the space of what has already been done. They are, by design,
trained to be coherent with their training data.</p>

<p>This makes them invaluable for tasks where the goal is to produce something that fits
a known pattern: code that follows conventions, text that sounds professional, summaries
that capture the main points.</p>

<p>But if we ask them to help us think about questions where the right answer requires
going beyond the existing pattern — questions about justice, about the structure of
society, about what human flourishing could look like — we should be careful about
taking their outputs as authoritative.</p>

<p>The AI trained on dominant patterns will tend to produce dominant-pattern answers.</p>

<h2 id="what-this-means-for-human-beings">What This Means for Human Beings</h2>

<p>I do not think this is an argument against AI. It is an argument about how to use it.</p>

<p>The extraordinary capability of AI systems to handle patterns, to process information,
to generate and refine text — all of this creates space for human beings to do
something different. To do the things that pattern completion cannot do.</p>

<p>What are those things?</p>

<p><strong>Questioning the assumptions that hold patterns in place.</strong> The person who says: wait,
why do we assume that? Why does this seem obvious? What would the world look like if
this were different?</p>

<p><strong>Imagining what has not yet existed.</strong> Not extrapolating from data, but reaching for
something that has not yet been instantiated — in technology, in art, in social
organisation, in science.</p>

<p><strong>Making moral judgements that go beyond what consensus permits.</strong> The recognition that
something currently accepted is wrong — not because the data says so, but because
something deeper says so.</p>

<p>These are not small things. They are perhaps the most distinctively human things.</p>

<p>And here is the interesting possibility: as AI takes over more and more of the work of
pattern application — of doing what has already been done, of producing what fits
existing templates — perhaps it frees more human capacity for the harder and stranger
work of imagining what could be different.</p>

<h2 id="the-question-i-keep-returning-to">The Question I Keep Returning To</h2>

<p>I do not know whether AI systems will eventually be able to do this harder work.
Perhaps sufficiently powerful systems, trained on sufficiently diverse data, will
develop some capacity for genuine novelty.</p>

<p>But even if they can, the question I want to keep asking is: what should <em>we</em> be doing?</p>

<p>What is the version of human intellectual and creative life that is called forth by a
world where the routine work of pattern application has been automated?</p>

<p>I think the answer involves taking more seriously — not less — the capacity to question,
to imagine, to dissent, to dream.</p>

<p>AI can help us with what exists. We must remain responsible for what does not yet exist
but should.</p>

<hr />

<p><em>This essay is part of a series on AI and human thinking. If these ideas interest you,
you might also enjoy my writing on <a href="/learning-by-inventing">Learning by Inventing</a> —
a related question about how discovery, rather than instruction, creates original thinkers.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="AI and Human Thinking" /><category term="artificial-intelligence" /><category term="creativity" /><category term="originality" /><category term="society" /><category term="thinking" /><summary type="html"><![CDATA[Language models are extraordinarily good at learning patterns from what has already existed. That is both their power and their limit. The most important ideas in human history were not obvious extrapolations. So what should human beings do in a world where common sense becomes automated?]]></summary></entry><entry><title type="html">Learning by Inventing: The Most Powerful Teaching Discovery I Have Made</title><link href="https://girisandeep.com/2025/10/01/learning-by-inventing-teaching-discovery/" rel="alternate" type="text/html" title="Learning by Inventing: The Most Powerful Teaching Discovery I Have Made" /><published>2025-10-01T00:00:00+00:00</published><updated>2025-10-01T00:00:00+00:00</updated><id>https://girisandeep.com/2025/10/01/learning-by-inventing-teaching-discovery</id><content type="html" xml:base="https://girisandeep.com/2025/10/01/learning-by-inventing-teaching-discovery/"><![CDATA[<p>There is a moment in teaching that I have come to treasure above all others.</p>

<p>It is not the moment when a learner correctly recalls a formula. It is not the moment
when someone scores well on a test. It is the moment when a learner looks up from their
work with a slightly surprised expression and says: <em>I think I see it.</em></p>

<p>That pause. That look. That is what I am always trying to create.</p>

<h2 id="the-problem-with-how-we-usually-teach">The Problem with How We Usually Teach</h2>

<p>Most education begins at the wrong end.</p>

<p>A student opens a textbook and finds: <em>The Pythagorean theorem states that a² + b² = c².</em>
An explanation follows. Some worked examples. Then practice problems.</p>

<p>This approach is efficient. In forty minutes, you can deliver a concept to thirty people.
But something important is missing: the experience of discovery.</p>

<p>When a formula is handed to you, you receive it as a package you must store and retrieve.
You may understand it intellectually. But you do not know it the way a geologist knows rock —
through touch, through repeated encounter, through being surprised by it in the field.</p>

<p>More importantly: when you receive a pre-formed answer, you are implicitly told something
about yourself. You are told that knowledge comes from outside you. You are positioned as
a recipient. And after years of this experience, many people come to believe a genuinely
harmful thing: that they are simply not the kind of person who understands mathematics,
or physics, or algorithms.</p>

<p>I have seen this belief in adult learners over and over again. Intelligent, capable people
who are certain, before they begin, that the material will be beyond them.</p>

<h2 id="a-different-starting-point">A Different Starting Point</h2>

<p>What happens if we begin differently?</p>

<p>Instead of stating the Pythagorean theorem, give a learner a piece of squared paper. Ask
them to draw a right triangle. Ask them to draw a square on each side. Ask them to count
the squares inside each shape.</p>

<p>They do this for a triangle with sides of 3, 4 and 5. They count 9, 16 and 25.</p>

<p>Ask them: do you notice anything?</p>

<p>Some will not see it immediately. That is fine. Give them another triangle — 5, 12 and 13.
They count 25, 144 and 169. Ask again.</p>

<p>Something happens. A hesitant observation: <em>the big one always seems to equal the other
two together?</em></p>

<p>Yes. Precisely. Now they have made a discovery.</p>

<p>Their relationship to this idea is completely different from someone who read it in a
textbook. They found it. It is theirs.</p>

<h2 id="what-discovery-does-that-instruction-cannot">What Discovery Does That Instruction Cannot</h2>

<p>Discovery creates several things that instruction alone cannot reliably produce.</p>

<p><strong>Understanding of the why.</strong> When you discover a pattern, you immediately want to know
why it is true. Your curiosity is already pointed in the right direction. An explanation
at this moment lands completely differently from an explanation that precedes the observation.</p>

<p><strong>Memory.</strong> Things we discover are remembered differently from things we are told. The
moment of surprise, the sequence of problems, the sensation of recognition — these are
emotionally and cognitively vivid in a way that passive reception rarely is.</p>

<p><strong>Confidence.</strong> This is the most important one. When a learner discovers something, even
something small, they experience their own mind working. They feel what it is like to
figure something out. This is radically different from being told something correct.</p>

<p>There is a story I return to often. A learner who had spent years believing she was
simply not good at mathematics sent me a message after one of my courses. She said she
had gained enough confidence in her own thinking that she had started teaching
mathematics to her young niece.</p>

<p>She was not teaching because she had memorised more facts. She was teaching because she
had learned to trust her own mind.</p>

<h2 id="the-design-challenge">The Design Challenge</h2>

<p>Learning by Inventing is not simply a matter of attitude or intention. It requires
careful design.</p>

<p>You cannot just present a problem and hope the learner discovers the right thing.
The sequence matters enormously. Each problem must be small enough to be approachable
but designed to point attention in exactly the right direction. The gap between steps
must be wide enough to require genuine thought but narrow enough to be crossable.</p>

<p>This is hard work. Designing a good discovery sequence for, say, gradient descent in
machine learning takes more thought than writing a clear lecture. You have to deeply
understand the concept yourself — not just its final form, but how a mind might move
toward it.</p>

<p>I think of it as the difference between building a path and simply standing at the
destination. Any teacher can stand at the destination and describe what they see. Far
fewer can build a path that leads someone there while feeling like they are exploring
freely.</p>

<h2 id="machine-learning-through-discovery">Machine Learning Through Discovery</h2>

<p>When I teach machine learning, I do not begin with neural networks or backpropagation.</p>

<p>I begin with a simple prediction problem. I ask learners to guess, by hand, some numbers
that are unknown but clearly related to numbers they can see. I ask them to try to
improve their guesses. I ask them what they would change if they were wrong.</p>

<p>Through this process, learners begin to invent the core ideas of machine learning — not
because I have told them what to invent, but because those ideas are the natural response
to the problems I have set. They discover that iterating toward a better answer is more
powerful than trying to get it right the first time. They discover that measuring error
is the key to improvement.</p>

<p>When we eventually name these ideas — loss function, gradient, parameter update — the
names feel like labels for something the learner already understands, rather than terms
they must memorise.</p>

<h2 id="what-this-means-for-the-ai-teacher">What This Means for the AI Teacher</h2>

<p>I have spent some time thinking about what an AI teacher based on this philosophy would
look like.</p>

<p>Not an AI that answers questions — there are plenty of those. An AI that asks the right
question at the right moment. One that can assess where a learner is and design the next
small step accordingly. One that knows when to be silent and let the learner struggle,
and when to offer a carefully chosen nudge.</p>

<p>This is a harder problem than building a question-answering system. But I believe it
is one of the most important things we could build with AI.</p>

<p>Because the goal is not a learner who knows more. The goal is a learner who believes in
their own capacity to discover.</p>

<hr />

<p><em>If you are an educator, a learner or a builder interested in this philosophy, I would be
glad to exchange ideas. You can find more of my thinking on education at the
<a href="/learning-by-inventing">Learning by Inventing</a> section of this site.</em></p>]]></content><author><name>Sandeep Giri</name></author><category term="Learning by Inventing" /><category term="education" /><category term="teaching" /><category term="discovery" /><category term="mathematics" /><category term="learning" /><summary type="html"><![CDATA[Traditional education begins with the answer. I believe it should begin with the problem. Here is why guiding learners toward discovery creates something that no lecture can — and what happened when I started teaching this way.]]></summary></entry></feed>