Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion astraweave-memory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ uuid = { version = "1.0", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }
dashmap = "6.1"
async-trait = "0.1"
rusqlite = { version = "0.37", features = ["bundled"] }
# 0.41.0 is the first rusqlite that depends on libsqlite3-sys 0.39
# (bundled SQLite 3.54.0, RUSTSEC-2026-0459). `cache` is the statement
# cache 0.37 always compiled in. The 0.41 default `ffi-sqlite-wasm-rs`
# is wasm-only and is left off.
rusqlite = { version = "0.41", default-features = false, features = ["bundled", "cache"] }
bevy_ecs = { version = "0.17", optional = true }

[features]
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture/ai_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ This section enumerates the load-bearing files. Per-file enumeration of all 112
| `astraweave-memory/src/lib.rs` | Module declarations + re-exports (15 pub-uses + feature-gated `components`) | Active | `#![forbid(unsafe_code)]` at line 1 |
| `astraweave-memory/src/{memory_types,memory_manager}.rs` | Hierarchical memory (sensory/working/episodic/semantic + procedural/emotional/social), forgetting curves; `MemoryManager` with `MemoryManagerConfig` capacity-per-type limits | Active | See §13.1.4 |
| `astraweave-memory/src/{episode,episode_recorder}.rs` | `GameEpisode`, `EpisodeCategory`, `EpisodeOutcome`, `PlayerAction`, `CompanionResponse`, `Observation`, `EpisodeRecorder` | Active | Note: `Episode` from `episode` is different from `persona::Episode` (renamed `GameEpisode` at re-export) |
| `astraweave-memory/src/storage.rs` | SQLite `MemoryStorage` + `StorageStats`; schema at `storage.rs:46-80` with `memories` + `memory_tags` + `metadata` tables and four indexes | Active | Powered by `rusqlite 0.37` (`Cargo.toml:22`, bundled feature) |
| `astraweave-memory/src/storage.rs` | SQLite `MemoryStorage` + `StorageStats`; schema at `storage.rs:46-80` with `memories` + `memory_tags` + `metadata` tables and four indexes | Active | Powered by `rusqlite 0.41.0` (`Cargo.toml:25`, bundled feature; `libsqlite3-sys 0.39.0`) |
| `astraweave-memory/src/pattern_detection.rs` | `PatternDetector`, `ActionPattern`, `PatternStrength`, `PlaystylePattern` (6 variants: Aggressive/Cautious/Explorative/Social/Analytical/Efficient) | Active | Behavioral pattern detection |
| `astraweave-memory/src/preference_profile.rs` | `PreferenceProfile`, `ProfileBuilder`, `CompanionActionPreference` | Active | |
| `astraweave-memory/src/dynamic_weighting.rs` | `AdaptiveWeightManager`, `BehaviorNodeType` (6 variants), `NodeWeight` | Active (Phase 4) | Adaptive behavior tree weighting. **No production consumers found** — see §13.1.7 |
Expand All @@ -466,7 +466,7 @@ This section enumerates the load-bearing files. Per-file enumeration of all 112
| `astraweave-memory/src/retrieval.rs` | `RetrievalConfig`, `RetrievalResult`, `ScoreBreakdown`, `RetrievalPath` (semantic + temporal + associative weighted search; defaults `semantic_weight = 0.6`, `temporal_weight = 0.2`, `associative_weight = 0.2`) | Active | Re-exported via `lib.rs:57-58`. Not in original parent §5 enumeration |
| `astraweave-memory/src/sharing.rs` | `SharingConfig`, `ShareRequest`, `SharingResult`, `SharingType`, `PrivacyLevel`, `SharedMemoryContent`, `SharingMetadata` (cross-agent memory sharing with permissions) | Active | Re-exported via `lib.rs:60-61`. Not in original parent §5 enumeration |
| `astraweave-memory/src/persona.rs` | Legacy persona types: `Episode` (different from `episode::Episode`), `Persona`, `Fact`, `Skill`, `CompanionProfile` | Active (consumed externally via `astraweave-persona`) | Re-exported via `lib.rs:63-64`. The collision-renamed `Episode` is here, NOT in `episode.rs` |
| `astraweave-memory/src/components.rs` | Bevy `MemoryComponent`, `MemoryEntityConfig` (Bevy ECS integration) | Active (feature `bevy`) | `#[cfg(feature = "bevy")]`; `Cargo.toml:27` declares `bevy = ["bevy_ecs"]`. **The only AI-side crate that uses `bevy_ecs` rather than `astraweave-ecs`** |
| `astraweave-memory/src/components.rs` | Bevy `MemoryComponent`, `MemoryEntityConfig` (Bevy ECS integration) | Active (feature `bevy`) | `#[cfg(feature = "bevy")]`; `astraweave-memory/Cargo.toml:30` declares `bevy = ["bevy_ecs"]`. **The only AI-side crate that uses `bevy_ecs` rather than `astraweave-ecs`** |
| Per-subsystem trace | See §13.1 below for the dedicated Memory subsystem trace | Done | |

### `astraweave-director`, `astraweave-npc`, `astraweave-dialogue`, `astraweave-coordination`
Expand Down Expand Up @@ -1059,7 +1059,7 @@ Therefore the memory crate's `AdaptiveWeightManager.weights` map is **never read

**Reverse-dependency surprise:** `astraweave-memory/Cargo.toml:11-13` declares dependencies on `astraweave-llm`, `astraweave-embeddings`, and `astraweave-rag`. Workspace grep for `use astraweave_llm|use astraweave_embeddings|use astraweave_rag` inside `astraweave-memory/{src,tests,benches}` returned **zero matches** (re-verified 2026-05-12). These appear to be unused Cargo dependencies — no macro or feature-gated path was found that would pull them in transitively in the surveyed files.

**Bevy ECS divergence:** `astraweave-memory/Cargo.toml:23, 27` declares `bevy_ecs = { version = "0.17", optional = true }` and `bevy = ["bevy_ecs"]`. When the `bevy` feature is enabled, `components.rs` uses `bevy_ecs::component::Component`. The rest of the engine uses `astraweave-ecs` (per `docs/architecture/ecs_math_core_sdk_foundation.md`). The memory crate is the only AI-side crate that targets Bevy ECS directly. Verified 2026-05-12: workspace grep across all `*.toml` files for `astraweave-memory.*features.*bevy` or `astraweave_memory.*bevy` returned zero matches — the `bevy` feature is **not enabled by any consumer build**, so `components.rs` is unreachable in practice.
**Bevy ECS divergence:** `astraweave-memory/Cargo.toml:26, 30` declares `bevy_ecs = { version = "0.17", optional = true }` and `bevy = ["bevy_ecs"]`. When the `bevy` feature is enabled, `components.rs` uses `bevy_ecs::component::Component`. The rest of the engine uses `astraweave-ecs` (per `docs/architecture/ecs_math_core_sdk_foundation.md`). The memory crate is the only AI-side crate that targets Bevy ECS directly. Verified 2026-05-12: workspace grep across all `*.toml` files for `astraweave-memory.*features.*bevy` or `astraweave_memory.*bevy` returned zero matches — the `bevy` feature is **not enabled by any consumer build**, so `components.rs` is unreachable in practice.

#### 13.1.6 Invariants (subsystem-specific)

Expand Down Expand Up @@ -1089,7 +1089,7 @@ Therefore the memory crate's `AdaptiveWeightManager.weights` map is **never read
**Subsystem-specific open questions:**

- **Unused Cargo dependencies on `astraweave-llm`, `astraweave-embeddings`, `astraweave-rag`?** [Factual — resolved 2026-05-12.] `astraweave-memory/Cargo.toml:11-13` lists them as direct dependencies; workspace grep inside `astraweave-memory/{src,tests,benches}` for `use astraweave_llm|use astraweave_embeddings|use astraweave_rag` returns zero matches. No macro or feature-gated path was found that imports them. These are genuinely unused Cargo dependencies — dead `Cargo.toml` weight.
- **`bevy_ecs` divergence: status of the `bevy` feature.** [Factual — resolved 2026-05-12.] `Cargo.toml:23, 27` declares an optional `bevy_ecs = "0.17"` dependency under feature `bevy`; `components.rs` is `#[cfg(feature = "bevy")]`-gated. Workspace grep across all `*.toml` files for `astraweave-memory.*features.*bevy` returns zero matches. The feature is not enabled by any consumer build today, so `components.rs` is unreachable in practice.
- **`bevy_ecs` divergence: status of the `bevy` feature.** [Factual — resolved 2026-05-12.] `astraweave-memory/Cargo.toml:26, 30` declares an optional `bevy_ecs = "0.17"` dependency under feature `bevy`; `components.rs` is `#[cfg(feature = "bevy")]`-gated. Workspace grep across all `*.toml` files for `astraweave-memory.*features.*bevy` returns zero matches. The feature is not enabled by any consumer build today, so `components.rs` is unreachable in practice.
- **`MemoryManager` vs `MemoryStorage` — same data or different roles?** [Decisional.] Factual: `MemoryManager` (`memory_manager.rs:15-…`) is an in-RAM `HashMap<String, Memory>` ledger with capacity limits. `MemoryStorage` (`storage.rs:16-…`) is a SQLite-backed persistent layer. No code path was traced in this pass that synchronizes them (e.g. "flush MemoryManager to MemoryStorage" or "load MemoryStorage into MemoryManager on startup"). Whether they are intended to coexist as a write-through cache, or whether one supersedes the other, is undecided.
- **Memory-side `BehaviorNodeType` (`Combat`/`Support`/`Exploration`/`Social`/`Analytical`/`Defensive`) vs `astraweave-behavior::BehaviorNode` (`Sequence`/`Selector`/`Action`/`Condition`/`Decorator`/`Parallel`)** — even if the memory-side feedback loop is wired in the future, the type bridge between these two enums (and the `from_pattern` mapping at `dynamic_weighting.rs:47-62`) needs explicit design. [Decisional, conditional on resolving the dormancy question.]
- **`EpisodeRecorder` doc-comment at `episode_recorder.rs:13-16` says "designed to be used as an ECS resource, running in `SystemStage::POST_SIMULATION`"** — but no such system registration was found in `astraweave-ai/src/ecs_ai_plugin.rs` or anywhere else. [Factual — the docstring describes intended use, not actual use.] Whether to add the system registration (re-enabling the feedback loop) or to update the docstring (acknowledging the intended-but-not-wired status) is conditional on the broader dormancy decision.
Expand Down
Loading