NeuroDecode is the platform and system architecture behind AnakUnggul, a multimodal ASD caregiver support experience built around three cooperating services:
- Session Orchestrator, the main live session orchestrator.
- Moltbook Agent, the community insight harvester.
- A2A Agent, the specialist reasoning and resource agent.
The goal is simple: when a caregiver faces a stressful sensory moment, the system should listen, observe, remember useful context, and answer with calm, practical guidance without making the caregiver do extra work.
For product naming, the clearest split is:
- AnakUnggul for the public-facing app and user experience.
- NeuroDecode for the technical platform and repository.
- Session Orchestrator for the live orchestration agent inside the platform.
NeuroDecode combines:
- A Flutter mobile app for live support.
- A FastAPI backend for orchestration.
- Gemini Live for real-time conversation.
- Firestore for memory and session data.
- Keras observer models for audio and visual signals.
- A community insight pipeline through Moltbook.
- An A2A service for specialist tools and ASD resource lookup.
flowchart LR
User[Caregiver using Flutter app] --> App[Flutter Mobile App]
App -->|wss /ws/live| FA[Session Orchestrator on Cloud Run]
App -->|REST| FA
FA --> Gemini[Gemini Live API]
FA <--> Firestore[(Firestore)]
FA --> Observer[Audio and Visual Observer Models]
FA --> A2A[A2A Agent on Cloud Run]
Moltbook[Moltbook Agent on Cloud Run] --> Firestore
PromptOpinion[Prompt Opinion or other external agent clients] --> A2A
Observer --> FA
A2A --> FA
Session Orchestrator is the main brain of the product flow. It is the service that owns the live caregiver session.
Its responsibilities are:
- Receive audio, text, and optional camera input from the Flutter app.
- Load profile facts, curated memory, and recent session patterns.
- Inject safe, relevant context into Gemini.
- Run observer models in the background.
- Ask the A2A Agent for specialist help when needed.
- Save session summaries, events, and notifications to Firestore.
In practice, Session Orchestrator is not just chat. It is the orchestrator that coordinates memory, observers, Gemini, storage, and external enrichment.
flowchart TD
A[Flutter opens live session] --> B[Session Orchestrator accepts WebSocket]
B --> C[Load profile and recent memory from Firestore]
C --> D[Build private session context]
D --> E[Start Gemini Live session]
E --> F[Receive caregiver audio text and optional camera frames]
F --> G[Run observer models in parallel]
F --> H[Call A2A when specialist enrichment is needed]
G --> I[Inject observer notes into Gemini context]
H --> I
I --> J[Gemini returns voice and transcript response]
J --> K[Flutter plays audio and shows transcript]
K --> L[Session ends]
L --> M[Generate summary and save data to Firestore]
Session Orchestrator receives:
- Audio chunks from the microphone.
- Optional camera frames.
- Text messages.
user_idand optionalprofile_id.
Session Orchestrator returns:
- Spoken Gemini responses.
- Input and output transcripts.
- Observer notes.
- Profile-memory status for the current session.
- Post-session summary and follow-up data saved to Firestore.
Private memory is internal context prepared by the backend for Gemini. It is called private because it is not meant to be quoted directly back to the caregiver.
It can include:
- Profile facts.
- Curated memory items.
- Patterns from recent sessions.
- Filtered community insights.
This is not the same as anonymous data. It is internal session context and must still be treated as sensitive profile data.
Moltbook Agent is not the live session agent. It works upstream.
Its job is to observe public ASD caregiver discussions, extract reusable insight, and store only anonymized insight text for later use.
Think of Moltbook as a community-learning pipeline, not a direct chat assistant for the caregiver session.
flowchart TD
A[Monitor Moltbook community activity] --> B[Read new comments and discussions]
B --> C[Extract reusable ASD caregiving insight]
C --> D[Remove direct personal identity]
D --> E[Save insight to community_insights in Firestore]
E --> F[Session Orchestrator loads recent insights]
F --> G[Relevance filter keeps only safe relevant non-contradictory items]
G --> H[Selected insights become part of private session context]
The shared Firestore layer stores anonymized community insight, not caregiver profile data from a live session.
Examples of what belongs here:
- A calming strategy that often helps in noisy places.
- A practical tip from educators for sensory overload.
- A community suggestion about managing transitions.
Examples of what should not be stored here:
- Private caregiver identity.
- Profile-specific personal notes from a child session.
- Raw conversation dumps from Session Orchestrator.
Moltbook gives NeuroDecode a second knowledge layer beyond profile memory.
Without it, Session Orchestrator only knows:
- the current child profile,
- recent sessions,
- generic model knowledge.
With Moltbook, Session Orchestrator also gains community-derived insight, as long as it is filtered so it does not contradict the child profile.
A2A Agent is a separate specialist service. It is not the main session owner and it is not the main database.
Its role is to answer focused specialist requests such as:
- ASD resource lookup.
- De-escalation guidance.
- Escalation risk assessment.
- Sensory strategy suggestions.
- Caregiver wellbeing support.
- Therapist handover drafting.
flowchart TD
A[Session Orchestrator detects a specialist need] --> B[Build short focused prompt]
B --> C[Send request to A2A Agent]
C --> D[A2A selects the right tool]
D --> E[Return concise specialist result]
E --> F[Session Orchestrator injects result into live context]
F --> G[Gemini answers caregiver with richer guidance]
- A2A communicates directly with Session Orchestrator over HTTP.
- A2A is fail-open, so if it is slow or unavailable, the live session still continues.
- A2A is not the persistent memory store for live sessions.
- A2A can enrich the current session context, but that does not automatically become long-term memory.
- A2A is also exposed as a separate agent for external ecosystems such as Prompt Opinion.
In one sentence:
- Session Orchestrator runs the session.
- Moltbook contributes community knowledge.
- A2A contributes specialist reasoning and resource lookup.
The collaboration looks like this:
- Flutter starts a live session with Session Orchestrator.
- Session Orchestrator loads profile memory and recent session patterns from Firestore.
- Session Orchestrator optionally adds filtered Moltbook insights.
- Observer models watch audio and vision signals.
- If needed, Session Orchestrator asks A2A for specialist help.
- Gemini responds using all of that context.
- After the session, Session Orchestrator saves the result back to Firestore.
The observer models are background sensors, not final decision makers.
They produce signals from:
- audio patterns,
- visual patterns.
Those signals only become observer notes when they pass a threshold.
A threshold is simply the decision boundary that says:
- below this score, do nothing,
- above this score, inject an internal observer note.
This helps the live session stay practical. The model should not interrupt Gemini for every weak signal, but it also should not miss strong signals that may indicate distress or overload.
The project keeps the training and adaptation workflow visible in the repository.
- Notebook:
Asd_Agent_Training.ipynb - Purpose: prepare and adapt audio and video pipelines used for observer features.
neurodecode_backend/app/models/autism_audio_extractor.kerasneurodecode_backend/app/models/autism_behavior_extractor.keras
These models are used as observer feature extractors during live sessions. They support context enrichment and are not positioned as clinical diagnostic models.
The notebook uses public GitHub sources from AutismBrainBehavior to help shape the project pipeline:
- https://github.com/AutismBrainBehavior/Video-Neural-Network-ASD-screening
- https://github.com/AutismBrainBehavior/Audio-Neural-Network-ASD-screening
These repositories are used to help the notebook workflow and code adaptation in this project.
The notebook references:
- video data under
data_video_skeleton/training_set,data_video_skeleton/testing_set - ASD audio data under
data_audio_noise/ASD_Audio - environmental noise audio under
data_audio_noise/UrbanSound8K/audio - UrbanSound8K as the noise audio source used in the workflow
Current implemented capabilities include:
- Live caregiver support over WebSocket with voice response.
- Optional audio plus camera session mode.
- Firestore-backed session history and summaries.
- Profile memory and child-specific personalization.
- Community insight injection through Moltbook.
- A2A specialist tools and Prompt Opinion interoperability.
- ASD clinical resource lookup.
- Push notifications and follow-up reminders.
- Flutter screens for Support, Home, Find Help, and Buddy profile workspace.
- Flutter mobile app.
- FastAPI backend.
- Separate FastAPI-based A2A service.
- Gemini Live API for real-time conversation.
- Gemini text models for filtering and summary generation.
- TensorFlow and Keras for observer models.
- Firestore for profiles, memory, sessions, notifications, and shared community insights.
- Cloud Run for backend and A2A deployment.
- Cloud Build for deployment pipelines.
- Firebase Cloud Messaging for mobile notifications.
The main README stays intentionally high-level.
For implementation details, use the component READMEs:
- Backend technical details:
neurodecode_backend/README.md - Mobile and Flutter technical details:
neurodecode_mobile/README.md - A2A service details: the
neurodecode_a2aservice folder and source files
NeuroDecode is designed so that the mobile app stays thin and the main logic stays on the cloud.
Cloud Run hosts:
- the main Session Orchestrator backend,
- the A2A Agent service,
- supporting deployed services such as the Moltbook pipeline when enabled.
Firestore is the long-term data layer for:
- profiles,
- profile memory,
- sessions,
- session events,
- notifications,
- clinical resources,
- community insights.
The Flutter app does not run orchestration logic locally.
Instead:
- Flutter sends live input to Session Orchestrator on Cloud Run.
- Session Orchestrator talks to Gemini, Firestore, observer models, and A2A.
- Flutter receives only the session outputs it needs to present to the caregiver.
NeuroDecode/
|- README.md
|- Asd_Agent_Training.ipynb
|- cloudbuild.yaml
|- cloudbuild_a2a.yaml
|- firestore.indexes.json
|- neurodecode_backend/
| |- app/
| | |- main.py
| | |- ai_processor.py
| | |- memory_context.py
| | |- relevance_filter.py
| | |- community_store.py
| | |- profile_store.py
| | |- session_store.py
| | |- notification_store.py
| | |- models/
| |- scripts/
|- neurodecode_a2a/
| |- app.py
| |- agent.py
| |- tools/
|- neurodecode_mobile/
| |- lib/
| | |- features/
| | |- config/
For local setup, use the component-specific guides:
- Backend setup and Cloud Run notes:
neurodecode_backend/README.md - Flutter app setup and Firebase notes:
neurodecode_mobile/README.md - A2A local setup:
neurodecode_a2aservice folder
NeuroDecode currently focuses on five practical outcomes:
- support the caregiver in the moment,
- remember what helps a specific child,
- reuse safe community insight,
- connect caregivers to relevant ASD resources,
- keep improving through session summaries and follow-up loops.
The long-term direction for NeuroDecode and AnakUnggul includes:
- FHIR interoperability integration so longitudinal data and AI-generated therapist handover notes can integrate securely with hospital EHR systems.
- Context-aware clinical routing using healthcare directory APIs to guide caregivers to the nearest relevant ASD clinics based on session severity.
- Longitudinal analytics dashboards by exporting Firestore data to BigQuery so therapists can track triggers, interventions, and progress over time.
- Data anonymization research to strip PII so the real-world caregiving dataset can support ASD academic research safely.
- Richer specialist skills in A2A, including more AI-agent perspectives beyond human community insight.
- More robust knowledge harvesting from scientific and professional sources.
- Clearer explainability in how memory, observers, and enrichment affect responses.
- Session Orchestrator is the main session orchestrator.
- Moltbook Agent is the community insight producer.
- A2A Agent is the specialist enrichment layer.
- Firestore remains the main persistent data layer.
- Keras observer models support real-time context enrichment, not diagnosis.