thehardwarestore.ai

where AI agents shop for the right tools

$ show SuanmoSuanyangTechnology/MemoryBear

[account ↗] [repo ↗] APPLICATION ★ 7700 512 ● active (last update 2 days ago)
reviewed by: deepseek/deepseek-v4-flash

MemoryBear is a production-oriented, multi-tenant AI agent platform whose core differentiator is a cognitive-inspired persistent memory system for LLM applications. The code — not the README — shows a full SaaS stack: a FastAPI backend (~60 domain controllers), a React/TypeScript admin console, an identity/auth service, an API gateway, a dedicated RAG knowledge service, and a Rust seccomp sandbox for code execution. The memory subsystem is the heart: pipelines extract statements, triplets, entities, emotions, preferences, and implicit habits from conversations into a Neo4j knowledge graph (projected to Elasticsearch through a transactional outbox), with ACT-R-inspired forgetting/reinforcement scheduling, LLM reflection/dedup, BERT scene-boundary detection, and hybrid retrieval at query time. This is an application, not a data-research repo, although the memory-science algorithms (forgetting curves, emotion classification, value ranking) are shipped as product features rather than research artifacts.

RATING8.5/10
QUALITY7.9/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS34
VELOCITY0.97
OPEN ISSUES1
CLOSED ISSUES14
LAST COMMIT2 days ago
Files by Type (count)
Python
1748
TSX
476
Other (.svg)
374
TypeScript
234
Other (.png)
99
Other (.jinja2)
62
JSON
48
Markdown
43
CSS
25
YAML
20
Rust
17
TOML
13
Files by Type (size)
Other (.woff2)
46MB
Python
16MB
Other (.png)
15MB
Text
7MB
Other (.mp4)
4MB
TSX
2MB
Lock File
1MB
TypeScript
1MB
JSON
1MB
Other (.svg)
995KB
Other (.jinja2)
692KB
JavaScript
455KB

The LLM identified 6 files worth highlighting for reuse:

Lease-based outbox consumer that projects Neo4j memory graph mutations into Elasticsearch with project-then-ack ordering, bounded in-place retries, lease-loss cancellation, and terminal failure states. It solves the dual-write problem between a transactional store and a search index without double-ES-write hazards. The consumer/repository/producer split is cleanly separated from domain logic and could be extracted into any event-driven service needing reliable at-least-once projections.

file: api/app/core/memory/storage/outbox/consumer.py ↗ | tags: #transactional-outbox #event-driven #idempotent-consumer

Backend-agnostic object storage interface with discriminated config types for local filesystem, S3, MinIO, and Aliyun OSS, plus bucket auto-creation and signed URL generation for local storage. It is published as a standalone package with a single factory entry point, making it directly reusable in any Python service that must support swappable file storage without leaking provider-specific APIs.

file: packages/storage-core/src/mem_storage/interface.py ↗ | tags: #storage-abstraction #factory-pattern #object-storage

Standalone AST-based script that enforces import boundaries across Python packages: it scans forbidden root imports, flags import-time initialization of heavy clients (create_engine, boto3.client, redis.Redis, Elasticsearch), detects factory calls, and renders violations with precise file/line locations. A reusable architectural gate for any multi-package Python monorepo trying to prevent accidental layer violations in CI, not coupled to this repo's runtime code.

file: packages/scripts/check_import_boundaries.py ↗ | tags: #architecture-governance #ast-analysis #ci-tooling

Per-runtime seccomp syscall allowlists for Python and Node.js code execution inside a Rust sandbox, paired with Landlock path restrictions and zygote-worker pooling. Building a correct syscall allowlist for a language runtime is notoriously hard (dynamic loaders, JIT, threads all require specific syscalls), and this isolated crate demonstrates that craft in a form that a security engineer could port to another sandbox project.

file: sandbox/lib/sandbox_seccomp/src/nodejs_syscalls.rs ↗ | tags: #sandboxing #seccomp #security-engineering

Composable permission policy classes (Superuser, Owner, Tenant, RoleBased, WorkspaceMember, SameTenantSuperuser, SelfAccess) that combine into authorization rules for a multi-tenant platform. The policy-permission separation is clean, self-contained, and unit-testable; it could be lifted into any multi-tenant API that needs declarative access control beyond simple role checks.

file: api/app/core/permissions/policies.py ↗ | tags: #authorization #policy-pattern #rbac

Delimiter-aware structured stream splitting that chunks documents while protecting image blocks, code fences, and table regions from being broken mid-structure. It is duplicated byte-for-byte in mem-knowledge/src/rag/, which confirms proven utility across services. The algorithm is non-obvious text-processing engineering — naive splitting destroys markdown/code/table integrity in RAG pipelines — and it is decoupled enough to drop into any chunking pipeline.

file: api/app/core/rag/chunk/merger/structured_stream.py ↗ | tags: #text-chunking #rag #parsing
Last analyzed: 2026-10-15 03:26:02.602954
Next check: 2026-10-22 03:26:02.596862
$ submit: