- Rewrite README.md and README_CN.md with comprehensive project documentation including core features, architecture overview, benchmarks, tech stack, quick start guide, and detailed installation instructions - Add CONTRIBUTING.md with contribution guidelines - Add architecture.svg and directory-structure.svg diagrams - Add generated PNG assets for hero banner, core features, pain points, architecture, and benchmark results - Add screenshot PNGs for installation guide (PostgreSQL, Neo4j, Alembic, API docs, frontend UI) - Replace external GitHub image URLs with local asset references
199 lines
15 KiB
XML
199 lines
15 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 760">
|
|
<defs>
|
|
<style>
|
|
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');
|
|
text { font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace; }
|
|
</style>
|
|
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
|
|
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>
|
|
</pattern>
|
|
<marker id="arrow-cyan" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
<polygon points="0 0, 10 3.5, 0 7" fill="#22d3ee"/>
|
|
</marker>
|
|
<marker id="arrow-slate" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
<polygon points="0 0, 10 3.5, 0 7" fill="#64748b"/>
|
|
</marker>
|
|
<marker id="arrow-rose" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
<polygon points="0 0, 10 3.5, 0 7" fill="#fb7185"/>
|
|
</marker>
|
|
<marker id="arrow-emerald" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
<polygon points="0 0, 10 3.5, 0 7" fill="#34d399"/>
|
|
</marker>
|
|
</defs>
|
|
|
|
<!-- Background -->
|
|
<rect width="1280" height="760" fill="#0f172a"/>
|
|
<rect width="1280" height="760" fill="url(#grid)"/>
|
|
|
|
<!-- Title -->
|
|
<text x="40" y="44" fill="#f8fafc" font-size="16" font-weight="700">MemoryBear — System Architecture</text>
|
|
<text x="40" y="62" fill="#64748b" font-size="9">RedBear AI · Next-Generation AI Memory Management System</text>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- ROW 1: FastAPI Service Layer y=80..150 (full width center) -->
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<rect x="200" y="80" width="880" height="70" rx="8" fill="#0f172a"/>
|
|
<rect x="200" y="80" width="880" height="70" rx="8" fill="rgba(8,51,68,0.5)" stroke="#22d3ee" stroke-width="1.5"/>
|
|
<!-- left badge -->
|
|
<rect x="220" y="97" width="160" height="36" rx="5" fill="rgba(8,51,68,0.8)" stroke="#22d3ee" stroke-width="1" stroke-dasharray="4,2"/>
|
|
<text x="300" y="112" fill="#22d3ee" font-size="9" font-weight="600" text-anchor="middle">Management API</text>
|
|
<text x="300" y="126" fill="#94a3b8" font-size="8" text-anchor="middle">/api · JWT Auth</text>
|
|
<!-- center label -->
|
|
<text x="640" y="112" fill="#f8fafc" font-size="13" font-weight="700" text-anchor="middle">FastAPI Service Layer</text>
|
|
<text x="640" y="128" fill="#94a3b8" font-size="9" text-anchor="middle">Uvicorn · avg latency <50ms · 1000 QPS · Swagger auto-docs</text>
|
|
<!-- right badge -->
|
|
<rect x="900" y="97" width="160" height="36" rx="5" fill="rgba(8,51,68,0.8)" stroke="#22d3ee" stroke-width="1" stroke-dasharray="4,2"/>
|
|
<text x="980" y="112" fill="#22d3ee" font-size="9" font-weight="600" text-anchor="middle">Service API</text>
|
|
<text x="980" y="126" fill="#94a3b8" font-size="8" text-anchor="middle">/v1 · API Key Auth</text>
|
|
|
|
<!-- Arrows: FastAPI → 3 engines -->
|
|
<line x1="430" y1="150" x2="310" y2="220" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrow-cyan)"/>
|
|
<line x1="640" y1="150" x2="640" y2="220" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrow-cyan)"/>
|
|
<line x1="850" y1="150" x2="970" y2="220" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrow-cyan)"/>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- ROW 2: Three Engines y=220..340 -->
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
|
|
<!-- Extraction Engine x=160..400 -->
|
|
<rect x="160" y="220" width="240" height="120" rx="8" fill="#0f172a"/>
|
|
<rect x="160" y="220" width="240" height="120" rx="8" fill="rgba(8,51,68,0.45)" stroke="#22d3ee" stroke-width="1.5"/>
|
|
<text x="280" y="246" fill="#22d3ee" font-size="11" font-weight="700" text-anchor="middle">Extraction Engine</text>
|
|
<line x1="178" y1="254" x2="382" y2="254" stroke="#22d3ee" stroke-width="0.5" opacity="0.4"/>
|
|
<text x="280" y="272" fill="#94a3b8" font-size="8" text-anchor="middle">· Statements extraction</text>
|
|
<text x="280" y="287" fill="#94a3b8" font-size="8" text-anchor="middle">· Triplet (entity + relation)</text>
|
|
<text x="280" y="302" fill="#94a3b8" font-size="8" text-anchor="middle">· Timestamp anchoring</text>
|
|
<text x="280" y="317" fill="#94a3b8" font-size="8" text-anchor="middle">· Smart summarization</text>
|
|
|
|
<!-- Hybrid Search x=520..760 -->
|
|
<rect x="520" y="220" width="240" height="120" rx="8" fill="#0f172a"/>
|
|
<rect x="520" y="220" width="240" height="120" rx="8" fill="rgba(76,29,149,0.35)" stroke="#a78bfa" stroke-width="1.5"/>
|
|
<text x="640" y="246" fill="#a78bfa" font-size="11" font-weight="700" text-anchor="middle">Hybrid Search</text>
|
|
<line x1="538" y1="254" x2="742" y2="254" stroke="#a78bfa" stroke-width="0.5" opacity="0.4"/>
|
|
<text x="640" y="272" fill="#94a3b8" font-size="8" text-anchor="middle">· Elasticsearch keyword</text>
|
|
<text x="640" y="287" fill="#94a3b8" font-size="8" text-anchor="middle">· BERT semantic vector</text>
|
|
<text x="640" y="302" fill="#94a3b8" font-size="8" text-anchor="middle">· Hybrid fusion (92% acc)</text>
|
|
<text x="640" y="317" fill="#94a3b8" font-size="8" text-anchor="middle">· +35% vs single-mode</text>
|
|
|
|
<!-- Reflection Engine x=880..1120 -->
|
|
<rect x="880" y="220" width="240" height="120" rx="8" fill="#0f172a"/>
|
|
<rect x="880" y="220" width="240" height="120" rx="8" fill="rgba(6,78,59,0.4)" stroke="#34d399" stroke-width="1.5"/>
|
|
<text x="1000" y="246" fill="#34d399" font-size="11" font-weight="700" text-anchor="middle">Reflection Engine</text>
|
|
<line x1="898" y1="254" x2="1102" y2="254" stroke="#34d399" stroke-width="0.5" opacity="0.4"/>
|
|
<text x="1000" y="272" fill="#94a3b8" font-size="8" text-anchor="middle">· Consistency checks</text>
|
|
<text x="1000" y="287" fill="#94a3b8" font-size="8" text-anchor="middle">· Value assessment</text>
|
|
<text x="1000" y="302" fill="#94a3b8" font-size="8" text-anchor="middle">· Association optimization</text>
|
|
<text x="1000" y="317" fill="#94a3b8" font-size="8" text-anchor="middle">· Daily auto-schedule</text>
|
|
|
|
<!-- Arrows: 3 engines → Storage -->
|
|
<line x1="280" y1="340" x2="380" y2="420" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow-slate)"/>
|
|
<line x1="640" y1="340" x2="640" y2="420" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow-slate)"/>
|
|
<line x1="1000" y1="340" x2="900" y2="420" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow-slate)"/>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- ROW 3: Knowledge Storage Layer y=420..540 -->
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- Outer region boundary — starts at x=120, well clear of left edge -->
|
|
<rect x="120" y="415" width="1040" height="130" rx="10" fill="none" stroke="#fbbf24" stroke-width="1" stroke-dasharray="8,4"/>
|
|
<text x="140" y="432" fill="#fbbf24" font-size="9" font-weight="600">Knowledge Storage Layer</text>
|
|
|
|
<!-- Neo4j x=140..340 -->
|
|
<rect x="140" y="442" width="200" height="80" rx="6" fill="#0f172a"/>
|
|
<rect x="140" y="442" width="200" height="80" rx="6" fill="rgba(76,29,149,0.4)" stroke="#a78bfa" stroke-width="1.5"/>
|
|
<text x="240" y="466" fill="#a78bfa" font-size="10" font-weight="600" text-anchor="middle">Neo4j Graph DB</text>
|
|
<text x="240" y="482" fill="#94a3b8" font-size="8" text-anchor="middle">Knowledge graph · Entities</text>
|
|
<text x="240" y="496" fill="#94a3b8" font-size="8" text-anchor="middle">12 relation types · Visual</text>
|
|
|
|
<!-- PostgreSQL x=360..560 -->
|
|
<rect x="360" y="442" width="200" height="80" rx="6" fill="#0f172a"/>
|
|
<rect x="360" y="442" width="200" height="80" rx="6" fill="rgba(8,51,68,0.5)" stroke="#22d3ee" stroke-width="1.5"/>
|
|
<text x="460" y="466" fill="#22d3ee" font-size="10" font-weight="600" text-anchor="middle">PostgreSQL</text>
|
|
<text x="460" y="482" fill="#94a3b8" font-size="8" text-anchor="middle">Primary DB · SQLAlchemy</text>
|
|
<text x="460" y="496" fill="#94a3b8" font-size="8" text-anchor="middle">Alembic migrations</text>
|
|
|
|
<!-- Elasticsearch x=580..780 -->
|
|
<rect x="580" y="442" width="200" height="80" rx="6" fill="#0f172a"/>
|
|
<rect x="580" y="442" width="200" height="80" rx="6" fill="rgba(120,53,15,0.35)" stroke="#fbbf24" stroke-width="1.5"/>
|
|
<text x="680" y="466" fill="#fbbf24" font-size="10" font-weight="600" text-anchor="middle">Elasticsearch 8.x</text>
|
|
<text x="680" y="482" fill="#94a3b8" font-size="8" text-anchor="middle">Keyword + vector index</text>
|
|
<text x="680" y="496" fill="#94a3b8" font-size="8" text-anchor="middle">BERT embeddings</text>
|
|
|
|
<!-- Redis x=800..1000 -->
|
|
<rect x="800" y="442" width="200" height="80" rx="6" fill="#0f172a"/>
|
|
<rect x="800" y="442" width="200" height="80" rx="6" fill="rgba(136,19,55,0.35)" stroke="#fb7185" stroke-width="1.5"/>
|
|
<text x="900" y="466" fill="#fb7185" font-size="10" font-weight="600" text-anchor="middle">Redis 6.0+</text>
|
|
<text x="900" y="482" fill="#94a3b8" font-size="8" text-anchor="middle">Cache · Celery broker</text>
|
|
<text x="900" y="496" fill="#94a3b8" font-size="8" text-anchor="middle">3 task queues</text>
|
|
|
|
<!-- Arrow: Storage → Forgetting -->
|
|
<line x1="640" y1="545" x2="640" y2="590" stroke="#fb7185" stroke-width="1.5" marker-end="url(#arrow-rose)"/>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- ROW 4: Bottom row — MCP | Forgetting Engine | Celery Workers -->
|
|
<!-- y=590..680 -->
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
|
|
<!-- MCP / Agent panel x=20..170 y=590..680 -->
|
|
<rect x="20" y="590" width="150" height="130" rx="8" fill="none" stroke="#60a5fa" stroke-width="1" stroke-dasharray="6,3"/>
|
|
<text x="95" y="607" fill="#60a5fa" font-size="8" font-weight="600" text-anchor="middle">MCP / Agent</text>
|
|
|
|
<rect x="32" y="614" width="126" height="28" rx="4" fill="rgba(59,130,246,0.2)" stroke="#60a5fa" stroke-width="1"/>
|
|
<text x="95" y="626" fill="#60a5fa" font-size="8" font-weight="600" text-anchor="middle">fastmcp</text>
|
|
<text x="95" y="637" fill="#94a3b8" font-size="7" text-anchor="middle">MCP tools</text>
|
|
|
|
<rect x="32" y="648" width="126" height="28" rx="4" fill="rgba(59,130,246,0.2)" stroke="#60a5fa" stroke-width="1"/>
|
|
<text x="95" y="660" fill="#60a5fa" font-size="8" font-weight="600" text-anchor="middle">LangGraph Agent</text>
|
|
<text x="95" y="671" fill="#94a3b8" font-size="7" text-anchor="middle">LangChain LLM</text>
|
|
|
|
<rect x="32" y="682" width="126" height="28" rx="4" fill="rgba(59,130,246,0.2)" stroke="#60a5fa" stroke-width="1"/>
|
|
<text x="95" y="694" fill="#60a5fa" font-size="8" font-weight="600" text-anchor="middle">OpenAI / DashScope</text>
|
|
<text x="95" y="705" fill="#94a3b8" font-size="7" text-anchor="middle">AWS Bedrock / Xinference</text>
|
|
|
|
<!-- connect line MCP → storage layer -->
|
|
<line x1="170" y1="640" x2="200" y2="482" stroke="#60a5fa" stroke-width="1" stroke-dasharray="4,2"/>
|
|
|
|
<!-- Forgetting Engine x=390..890 y=590..670 -->
|
|
<rect x="390" y="590" width="500" height="80" rx="8" fill="#0f172a"/>
|
|
<rect x="390" y="590" width="500" height="80" rx="8" fill="rgba(136,19,55,0.35)" stroke="#fb7185" stroke-width="1.5"/>
|
|
<text x="640" y="616" fill="#fb7185" font-size="12" font-weight="700" text-anchor="middle">Forgetting Engine</text>
|
|
<line x1="410" y1="624" x2="870" y2="624" stroke="#fb7185" stroke-width="0.5" opacity="0.4"/>
|
|
<text x="640" y="641" fill="#94a3b8" font-size="8" text-anchor="middle">Memory strength model · Time decay · Dormancy → Decay → Clearance</text>
|
|
<text x="640" y="656" fill="#94a3b8" font-size="8" text-anchor="middle">Redundancy < 8% · Synaptic pruning inspired · Cold storage archive</text>
|
|
|
|
<!-- Celery Workers panel x=1110..1260 y=590..720 -->
|
|
<rect x="1110" y="590" width="150" height="130" rx="8" fill="none" stroke="#34d399" stroke-width="1" stroke-dasharray="6,3"/>
|
|
<text x="1185" y="607" fill="#34d399" font-size="8" font-weight="600" text-anchor="middle">Celery Workers</text>
|
|
|
|
<rect x="1122" y="614" width="126" height="28" rx="5" fill="rgba(6,78,59,0.3)" stroke="#34d399" stroke-width="1"/>
|
|
<text x="1185" y="626" fill="#34d399" font-size="8" font-weight="600" text-anchor="middle">memory_tasks</text>
|
|
<text x="1185" y="637" fill="#94a3b8" font-size="7" text-anchor="middle">threads · 100 concurrency</text>
|
|
|
|
<rect x="1122" y="648" width="126" height="28" rx="5" fill="rgba(6,78,59,0.3)" stroke="#34d399" stroke-width="1"/>
|
|
<text x="1185" y="660" fill="#34d399" font-size="8" font-weight="600" text-anchor="middle">document_tasks</text>
|
|
<text x="1185" y="671" fill="#94a3b8" font-size="7" text-anchor="middle">prefork · 4 concurrency</text>
|
|
|
|
<rect x="1122" y="682" width="126" height="28" rx="5" fill="rgba(6,78,59,0.3)" stroke="#34d399" stroke-width="1"/>
|
|
<text x="1185" y="694" fill="#34d399" font-size="8" font-weight="600" text-anchor="middle">periodic_tasks</text>
|
|
<text x="1185" y="705" fill="#94a3b8" font-size="7" text-anchor="middle">prefork · 2 concurrency</text>
|
|
|
|
<!-- connect line Celery → Redis -->
|
|
<line x1="1110" y1="640" x2="1000" y2="482" stroke="#34d399" stroke-width="1" stroke-dasharray="4,2"/>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<!-- Legend -->
|
|
<!-- ═══════════════════════════════════════════════════════════════ -->
|
|
<rect x="40" y="736" width="8" height="8" rx="1" fill="#22d3ee"/>
|
|
<text x="54" y="745" fill="#94a3b8" font-size="8">API / Extraction</text>
|
|
<rect x="170" y="736" width="8" height="8" rx="1" fill="#a78bfa"/>
|
|
<text x="184" y="745" fill="#94a3b8" font-size="8">Search / Graph</text>
|
|
<rect x="300" y="736" width="8" height="8" rx="1" fill="#34d399"/>
|
|
<text x="314" y="745" fill="#94a3b8" font-size="8">Reflection / Workers</text>
|
|
<rect x="450" y="736" width="8" height="8" rx="1" fill="#fbbf24"/>
|
|
<text x="464" y="745" fill="#94a3b8" font-size="8">Storage Layer</text>
|
|
<rect x="560" y="736" width="8" height="8" rx="1" fill="#fb7185"/>
|
|
<text x="574" y="745" fill="#94a3b8" font-size="8">Forgetting Engine</text>
|
|
<rect x="680" y="736" width="8" height="8" rx="1" fill="#60a5fa"/>
|
|
<text x="694" y="745" fill="#94a3b8" font-size="8">MCP / Agent</text>
|
|
<text x="1240" y="750" fill="#334155" font-size="7" text-anchor="end">RedBear AI · MemoryBear v1.0</text>
|
|
</svg>
|