
MeshOS
Building a memory & knowledge engine for multi-agent systems - A case study in structured AI memory

When I started building autonomous AI agents, I quickly ran into a fundamental problem: memory. While vector stores excel at similarity search, they fall short of what’s needed for true multi-agent intelligence. We need more than just finding similar content - we need rich data ontologies, relationship tracking, and structured knowledge evolution that enables agents to work together harmoniously.
The Challenge
Current solutions like vector databases are great at answering “what’s similar to X?” but struggle with more complex needs. They treat memory as disconnected embeddings or unstructured text, missing critical context about how pieces of knowledge relate and evolve. This becomes especially problematic in multi-agent systems where coordination is essential.
For agents to work together effectively, they need to understand how their knowledge relates to other agents’ knowledge and track how shared information evolves over time. They must maintain consistent mental models and coordinate their actions based on a shared understanding of the world. Vector similarity alone can’t capture these rich relationships and dependencies. Without a proper ontology and knowledge structure, agents end up working with a fragmented view of their world, unable to truly build on each other’s insights.
The Solution
MeshOS emerged from these challenges as a developer-first framework that goes beyond simple vector storage to treat memory as a living, evolving graph of knowledge. At its core are three key innovations that transform how agents interact with information.
First, we built a rich data ontology that structures knowledge into distinct types - facts, beliefs, actions, and goals - each with clear schemas and inheritance patterns. This gives agents a common language for understanding different kinds of information.
Second, we implemented a relationship-first design where every memory node connects to others with semantic meaning, creating a true knowledge graph. This allows agents to understand not just individual pieces of information, but how they relate to create a broader understanding.
Third, we made the system built for evolution, with knowledge versions and updates tracked through time, maintaining history and enabling rollbacks when needed. This temporal awareness helps agents understand how knowledge and understanding change over time.
The technical foundation combines PostgreSQL with pgvector for retrieval, but adds crucial layers of sophistication. We’ve implemented a comprehensive type system for different kinds of knowledge, relationship schemas that enforce valid connections, event sourcing to track knowledge evolution, and real-time synchronization via Hasura.
Early Results
Internal testing of MeshOS has shown dramatic improvements over traditional vector-only approaches. The structured nature of the system allows agents to share and build on knowledge with clear understanding of context. They can track dependencies between different pieces of information while maintaining consistency across multiple agents. Most importantly, they can make decisions based on properly contextualized historical data.
What surprised me most was how critical the structured ontology became. When agents could understand not just what was similar, but how information related and evolved, their ability to collaborate improved dramatically. It wasn’t just about finding relevant memories - it was about understanding their place in a larger knowledge ecosystem. This holistic understanding has transformed how our agents work together, enabling them to build on each other’s knowledge in ways that weren’t possible before.
Looking Forward
I’m currently focused on enhancing the reasoning capabilities and scaling the system to handle larger knowledge graphs. But perhaps most importantly, I’m working to make it easier for other developers to build on these ideas.
I believe strongly in building in public. You can find the full source code on GitHub, and I welcome contributions from others passionate about advancing AI memory systems. For implementation details, check out our documentation.