Final Rust Crate Architecture
Date: 2025-10-28
Status: Post-migration architecture (after comprehensive Rust migration)
⚠️ IMPORTANT UPDATE (December 2025): The
feagi-data-processingrepository has been merged intofeagi-coreas workspace members:
feagi-structures→crates/feagi-structuresfeagi-serialization→crates/feagi-serializationfeagi-sensorimotor→crates/feagi-sensorimotor(previously feagi-connector-core, then feagi-pns)This document retains historical references to
feagi-data-processingas a separate entity for architectural context.
Crate Hierarchy Overview
feagi-data-processing (foundational, peer-level)
↓ (used by)
┌───────────────────────────────────────────────────────────────────┐
│ feagi-core (workspace with 7 subcrates) │
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Full Stack Subcrates (server only): │ │
│ │ • feagi-api (REST API - Axum) │ │
│ │ • feagi-services (Service layer) │ │
│ │ • feagi-io (I/O - ZMQ) │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────── ─────────────────────────────────────┐ │
│ │ Core Subcrates (reusable, modular): │ │
│ │ • feagi-brain-development (Business logic) │ │
│ │ • feagi-npu (Burst engine) │ │
│ │ • feagi-state (State manager) │ │
│ │ • feagi-config (Config loader) │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└───────────────────────────────────────────────────────────────────┘
↓ (core subcrates consumed by)
┌─────────────────────┬────────────────── ───┬───────────────────────┐
│ feagi-py │ feagi-inference- │ feagi-web │
│ (Python bindings) │ engine (embedded) │ (WASM for browser) │
│ │ │ │
│ Uses: ALL │ Uses: npu, state, │ Uses: npu, bdu, │
│ │ bdu, config │ state │
└─────────────────────┴─────────────────────┴───────────────────────┘
Crate Breakdown
1. feagi-data-processing (Foundational)
Location: /feagi-data-processing/
Status: ✅ Already exists
Role: Foundational, peer-level crate for data structures and serialization
Purpose
Cross-cutting data structures used by ALL FEAGI components.
Key Components
// Core data structures
pub struct NeuronVoxelXYZPArrays { /* ... */ }
pub struct SensoryData { /* ... */ }
pub struct MotorData { /* ... */ }
// Serialization formats
pub mod serialization {
pub fn serialize_xyzp(...);
pub fn deserialize_xyzp(...);
pub fn compress_lz4(...);
}
Used By
- ✅
feagi-core(BDU, NPU, API) - ✅
brain-visualizer(Godot client) - ✅
feagi-connector(agents) - ✅
feagi-inference-engine(embedded) - ✅ Python bindings
Dependencies
[dependencies]
serde = "1.0"
serde_json = "1.0"
lz4 = "1.24"
ndarray = "0.15" # For array operations
Size: ~5,000 LOC
2. feagi-core (Main Application Workspace)
Location: /feagi-core/
Status: 🔄 Will be the result of this migration
Role: Workspace containing 7 subcrates (3 full-stack, 4 reusable core)
Purpose
Modular workspace enabling full FEAGI server while providing reusable core components for embedded and WASM deployments.
Workspace Structure
feagi-core/
├── Cargo.toml # Workspace definition
├── src/
│ └── main.rs # Binary that composes all subcrates
│
├── crates/ # 7 SUBCRATES
│ │
│ ├── feagi-api/ # REST API (Axum) - Full Stack Only
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── app.rs # Axum app setup
│ │ ├── endpoints/ # REST endpoints
│ │ │ ├── system.rs
│ │ │ ├── cortical_area.rs
│ │ │ ├── genome.rs
│ │ │ └── ...
│ │ ├── middleware/ # Auth, CORS, error handling
│ │ └── models/ # Request/response DTOs
│ │
│ ├── feagi-services/ # Service Layer - Full Stack Only
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── base_service.rs # BaseService trait
│ │ ├── core_api_service.rs # Facade
│ │ ├── system_service.rs
│ │ ├── genome_service.rs
│ │ ├── cortical_area_service.rs
│ │ ├── connectome_service.rs
│ │ ├── brain_service.rs
│ │ ├── agents_service.rs
│ │ ├── network_service.rs
│ │ └── npu_service.rs
│ │
│ ├── feagi-brain-development/ # Business Logic - CORE (Reusable)
│ │ ├── Cargo.toml # Features: std, minimal, full, wasm