Platform · context
Portal Context — Proactive Intelligence Layer
Event ingestion, workspace modeling, context extraction, template synthesis, and notification management. Builds a real-time model of what the user is doing and proactively surfaces relevant information.
Architecture
Overview
portal-context is the proactive intelligence layer that observes system events (window changes, app launches, voice commands, file operations) and builds a real-time model of the user's current context. It ingests events from multiple sources, extracts structured context (what apps are active, what task is being performed, what time of day it is), synthesizes narrative descriptions from raw event sequences, and manages proactive notifications. The system can answer queries about the current workspace state and power proactive suggestions. The crate exposes PortalContext as its top-level API — construct it with a config path, call start(), then use query() and telemetry().
Key Types
Modules
event_ingestion
Event ingestion — receives events from system sources (window manager, voice, PCP), normalizes, timestamps.
context_extraction
Context extraction — analyzes event stream to build structured context (active apps, current task, environment).
workspace_model
Workspace model — tracks window layout, app relationships, task transitions over time.
template_synthesis
Template synthesis — generates human-readable narratives from raw context data ('You're editing a document in LibreOffice').
notification_manager
Notification management — decides when and how to surface proactive suggestions, manages notification lifecycle.
decision_engine
Decision engine — evaluates rules against context to determine if a proactive action should be taken.
proactive
Proactive system — generates suggestions based on context (e.g., 'Would you like to open your email?').
default_rules
Default rules — built-in decision rules for common scenarios.
pcp_bridge
PCP push event bridge — connects PCP capability events to the context pipeline (feature-gated, not yet wired).
llm_interface
LLM interface — client for portal-llm daemon, used for context summarization.
voice_client
Voice client — connects to portal-voiced for voice-triggered context queries.
Data Flow
System events → event_ingestion → context_extraction → workspace_model → decision_engine → [notification_manager|proactive] → user notification
Dependencies
Internal (3)
External (13)
Connects to portal-voiced and portal-llmd via IPC. Future: PCP push bridge for capability events.