Six Core Engineering Subsystems
How BeeMad Enforces Math, Memory & Idea Rigor
Each subsystem below maps directly to concrete modules in the BeeMad codebase, replacing
unbounded single-pass prose generation with explicit verification, temporal lineage, and
bounded-context retrieval.
01 · core_engine/inference/adaptive_router.py
AdaptiveInferenceEngine (Fast / Slow) & GenPRMScorer
AdaptiveInferenceEngine inspects
incoming queries for numeric caps and allocation trade-off cues (allocate, constraint, blueprint) to route lightweight
exploratory turns through a Fast path and
resource-bounded strategy turns through a Slow
verified refinement loop (max_refinements=2, threshold=0.85).
On every candidate step, GenPRMScorer
combines structural step-rubric checks with the formal verifier's verdict so prose quality
can never override an unsatisfied budget, bandwidth, or exclusion constraint.
02 · z3_modulo.py + marketing_constraints.py
Z3 ModuloVerifier & Constraint Compiler
agent/marketing_constraints.py
extracts discrete PlannedAction
items (effort hours, direct spend, category, and tactic tags) from draft strategy prose
and compiles founder profile limits into ResourceBounds and MutualExclusionRule sets.
core_engine/verifier/z3_modulo.py
evaluates each candidate plan inside Z3 SMT with tracked assertions. When a draft is
infeasible, ModuloVerifier returns
the minimal Marketing Unsat Core
(unsat_core_ids), exact slack
overages, and actionable numeric counterexample feedback.
03 · core_engine/memory/bitemporal.py
BiTemporalFactStore & DualScopeMemoryManager
BiTemporalFactStore stores relational
dossier facts in bitemporal_facts
with dual timelines: real-world business validity (
valid_from, valid_to) and ingestion/retirement
audit timestamps (ingested_at, retired_at, supersedes_id).
Paired with DualScopeMemoryManager
and memory_provenance span records,
pivoting ICP, pricing, or budget cleanly retires superseded edges so stale facts stop
surfacing in active sessions while remaining queryable via point-in-time as_of inspection.
04 · core_engine/memory/hipporag.py
HippoRAGRetriever Personalized PageRank (PPR)
Dense vector cosine search often misses indirect 2-hop marketing facts when a query names
an outcome rather than an intermediate campaign artifact. HippoRAGRetriever builds an
entity-passage hypergraph over 768-dim BAAI/bge-base-en-v1.5 ONNX vectors.
Running Personalized PageRank (damping=0.5, synonymy_threshold=0.84, ppr_blend_weight=0.80) traverses
shared entity bridges across passages to surface linked campaign lessons without lexical
distractors drowning out the answer.
05 · core_engine/rlm/controller.py & vault.py
RLMEngine & EpisodicVault Bounded Slicing
As a startup accumulates months of transcripts, experiments, and customer interviews,
naive sliding windows truncate early constraints and historical learnings. RLMEngine extracts symbolic anchors
from queries and maps parallel bounded slices across EpisodicVault (
max_parallel_slices=6, 8,000-char root cap).
Every extracted finding is verified against verbatim source offsets (
char_start:char_end), keeping root
context compact while preserving auditable citations back to exact episode spans.
06 · skills/idea_validation.md + Match Mode
Match Mode & 4-Dimension Idea Validation
Guided Match Mode captures business category,
buyer pain, monthly budget, and weekly bandwidth before running 4-Dimension Idea Validation—scoring every concept
0–10 across (1) Defensibility / Moat, (2) Market Demand & Competition Landscape, (3)
Effort vs. Reward, and (4) Storytelling / Positioning Potential rather than binary
cheerleading.
Each assessment classifies the score profile (Lopsided, Flat Middle, or Broadly High), names the single riskiest assumption, and prescribes one 7-day
falsification experiment. Live workspaces combine 19 marketing playbooks, 15 seeded
768-dim campaign teardowns, browser-local q8 Xenova/bge-base-en-v1.5 embeddings,
and physical DB-per-tenant storage (control.db
+ tenants/<user_id>.db).