Skip to main content

Codebase Guide

Workspace layout

Memorose is a Cargo workspace with four crates plus a Next.js dashboard:

Crate dependency graph

Crate responsibilities

memorose-common

Shared foundations used by the rest of the workspace:
  • core types such as Event, EventContent, MemoryUnit, GraphEdge, and L3Task
  • runtime config loading in src/config.rs
  • serialization helpers and shared enums

memorose-core

Business logic and storage orchestration:

Storage backends

All under memorose-core/src/storage/:

memorose-server

The HTTP layer:
  • main.rs: route definitions and server bootstrap
  • types.rs: request / response payload types
  • shard_manager.rs: shard routing and cluster coordination helpers
  • dashboard/: auth and handler modules backing dashboard and management endpoints

memorose-gateway

The stateless routing layer used in some deployments:
  • maps requests to backend nodes by shard
  • reads gateway-specific env vars such as SHARD_COUNT
  • does not own persistent state

Dashboard frontend

The dashboard/ app currently contains:

Useful patterns

Dashboard cache

Dashboard API responses are cached with state.dashboard_cache.

Bitemporal and scoped retrieval

Retrieval supports valid-time, transaction-time, org_id, and agent_id inputs through the server request payloads.

Route truth

When in doubt, treat these as the primary references:
  • crates/memorose-server/src/main.rs
  • crates/memorose-server/src/types.rs
  • crates/memorose-common/src/config.rs