The post has been translated automatically. Original language: Russian
Hi, my name is Armand, and I'm building CortexDB, a contextual database built from scratch specifically for autonomous AI agents.
Over the past six months, while I was developing agents for government agencies and medical systems, I realized one important thing: modern databases are fundamentally not designed for how AI agents work.
The problem: all databases are "table + bolts"
Currently, almost all agent memory solutions are based on the same principle:
- We take the usual database (Postgres, Mongo, vector database)
- Adding BM25, embeddings, dense ANN, graphs on top
- And we hope that this will be enough.
It turns out to be a flat structure with suspended extensions. The agent can find a "similar" text, but cannot:
- To understand whether a new fact contradicts the old ones
- Get a guaranteed verified and quoted context
- Work within strict access rights and a token budget
- Get an explanation of why this particular data was selected
This is still tolerable in regular chatbots. But in medicine, public administration or finance, this is already a risk.
How the idea of CortexDB was born
I was inspired by the story of Redis creation. At one time, Redis appeared not because there were no databases, but because the existing ones were too heavy and suboptimal for certain tasks.
The same thing is happening now with AI agents.
I needed a base that:
- Understands how the agent thinks
- Provides a structured, verified, and token-efficient context.
- It has built-in trust and security mechanisms.
That's how CortexDB was born.
What is CortexDB?
CortexDB is an agent-native contextual database. It doesn't just store data. It prepares the context specifically for the agent's decision-making.
Key Features:
1. ContextPack instead of raw search Instead of giving the agent 50,000 text tokens, CortexDB returns a ContextPack — a neatly packaged, verified context package with:
- Quotes and sources
- Assessment of relevance and explanation of choice
- A report on anomalies and contradictions
- Strict control of the token budget
2. VERIFY FACT — deterministic fact checking This is one of the most important things. The agent may ask: "VERIFY FACT: the budget of the Solar Plant project is 1.2 billion tenge"
And get an honest answer: supporting facts, contradicting facts, degree of confidence. No hallucinations. Only checking against existing data.
3. AQL — Agent Query Language We have our own query language tailored to the needs of agents.:
RETRIEVE CONTEXT FOR TASK "budget analysis"
IN BRAIN default
LIMIT 8 CANDIDATES
WITH TOKEN_BUDGET 3500;4. Rigid security model Each agent works in its own AgentView. There are access policies, scopes, and a bitmap machine that ensures that an agent will never receive data to which he has no rights. This is critical for government agencies and medicine.
5. Reliable storage Under the hood — WAL, MVCC MemTable, incremental checkpoints. This is not just an in-memory cache, but a real durable database.
Comparison with popular solutions
| Criteria | CortexDB | Mem0 | Zep |
| The basic approach | Native contextual database | Memory Layer (vector+graph) | Temporal Knowledge Graph |
| Verification of facts | Deterministic | Via LLM | Partial |
| Token Control | Hard + Explanation | Good | Average |
| The rights model | AgentView + policies | User/Session levels | Attribute-based |
| Suitable for government/medicine | Yes (initially) | Difficult | Partly |
| Stage (May 2026) | Core Alpha | Production | Production |
Who needs it for
CortexDB is especially useful where the cost of error is high.:
- Government systems — agents working with sensitive data
- Medicine — clinical assistants who should be as accurate and explicable as possible
- Finance and compliance — where audit traceability is important
- Complex multi—agent systems - where different agents have different access levels
Current status (May 2026)
The project is in the Core Alpha stage. Already implemented:
- Full-fledged AQL and Bitmap VM
- WAL + MVCC
- HTTP API + CLI + SDK (Rust, Python, TypeScript)
- 230+ tests
- Examples with real datasets (including conflicting facts)
The project is completely open-source under the Apache 2.0 license.
The repository: github.com/AubakirovArman/CortexDB
What's next
In the coming months, we plan to:
- Improving HNSW and adding recall guarantees
- Primitives for replication
- A more powerful layer of fact verification
- Integration with popular agent frameworks
Conclusion
I'm not trying to make "another Mem0" or "another vector base". I am building a trust infrastructure for the next generation of AI agents - those who can be trusted with important decisions.
If you also think that current approaches to agent memory are insufficient, and you want to build truly reliable systems, I will be glad to receive feedback, ideas, and contributions.
GitHub: AubakirovArman/CortexDB
The cart: https://t.me/arman_aubakirov
Привет, меня зовут Арман, и я строю CortexDB — контекстную базу данных, созданную с нуля специально для автономных AI-агентов.
За последние полгода, пока я разрабатывал агентов для государственных структур и медицинских систем, я понял одну важную вещь: современные базы данных fundamentally не созданы для того, как работают AI-агенты.
Проблема: все базы данных — это «таблица + болты»
Сейчас почти все решения для памяти агентов построены по одному принципу:
- Берём обычную базу (Postgres, Mongo, векторную БД)
- Добавляем сверху BM25, embeddings, dense ANN, графы
- И надеемся, что этого хватит
Получается плоская структура с навешенными расширениями. Агент может найти «похожий» текст, но не может:
- Понять, противоречит ли новый факт старым
- Получить гарантированно проверенный и цитируемый контекст
- Работать в рамках строгих прав доступа и токен-бюджета
- Получить объяснение, почему именно эти данные были выбраны
В обычных чат-ботах это ещё терпимо. А вот в медицине, госуправлении или финансах — это уже риск.
Как родилась идея CortexDB
Я вдохновлялся историей создания Redis. В своё время Redis появился не потому, что не было баз данных, а потому что существующие были слишком тяжёлыми и неоптимальными для определённых задач.
То же самое происходит сейчас с AI-агентами.
Мне нужна была база, которая:
- Понимает, как думает агент
- Даёт структурированный, проверенный и токен-эффективный контекст
- Имеет встроенные механизмы доверия и безопасности
Так родился CortexDB.
Что такое CortexDB
CortexDB — это agent-native контекстная база данных. Она не просто хранит данные. Она готовит контекст специально для принятия решений агентом.
Ключевые особенности:
1. ContextPack вместо сырого поиска Вместо того чтобы отдавать агенту 50 тысяч токенов текста, CortexDB возвращает ContextPack — аккуратно упакованный, проверенный пакет контекста с:
- Цитатами и источниками
- Оценкой релевантности и объяснением выбора
- Отчётом об аномалиях и противоречиях
- Жёстким контролем токен-бюджета
2. VERIFY FACT — детерминированная проверка фактов Это одна из самых важных фиш. Агент может спросить: «VERIFY FACT: бюджет проекта Solar Plant составляет 1.2 млрд тенге»
И получить честный ответ: поддерживающие факты, противоречащие факты, степень уверенности. Никаких галлюцинаций. Только проверка по существующим данным.
3. AQL — Agent Query Language У нас свой язык запросов, заточенный под нужды агентов:
RETRIEVE CONTEXT FOR TASK "анализ бюджета"
IN BRAIN default
LIMIT 8 CANDIDATES
WITH TOKEN_BUDGET 3500;4. Жёсткая модель безопасности Каждый агент работает в своём AgentView. Есть политики доступа, скоупы и bitmap-машина, которая гарантирует, что агент никогда не получит данные, на которые у него нет прав. Это критично для госструктур и медицины.
5. Надёжное хранение Под капотом — WAL, MVCC MemTable, инкрементальные чекпоинты. Это не просто in-memory кэш, а настоящая durable база.
Сравнение с популярными решениями
| Критерий | CortexDB | Mem0 | Zep |
| Основной подход | Нативная контекстная БД | Memory Layer (вектор+граф) | Temporal Knowledge Graph |
| Верификация фактов | Детерминированная | Через LLM | Частичная |
| Контроль токенов | Жёсткий + объяснение | Хороший | Средний |
| Модель прав | AgentView + политики | User/Session уровни | Attribute-based |
| Подходит для гос/медицины | Да (изначально) | Сложно | Частично |
| Стадия (май 2026) | Core Alpha | Production | Production |
Для кого это нужно
CortexDB особенно полезна там, где цена ошибки высока:
- Государственные системы — агенты, работающие с чувствительными данными
- Медицина — клинические ассистенты, которые должны быть максимально точными и объяснимыми
- Финансы и compliance — где важна аудиторская трассируемость
- Сложные многоагентные системы — где разные агенты имеют разные уровни доступа
Текущее состояние (май 2026)
Проект находится в стадии Core Alpha. Уже реализовано:
- Полноценный AQL и Bitmap VM
- WAL + MVCC
- HTTP API + CLI + SDK (Rust, Python, TypeScript)
- 230+ тестов
- Примеры с реальными датасетами (включая конфликтующие факты)
Проект полностью open-source под лицензией Apache 2.0.
Репозиторий: github.com/AubakirovArman/CortexDB
Что дальше
В ближайшие месяцы планируем:
- Улучшение HNSW и добавление recall-гарантий
- Примитивы для репликации
- Более мощный слой фактоверификации
- Интеграции с популярными фреймворками агентов
Заключение
Я не пытаюсь сделать «ещё один Mem0» или «ещё одну векторную базу». Я строю инфраструктуру доверия для следующего поколения AI-агентов — тех, которым можно доверить важные решения.
Если вы тоже считаете, что текущие подходы к памяти агентов недостаточны, и хотите строить по-настоящему надёжные системы — буду рад обратной связи, идеям и контрибьюшену.
GitHub: AubakirovArman/CortexDB
Телега: https://t.me/arman_aubakirov