Cedar’s mention system allows users to reference specific data, people, or objects in their messages using @ symbols. This provides a natural way to give agents precise context about what the user is referring to.Documentation Index
Fetch the complete documentation index at: https://docs.cedarcopilot.com/llms.txt
Use this file to discover all available pages before exploring further.
State-Based Mentions using useStateBasedMentionProvider
Prerequisite – the state referenced byAutomatically allows the user to @ mention any registered state items. The state must first be a cedarState. See the Agentic State documentation.stateKeymust already be registered in Cedar withuseCedarStateoruseRegisterState.
Custom Rendering
Customize how mentions appear in different contexts:Multiple Mention Types
Support different mention triggers:Contextual Mentions
Show different mentions based on context:Ordering Mentions
When you have multiple mention providers or context subscriptions, you can control their display order using theorder property. This ensures the most important context appears first in the UI.
Order Property
Theorder property (optional) determines the display order of context badges:
- Lower numbers appear first:
order: 1appears beforeorder: 10 - Default behavior: Items without an order appear last
- Applies to both: Mention providers and
useSubscribeInputContext
Example: Prioritized Mentions
Custom Provider with Order
When usinguseStateBasedMentionProvider, include order:
Best Practices for Ordering
- Reserve low numbers (1-9) for critical context like user info
- Use 10-49 for active/selected items
- Use 50-99 for general mentions
- Use 100+ for archived or low-priority items
- Leave gaps between orders for future additions
Mention Data in Context
Access mentioned items in your agent context:Next Steps
- Explore state access patterns
- Learn about spells and shortcuts

