GBrain: The Open-Source Memory System for AI Agents
GitHub RepoImpressions198
View on GitHub
@githubprojectsPost Author
# GBrain: Open Source Memory That Actually Sticks for AI Agents

You know how AI agents are great at one-off tasks but completely forget everything the moment you start a new conversation? Yeah, that’s annoying. Most agents today operate like goldfish. They answer a query, then next time you talk, they act like you’ve never met.

Enter **GBrain**, an open source memory system designed specifically for AI agents. No more wrappers hacking together database calls with vector embeddings. This is a purpose built memory layer that lets your agents remember context, user preferences, and even long term conversation history without you reinventing the wheel.

---

## What It Does

GBrain gives your AI agents persistent memory. Think of it as a lightweight, embeddable memory store that sits between your agent and the user. It stores what the agent has learned about a user across sessions, and it retrieves the right memories when needed.

Under the hood, it uses vector embeddings to understand similarity between past conversations and new queries. But you don’t need to mess with embeddings yourself. The API is simple: store memories, query them, and watch your agent stop sounding like it has amnesia.

---

## Why It’s Cool

This isn’t just another vector database wrapper. Here’s what stands out:

- **Agent first design.** Most memory systems are built for search or analytics. GBrain is built for the loop where an agent needs to recall and act immediately.
- **No cloud dependency.** You run it locally or on your own infra. Full control, no API bills.
- **Simple API.** Two main operations: `store(memory)` and `query(prompt)`. That’s it. You don’t need to tune vector dimensions or manage indexes.
- **Open source.** MIT licensed. You can fork it, hack it, or deploy it in production without worry.

If you’re building a personal assistant, a customer support bot, or any agent that needs to “know” the user over time, this solves a real pain point. No more session resets.

---

## How to Try It

Get started in under a minute.

**Clone the repo:**

```bash
git clone https://github.com/garrytan/gbrain.git
cd gbrain

Install dependencies:

pip install -r requirements.txt

Run a quick test:

from gbrain import Memory

mem = Memory()
mem.store("User likes coffee with oat milk")
result = mem.query("What does the user like to drink?")
print(result)  # "User likes coffee with oat milk"

That’s it. There's also a demo script in the repo to see it in action.


Final Thoughts

Memory is the missing piece for most agentic workflows. Without it, every conversation starts from zero. GBrain gives you a dead simple way to fix that. It’s not a polished product with a dashboard, but it is exactly the kind of tool you can drop into a project and start using right away.

If you’re tired of your agents being forgetful, give it a spin. Fork it, break it, make it your own.


Follow @githubprojects for more open source projects like this.

Back to Projects
Last updated: May 1, 2026 at 05:38 AM