top of page

He Saw What Karpathy Missed and Built It in a Weekend

Jul 14
4 min read

Updated: Aug 14

Written by: Julia Steiner

After Andrej Karpathy sketched a vision for AI memory, Safi Shamsi recognized a different opportunity. His open-source tool replaced embeddings with knowledge graphs for code and is now becoming part of the infrastructure behind AI coding assistants.


Smiling man in glasses and black T-shirt sits with arms crossed by a window, with city skyscrapers in the background.

It was Easter break, and Safi Shamsi was home in London, part way through a book. The one he was writing. The Memory Layer circles a problem he had chased for two years. How to give an AI a durable, trustworthy memory using knowledge graphs, the structured webs of facts and relationships computer science has leaned on for decades. Then, on the third of April, Andrej Karpathy posted. Karpathy, a founding member of OpenAI and Tesla’s former AI director, thinks out loud in a way the whole industry reads, and what he was turning over that week landed on the page Shamsi had open. Karpathy described using large language models to build personal knowledge bases, “manipulating knowledge stored as markdown and images” instead of endlessly manipulating code.


Shamsi, a knowledge-graph researcher by training, saw something in it Karpathy had not spelled out. Karpathy wanted a personal wiki. Shamsi saw a way to cut the tokens an assistant burns every time it re-reads a codebase, and he aimed the same idea at code rather than notes. Work was closed for four days. He shipped it in two. He already knew the architecture, since the thesis he had just finished rested on the same idea, so the weekend ran on reflex rather than invention. “Notes are what one person knows,” he says. “A codebase is what a whole team knows, and the teams were the ones drowning.”


He works like a researcher rather than a founder. He had read the knowledge-graph literature for two years before the weekend that made his name, and he still opens the same laptop first thing in the morning and closes it last thing at night. He says he does not take days off. Ask him which design choice he is proudest of and he does not hesitate. “I’d draw the knowledge graph of the whole codebase,” he says. “I’m a knowledge-graph researcher. That’s the part I love.”


The design turns on a choice most of his peers would have made the other way. The fashionable route to AI memory runs through embeddings, which turn text into long lists of numbers and fetch whatever sits closest in meaning. Shamsi refused them. Graphify uses no embeddings and no vector database. It reads code the way a compiler does, parsing the syntax tree with an open library called Tree-sitter and lifting the relationships already sitting there, across 36 languages, entirely offline. “A codebase is deterministic,” he says. “It’s almost like the alphabet. You know what connects to what, so you don’t need an LLM or embeddings to see it. The syntax tree gives it to you for free.”


That is what let it spread. Because it never calls a language model to read code, Graphify costs nothing to run and keeps a company’s source on its own machines. The best-known design in the space, Microsoft’s GraphRAG, builds its graphs through many expensive model calls and rebuilds much of the structure to add a single document. Shamsi cut the assumption underneath it, that pulling out the structure requires a model to understand it first. The syntax tree already holds the relationships. The trick is keeping them instead of throwing them away. A git hook rebuilds the map on every commit as the code changes, still without a single model call.


Every relationship in the graph carries a tag showing where it came from: extracted for a fact read straight out of the code, inferred for one Graphify resolved on its own. A developer can see at a glance which claims the tool stands behind and which it worked out for itself, without reading the code that produced either. It is the kind of detail a spec sheet buries, and it gives the tool away as the work of someone who has watched AI be confidently wrong. What a syntax tree cannot see, the behavior that surfaces only while a program runs, is the gap he wants to close next, with a formal verification layer for the enterprise version.


He also ships the test, not just the score. Graphify comes with a benchmark anyone can rerun. On a trial of memory across long conversations, its retrieval recall outruns the widely used mem0 by roughly ten to one. On the harder end-to-end task it still trails supermemory, a rival with a year’s head start, and Shamsi volunteers the loss before anyone asks. “We beat mem0. We lagged a little behind supermemory, and I knew we would,” he says. “It’s beatable.” The numbers are his own, run in-house, but Augment Code, a company that makes its own AI coding tools, published them, and the commands to reproduce them sit in the repository.


It moved faster than he expected. He posted about it on X, a few developer influencers amplified it, and within two or three days Graphify had cleared 10,000 stars. A mentor of his, a veteran engineer at the Indian IT firm Wipro who had guided him for years, told him it was a major breakthrough and to put up a waitlist and see who turned up. People did, by the thousands.


The idea was in the air by then. Two weeks after Karpathy’s post, Elon Musk, replying to a thread about the knowledge-graph approach, told his followers, “I super agree with Karpathy.” Shamsi could not help himself. “How about you agree with the creator of that product, Elon? Haha,” he replied. He had built the thing the field was asking for, and he had built it to admit what it does not know.

 
 

This article is published in collaboration with Brainz Magazine’s network of global experts, carefully selected to share real, valuable insights.

Article Image

The Side of Joy No One Talks About

Why joy can’t exist without contrast, and how embracing life’s full emotional range makes happiness more meaningful and lasting. Do you truly know what joy is? For a long time, I wasn’t sure I did...

Article Image

What If Your Child Chose You?

We spend so much time thinking about what we will teach our children. We imagine the values we will pass on, the opportunities we will offer, and the love that will help them feel safe in the world...

Article Image

When Your Values No Longer Fit and What Misalignment Can Reveal

Values alignment at work is easy to talk about when things are going well. It becomes much more revealing when what matters to you begins to conflict with what you experience around you. In this...

Article Image

Staying One Step Ahead of AI

I asked a student this while coaching him through a research paper. Like many students, he had taken key points straight from AI without questioning them. My question stopped him and prompted a...

Article Image

The Loneliness of Being Easy to Love

You are sitting opposite someone who genuinely cares about you. They ask how you are. You say you're good. You listen to their stories, laugh at the right moments, offer reassurance, make space for whatever...

Article Image

Why Wait Until Forty to Heal What We Could Prevent and the Case for Emotional Immunity in Childhood

Almost every therapy session, a familiar scene plays out. A high-achieving woman in her forties sits across from me. She has a respected career, a beautiful home, and every external marker of...

The Side of Joy No One Talks About

What If Your Child Chose You?

When Your Values No Longer Fit and What Misalignment Can Reveal

Staying One Step Ahead of AI

The Loneliness of Being Easy to Love

Why Wait Until Forty to Heal What We Could Prevent and the Case for Emotional Immunity in Childhood

How Chasing Rejection Could Change Your Life

How to Use Medical Qi Gong for Healing

Why I Don’t Want My Sound Bath Students to Sound Like Me

bottom of page