Technical Reports / TR-2025-22
—v1.0.0
Context Assembly & Ranking
Specification for Mavaia's Context Priority System (CPS) achieving 85% ranking relevance and 420ms assembly latency. Documents semantic ranking, recency weighting, and priority scoring algorithms.
Report ID
TR-2025-22
Type
Technical Analysis
Date
2025-11-08
Version
v1.0.0
Authors
Cognitive Architecture Team
Abstract
We present the Context Priority System, a ranking framework that assembles and prioritizes contextual information for language model inference. The system achieves 85% ranking relevance with 420ms assembly latency for complex multi-workspace queries.
1. Introduction
Language models operate under context window constraints that require careful selection of information to include in each inference request. The Context Priority System addresses this challenge by assembling relevant context from multiple sources (conversation history, workspace state, memory retrieval, emotional tags) and ranking information by relevance, recency, and user priorities. Unlike simple chronological context or semantic-only retrieval, CPS implements multi-factor scoring that balances topical relevance with temporal importance and user-indicated priorities. The system operates in three stages: Context Source Aggregation (gathering all available context), Multi-Factor Ranking (scoring context items by relevance), and Window-Constrained Selection (choosing highest-priority items within token limits).
2. Methodology
CPS assembles context from five sources: immediate conversation history (last 5-10 turns), ARTE memory retrieval (semantically similar past interactions), workspace state (current files, focus session metadata), emotional tags (user-important interactions), and system state (integration status, available tools). Multi-factor ranking computes composite scores combining semantic similarity (cosine similarity between query and context item embeddings, weighted 0.4), recency (exponential decay from current time, weighted 0.3), user priority signals (explicit bookmarks, emotional tags, weighted 0.2), and conversation continuity (references to prior context items, weighted 0.1). Window-constrained selection performs greedy selection of highest-scored items until approaching model context limit, maintaining conversation history as required baseline.
3. Results
CPS evaluation across 5,000 queries showed 85% ranking relevance (user-validated assessment that top-ranked context was appropriate). Context assembly latency averaged 180ms for simple queries with minimal context and 420ms for complex multi-workspace queries with extensive memory retrieval. Semantic similarity component achieved 0.78 average score for relevant context items versus 0.31 for irrelevant items. Recency weighting successfully prioritized recent interactions while preserving important older context when emotionally tagged. The multi-factor approach outperformed semantic-only ranking by 12 percentage points and chronological-only context by 23 percentage points in user-validated relevance assessments.
4. Discussion
CPS demonstrates that context selection requires multi-factor ranking rather than single-dimension prioritization. Semantic similarity alone misses temporally important recent developments, while pure recency ignores relevant historical context. The four-factor model (semantic 0.4, recency 0.3, priority 0.2, continuity 0.1) balances these concerns effectively, achieving 85% user-validated relevance. The 420ms assembly latency for complex queries is acceptable given the quality improvement over simpler approaches. The system's architectural separation between context assembly and model inference enables independent optimization of each component. The greedy selection algorithm proves sufficient for most queries, though optimal subset selection might improve ranking further.
5. Limitations
Current limitations include: (1) Fixed weighting (0.4, 0.3, 0.2, 0.1) doesn't adapt to query type or user preferences, (2) Greedy selection may miss optimal context combinations that require lookahead, (3) Context window limits handled reactively through truncation rather than proactively through summarization, (4) The system doesn't explicitly model context dependencies (some items only relevant if others are included), (5) Emotional priority signals (0.2 weight) may be under-weighted for personally important interactions, (6) Cross-workspace context not yet aggregated, limiting context assembly for multi-project queries, (7) Assembly latency increases linearly with context sources without optimization.
6. Conclusion
The Context Priority System provides multi-factor ranking for contextual information assembly in AI assistants. The 85% ranking relevance validates that semantic similarity, recency, user priorities, and conversation continuity together produce effective context selection. Future work will focus on adaptive weighting based on query type, optimal subset selection algorithms, proactive context summarization, dependency modeling between context items, and cross-workspace context aggregation for multi-project assistance.