Mirsad
Allows ChatGPT to access the shared memory hub: on individual plans it can read facts, decisions, timelines, and conflicts; on Business/Enterprise/Edu plans it can also write memories.
مِرصاد — MIRSAD
MIRSAD (مِرصاد) is a shared, living memory hub for AI agents — one local store that Claude, ChatGPT and any MCP client can all read and write. Bi-temporal facts (nothing is ever silently overwritten), decisions stored as first-class units with their reasons, evidence and outcomes, and cross-agent conflicts that only the owner resolves. It ships with a live graph view: open the local page and watch your agents' memory grow as a network while they work. Local-first · MCP-native · SQLite/D1 · no heavy infrastructure, no LLM needed in the write path.
Keywords: MCP server, AI agent memory, shared memory, temporal knowledge graph, decision log, Claude, ChatGPT, SQLite, local-first.
ذاكرة جماعية واحدة لكل مساعداتك. خادم ذاكرة مبني على رسم معرفي زمني (Temporal Knowledge Graph) يقرأ منه ويكتب فيه كل مساعداتك وأنت نفسك — عبر بروتوكول MCP نفسه — فلا يضيع قرار اتُّخذ مع مساعدٍ عن بقيّة المساعدين، ولا تُنسى أسبابه وأدلّته ونتائجه.
What is MIRSAD?
MIRSAD is an open-source shared memory server for AI agents, built on the Model Context Protocol (MCP). Instead of every assistant keeping its own private, forgetful memory, MIRSAD gives all of them one collective memory they can read and write: Claude, ChatGPT, or any MCP client.
Features
Bi-temporal facts — facts carry validity time and recording time; updates invalidate, never delete, so you can ask "what was true then?"
Decisions as first-class units — every decision is stored with its reasons, evidence, rejected alternatives, effects and outcomes, and can be traced with a single
whyquery.Cross-agent conflict queue — when one agent overwrites another's fact, the latest value wins for queries but a conflict is opened for the owner's ruling. Nothing is silently lost.
Live graph viewer — open the local page and watch the memory as a living network (entities, decisions, values, edges) while agents write; click any node to read its story.
Arabic + English name resolution — normalization and entity aliases, so a fact stored as "MIRSAD" is found when an agent searches «مِرصاد».
Zero LLM in the write path — deterministic storage on a single SQLite file; runs anywhere, even on a phone via Termux.
Quickstart
git clone https://github.com/amkkoussay/Mersad.git
cd Mersad
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
MIRSAD_DB=~/mirsad.db .venv/bin/python -m mirsad.mcp_server
# MCP endpoint: http://127.0.0.1:8765/mcp · Live graph: http://127.0.0.1:8765/Then add http://127.0.0.1:8765/mcp as a custom MCP connector in your
assistant of choice, and it shares this memory with every other client.
Related MCP server: lal
لماذا وُجد؟ (ما وجدناه في مراجعة الأنظمة الكبرى)
راجعنا Graphiti وCognee وMem0 وLetta وgraph-agent-memory وMemori (التقارير في research/). الخلاصة: لا واحد منها يخزّن «القرار وسببه ودليله ونتيجته» كوحدة أولى جاهزة، وأغلبها يحتاج LLM مدفوعًا وقاعدة رسوم منفصلة لمجرّد الكتابة، وMem0 الحالي لا يحسم التناقضات أصلًا، وLetta يترك الذاكرة لقرار النموذج. مِرصاد يأخذ أفضل أفكارهم ويصلح أضعف نقاطهم:
الفكرة | من أين | كيف في مِرصاد |
حقائق ثنائية الزمن (valid/recorded) تُبطَل ولا تُحذف | Graphiti | نفس النموذج، لكن بلا LLM في طريق الكتابة — الحسم حتمي بالكود |
التعارضات سجلّات صريحة لا دمج صامت | Cognee (FactConflict) | أيّ كتابة من وكيل فوق حقيقة نشطة لوكيل آخر تفتح تعارضًا ينتظر قرارك |
نسبة كل سجلّ لكاتبه | Mem0 |
|
مرآة Markdown قابلة للمراجعة والنسخ عبر git | Letta / Basic Memory |
|
ذاكرة الاستدلال طبقة أولى | graph-agent-memory | القرار وحدة واحدة: قرار ← أسباب ← أدلّة ← بدائل مرفوضة ← ملفات متأثرة ← نتائج، مع سلسلة استبدال (supersedes) |
والفرق العملي الأكبر: ملف SQLite واحد، صفر خدمات خارجية، صفر مفاتيح API — يعمل على أيّ جهاز، حتى هاتفك عبر Termux.
نموذج البيانات
كيانات (Entities): أشخاص، مشاريع، ملفات، مفاهيم.
حقائق (Facts): (كيان، علاقة، قيمة) مع أربعة أزمنة: متى صحّت في العالم، متى توقّفت، متى سُجّلت، متى أُبطلت — فيمكن السؤال: «ما الصحيح الآن؟» و«ما الذي كان صحيحًا وقتها؟».
قرارات (Decisions): الوحدة الكاملة أعلاه، بحالات proposed/accepted/rejected/superseded.
حلقات (Episodes): النصّ الخام المصدر لكل سجلّ — لا يُحذف أبدًا (الأصل/Provenance).
تعارضات (Conflicts): خلافات بين الوكلاء تنتظر حكمك، وحكمك نفسه يُحفظ.
التشغيل
cd shared-memory-hub
python3 -m venv .venv && .venv/bin/pip install "mcp[cli]<2"
# خادم MCP عبر HTTP (للموصّلات) — المنفذ 8765 افتراضيًا
MIRSAD_DB=~/mirsad.db .venv/bin/python -m mirsad.mcp_server
# أو عبر سطر الأوامر
.venv/bin/python -m mirsad.cli --db ~/mirsad.db fact "Project" cache_backend Redis --agent agent-a
.venv/bin/python -m mirsad.cli --db ~/mirsad.db why Redis
.venv/bin/python -m mirsad.cli --db ~/mirsad.db exportالأدوات الإحدى عشرة عبر MCP: remember_fact، current_fact، timeline، record_decision، record_outcome، add_alias، why، recall، open_conflicts، resolve_conflict، memory_stats.
خريطة الذاكرة الحية (النسخة المحلية)
شغّل الخادم المحلي ثم افتح http://127.0.0.1:8765/ في المتصفح: شبكة حية
لذاكرتك — الكيانات والقرارات والقيم عقدٌ، والحقائق والروابط روابط. تتحدث
الخريطة لحظيًا بينما يكتب أي وكيل في الذاكرة (الكتابة الجديدة تنبض وتظهر
في مكانها)، والضغط على أي عقدة يفتح قصتها: حقائقها الحالية، خطها الزمني،
القرارات التي شاركت فيها ومَن كتب ماذا ومتى. التعارضات المفتوحة تُعلَّم
بحلقة حمراء. كل ذلك محلي بالكامل — صفحة واحدة بلا أي اعتماديات خارجية،
والمحرك يعرّض البيانات عبر GET /graph.
الاختبارات (قابلة للفشل فعليًا)
.venv/bin/python demo.py # 23 فحصًا على المحرّك: قرارات، زمن، تعارض بين وكيلين، أسماء بديلة، استبدال
.venv/bin/python test_mcp.py # خادم حقيقي + عميل MCP رسمي: كتابة من وكيل وقراءة من آخر
.venv/bin/python test_graph.py # 13 فحصًا على خريطة الذاكرة الحية: عقد وروابط وقصص وعدّاد تغييراتتوصيل التطبيقات — الحقيقة كما تحققنا منها (نوفمبر 2026)
Claude (هاتف وويب): يدعم موصّلات MCP بعيدة على كل الخطط (المجانية: موصّل واحد) بأدوات قراءة وكتابة. أضف الخادم من claude.ai ← Settings ← Connectors، وسيعمل داخل محادثات الهاتف (الاتصال من سحابة Anthropic).
ChatGPT: إضافة خادم مخصص من الويب فقط، ثم يعمل على الهاتف. لكن على الخطط الفردية (Pro) الصلاحية قراءة فقط — يقرأ الذاكرة المشتركة ولا يكتب فيها؛ الكتابة عبر MCP محفوظة لخطط Business/Enterprise/Edu. (Plus: غير مُتحقق منه بدقة من مصدر OpenAI.)
شرط تقني لا مفرّ منه: الخادم يجب أن يكون على رابط HTTPS عام ليصل إليه التطبيقان (localhost لا يكفي). خيارات الاستضافة: نفق آمن (مثل Cloudflare Tunnel) من جهازك، أو خدمة سحابية مجانية، أو VPS رخيص — القرار والخطوة التالية عليك (تحتاج حسابك).
تنبيهان صادقان: (1) الذاكرة عبر MCP «عند الطلب» — المساعد يستدعي الأدوات أثناء المحادثة حين يقرّر أو حين تطلب منه، ليست مرآة حيّة تلتقط كل شيء تلقائيًا. (2) هوية الكاتب (
agent) في هذه النسخة يصرّح بها العميل نفسه؛ في نسخة الإنتاج يجب أن تأتي من تسجيل الدخول (OAuth) حتى لا ينتحل وكيلٌ اسم آخر.
خريطة الطريق
OAuth حقيقي للخادم (هوية موثّقة لكل مساعد/جهاز).
استيراد أرشيف محادثات ChatGPT (conversations.json) وClaude وتحويله لحلقات.
استخراج تلقائي اختياري بالـLLM لمن يريده — كطبقة فوق الكتابة اليدوية، لا بديلًا عنها.
بحث دلالي بالتضمينات بجانب البحث النصي والرسمي الحالي.
Available Tools
11 toolsadd_aliasA
Register another name for an entity (another language, spelling or script) so future lookups in that name resolve to the same entity.
Inputs: alias (required), entity (required).
current_factC
The currently valid value for subject+predicate, with provenance.
Inputs: subject (required), predicate (required). Returns: result
memory_statsB
Counts: entities, facts (total/current), decisions, open conflicts.
Inputs: no named parameters.
open_conflictsC
Disagreements between agents that are waiting for the user's ruling.
Inputs: no named parameters.
recallC
Hybrid recall across facts, decisions and raw episodes.
Inputs: query (required).
record_decisionB
Record a decision as ONE unit: the decision, why it was taken, the evidence behind it, which alternatives were rejected, and what it affects (files, functions, plans). Returns the decision id.
Inputs: agent (required), title (required), effects, reasons, +4 more.
record_outcomeC
Attach a later outcome/result to an existing decision.
Inputs: agent (required), outcome (required), decision_id (required).
remember_factA
Store a fact about a subject. If another value is currently recorded
for the same subject+predicate, the old one is closed (not deleted) and,
when a different agent overwrites it, a conflict is opened for the user.
Always pass your own assistant name as agent.
Inputs: agent (required), value (required), subject (required), predicate (required), +1 more.
resolve_conflictC
Close a conflict with the user's ruling, kept on record.
Inputs: resolution (required), conflict_id (required).
timelineB
Every value ever recorded for a subject, with validity windows — including superseded ones. Use it to answer 'what changed and when?'
Inputs: subject (required).
whyB
Answer 'why did we choose X?' — full decision chains matching the topic: reasons, evidence, rejected alternatives, outcomes, and what superseded what.
Inputs: topic (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools are cleanly separated by intent: writing (remember_fact, record_decision, record_outcome, add_alias), reading a single value (current_fact), history (timeline), decision reasoning (why), and conflict handling (open_conflicts/resolve_conflict). The only real overlap is between recall (hybrid search over facts/decisions/episodes) and why (topic-based decision chains) plus timeline, which are all retrieval paths an agent must choose between. Descriptions give enough cues (why = decision chains, timeline = subject history, recall = broad search) to keep misselection limited.
Naming is uniformly snake_case and readable, but mixes verb_noun names (remember_fact, record_decision, add_alias, record_outcome, resolve_conflict) with bare nouns or question-style names (current_fact, timeline, why, recall, open_conflicts, memory_stats). The mixed verb/noun style means an agent can't infer whether a tool reads or writes from the name alone (e.g. timeline vs current_fact).
Eleven tools is well within the sweet spot for a memory/knowledge-graph server, and each tool maps to a distinct lifecycle concern (facts, decisions, outcomes, aliases, conflicts, retrieval, stats). Nothing obvious is redundant or bolted on; memory_stats and add_alias are narrow but legitimately scoped.
The write/read/conflict/decision lifecycle is largely covered, but there are notable gaps: recall advertises search over 'raw episodes' yet no tool records an episode, and there is no retract/forget/delete operation (facts can only be superseded, not removed). There are also no listing/enumeration tools for entities or subjects, which limits discovery outside of targeted lookups.
Maintenance
Related MCP Connectors
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Governed personal world model and memory for your AI agent. Pair once, connect over MCP.
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceA local-first, privacy-preserving centralized memory hub for AI agents — MCP-compatible, zero cloud egress.3-
- AlicenseNot gradedqualityCmaintenanceA permissioned memory tree for you and your AI — served over MCP.26 npm1MIT
- AlicenseAqualityDmaintenanceLocal-first MCP server for governed AI memory where agents propose memories and humans approve them, with optional cloud sync.61MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to share a local-first, versioned memory of decisions, conventions, tasks, conflicts, and handoffs over MCP and REST.1 npmMIT