Contextual Awareness
Contextual Awareness gathers proactive notifications at session start by querying the Rules Engine, Project Memory, and Agent Memory. These notifications surface pending actions, unresolved findings, and reminders without the user having to ask.
Notification types
| Type | Priority | Source | Example |
|---|---|---|---|
rule_proposal | high | Rules Engine | "Proposed rule: 'use strict mode' — confirm or reject" |
unresolved_finding | medium | Project Memory | "Finding from last session: race condition in auth module" |
agent_reminder | medium | Agent Memory | "TODO: update API docs after refactor" |
convention_violation | high | Rules Engine | "Convention violated: missing JSDoc in src/api/" |
stale_memory | low | Agent Memory | "5 memories haven't been used in 30 days" |
project_stats | low | Multiple | "KG: 1,234 triples — 45 conventions, 12 decisions" |
How it works
At session_start, the gatherNotifications() method:
- Queries the Rules Engine for pending proposals (learned, disabled rules)
- Queries Project Memory for recent unresolved findings
- Searches Agent Memory for entries containing "TODO", "reminder", or "remember to"
- Compiles project statistics from available sources
- Sorts by priority (high → medium → low)
Notifications are injected into the session context as:
xml<session-notifications> [!] Proposed rule: 'use strict mode' — confirm or reject with `mayros rules confirm|reject` [*] Finding from last session: race condition in auth module [-] KG: 1,234 triples — 45 conventions, 12 decisions </session-notifications>
Priority indicators: [!] high, [*] medium, [-] low.
Notification flow
mermaidflowchart TD A[Session start] --> B[Gather notifications] B --> C[Query Rules Engine] B --> D[Query Project Memory] B --> E[Query Agent Memory] C --> F[Pending proposals] D --> G[Unresolved findings] E --> H[Agent reminders] F --> I[Sort by priority] G --> I H --> I I --> J[Inject into session context]
Related
- Rules Engine — hierarchical rules
- Project Memory — project-level memory
- Agent Memory — per-agent persistent memory
- Sessions — session fundamentals