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

10 Ways to 5X Your Business by the End of 2026

You don’t need to become less human to become more successful. You need to become better at being human because your business can only expand to the degree that you can hold the...

Article Image

There's Nothing Wrong With You, You've Just Been Stuck in Survival Mode

You've done the work. You've gone to therapy, read the books, followed the frameworks, and still, self-sabotage shows up right when you're closest to the goal: the video you don't post, the book you...

Article Image

Who Am I When I’m No Longer Needed in the Same Way?

A month ago, my husband and I travelled to spend time with our adult children. Like many parents, I had quietly imagined what those few days would look like. Long conversations. Family bonding.

Article Image

The Three T’s of Relationships and How to Audit Your Inner Circle and Protect Your Peace

Many relationships collapse under the weight of a beautiful yet deeply misunderstood ideal: unconditional love. We are often conditioned to believe that true devotion means staying "no matter what."

Article Image

Five Ways Your Brain Can Learn Something New

When I was diagnosed with autoimmune disease at seventeen, nobody spoke to me about my brain. They spoke about my eyes, my immune system, and medication. They explained that my body was attacking itself...

Article Image

Why Your Business Stalls When You Work Harder

You have followed the plan and made the right moves, perhaps hiring more staff, adding a marketing channel, or implementing a new system that promised to save you time. Initially, these changes seemed effective.

5 Reasons the Teen Years Are the Greatest Opportunity Your Child Has to Shape Who They Become

10 Evidence-Based Nutritional Supports for Women

Why Kobido is the Future of Natural Facial Rejuvenation

What Happens When These 4 Pressures Take Command

The Difference Between Rest and Retreat

11 Ways the Performing Arts Build Confidence and Practical Life Skills in Young People

The Practice of Returning and Why Yoga and Meditation Are More Than Wellness

Why One Diet Doesn't Work for Everyone

You Are Functioning, But Are You Actually Okay?

bottom of page