Comprehensive documentation for the composeState
method and Providers in v1.x
Important: This guide provides comprehensive documentation for the composeState
method and Providers in v1.x, including comparisons with v0.
composeState
method is the central mechanism for building the context state that powers agent responses. In v1, it has been enhanced with powerful filtering capabilities.
composeState
method introduces filtering capabilities for performance optimization:
agentId
- Agent’s UUIDagentName
- Agent’s display namebio
- Agent biography (string or selected from array)lore
- Random selection of lore bitsadjective
- Random adjective from charactertopic
/ topics
- Agent’s interestsrecentMessages
- Formatted recent messagesrecentMessagesData
- Raw message Memory objectsrecentPosts
- Formatted posts in threadattachments
- Formatted attachment informationrecentMessageInteractions
- Past interactions as messagesrecentPostInteractions
- Past interactions as postsrecentInteractionsData
- Raw interaction Memory[]characterPostExamples
- Example posts from charactercharacterMessageExamples
- Example conversationsmessageDirections
- Message style guidelinespostDirections
- Post style guidelinesroomId
- Current room UUIDactors
- Formatted actor informationactorsData
- Raw Actor[] arraysenderName
- Name of message sendergoals
- Formatted goals stringgoalsData
- Raw Goal[] arrayactionNames
- Available action namesactions
- Formatted action descriptionsactionExamples
- Action usage examplesevaluators
- Formatted evaluator informationevaluatorNames
- List of evaluator namesevaluatorExamples
- Evaluator examplesevaluatorsData
- Raw Evaluator[] arrayknowledge
- Formatted knowledge textknowledgeData
- Knowledge itemsragKnowledgeData
- RAG knowledge itemsproviders
- Additional context from providersdynamic
Propertytrue
for providers that return different data based on context:
position
Propertyprivate
PropertyskipCache
name
ProviderResult
objectget
methodname
property to all providersProviderResult
format?
from state parameter in get methoddescription
for documentationdynamic: true
for context-dependent providersupdateRecentMessageState
with filtered composeState