DEV Community

Cover image for Semantic Memory: How AI Builds Knowledge About You
Rijul Rajesh
Rijul Rajesh

Posted on

Semantic Memory: How AI Builds Knowledge About You

Hello, I'm Rijul. I'm building git-lrc, a micro AI code reviewer that runs on every commit. It's free and source-available on GitHub. Star git-lrc to help more developers discover the project. Do give it a try and share your feedback

When building personal AI systems, one of the most important types of memory to understand is semantic memory.

In simple terms, semantic memory is a structured store of knowledge such as:

  • Facts
  • Concepts
  • Preferences
  • Relationships

It is the part of an AI memory system that helps answer:

"What do I know about this person, project, company, or concept?"


Episodic Memory vs Semantic Memory

Let's say the following conversation happens:

User: I usually use React and TypeScript for frontend projects.

AI: Got it.
Enter fullscreen mode Exit fullscreen mode

This single conversation can be stored in two very different ways.


Episodic Memory

Episodic memory stores the event itself.

On July 21, 2026, the user said:

"I usually use React and TypeScript for frontend projects."
Enter fullscreen mode Exit fullscreen mode

The system remembers:

What happened, when it happened, and what was said.

This is similar to remembering an experience.


Semantic Memory

Semantic memory extracts the knowledge from that conversation.

User
├── frontend_framework → React
└── primary_language → TypeScript
Enter fullscreen mode Exit fullscreen mode

The system no longer needs to remember the original conversation to understand the underlying information.

It has converted the conversation into structured knowledge.

This is the key difference:

Episodic memory remembers the event.

Semantic memory remembers what was learned from the event.


Semantic Memory as a Knowledge Layer

You can think of semantic memory as a knowledge layer for an AI system.

For example, an AI assistant might maintain a structured representation of a user like this:

User
├── prefers → React
├── uses → TypeScript
├── prefers → Linux
├── works_on → E-commerce platform
├── interested_in → AI agents
└── prefers → concise technical explanations
Enter fullscreen mode Exit fullscreen mode

This is semantic memory.

The information is no longer stored as a conversation.

Instead, it is stored as knowledge about entities and the relationships between them.


What Are Entities?

An entity is something that the AI system knows about.

Examples include:

  • User
  • Customer
  • Company
  • Product
  • Project
  • Document
  • Location
  • Organization

For example:

User ──works_on──> E-commerce platform
Enter fullscreen mode Exit fullscreen mode

Here:

  • User is an entity
  • E-commerce platform is an entity
  • works_on is the relationship between them

This structure allows an AI system to reason about information instead of simply searching through old conversations.


Why Does This Matter?

Imagine an AI assistant that has stored hundreds of conversations with you.

If it only has episodic memory, it may need to search through those conversations every time it wants to answer a question about your preferences or projects.

With semantic memory, it can directly access structured knowledge such as:

User
├── uses → React
├── uses → TypeScript
├── works_on → E-commerce platform
└── interested_in → AI agents
Enter fullscreen mode Exit fullscreen mode

The assistant does not need to reread every conversation to discover these facts.

The knowledge has already been extracted and organized.

That is what makes semantic memory such an important part of personal AI systems.


AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.

git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.

Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.

Give it a ⭐ star on Github

Top comments (0)