Skip to main content
Working representations are Honcho’s system for accessing cached psychological models that capture what peers know, think, and remember. Unlike the chat() method which generates fresh representations on-demand, the working_rep() method retrieves pre-computed representations that have been automatically built and stored as conversations progress.

How Working Representations Are Created

Working representations are automatically generated and cached through Honcho’s background processing system:
  1. Automatic Generation: When messages are added to sessions, they trigger background jobs that analyze conversations using theory of mind inference and long-term memory integration
  2. Cached Storage: The generated representations are stored in the database as metadata on Peer objects (for global representations) or SessionPeer objects (for session-scoped representations)
  3. Retrieval: The working_rep() method provides fast access to these cached representations without requiring LLM processing
Cached vs On-Demand: working_rep() retrieves cached representations for fast access, while peer.chat() generates fresh representations using the dialectic system. Use working_rep() when you need fast access to stored knowledge, and chat() when you need current analysis with custom queries.

Basic Usage

Working representations are accessed through the working_rep() method on Session or Peer objects:

Semantic Search in Representations

Working representations support semantic search to retrieve the most relevant observations for a given query. This is useful when you want to focus the representation on specific topics.

Parameters

Understanding Representation Content

Cached working representations contain structured psychological analysis based on conversation history. The format typically includes:

Current Mental State Predictions

Information about what the peer is currently thinking, feeling, or focused on based on recent messages.

Relevant Long-term Facts

Facts about the peer that have been extracted and stored over time from various conversations.

Example Representation Structure

When Representations Are Updated

Working representations are automatically updated through Honcho’s background processing system:

Message Processing Pipeline

  1. Message Creation: When messages are added via session.add_messages() or similar methods
  2. Background Queuing: Messages are queued for processing in the background
  3. Theory of Mind Analysis: The system analyzes conversation patterns and psychological states
  4. Fact Extraction: Long-term facts are extracted and stored in vector embeddings
  5. Representation Generation: New representations are created combining current analysis with historical facts
  6. Cache Update: The new representation is stored in the database metadata

Processing Triggers

Representations are updated when:
  • New messages are added to sessions
  • Sufficient new content has accumulated
  • The background processing system determines an update is needed

Comparison with Chat Method

Understanding when to use working_rep() vs peer.chat():

Use working_rep() when:

  • You need fast access to stored psychological models
  • You want to see what the system has already learned about a peer
  • You’re building dashboards or analytics that display peer understanding
  • You need consistent representations that don’t change between calls

Use peer.chat() when:

  • You need to ask specific questions about a peer
  • You want fresh analysis based on current conversation state
  • You need customized insights for specific use cases
  • You want to query about relationships between peers

Best Practices

1. Ensure Availability Before Using

Make sure that a representation exists before processing it by using the chat endpoint first.

2. Use for Fast Analytics

Cached representations are ideal for analytics dashboards:

3. Combine with Fresh Analysis When Needed

Use cached representations for baseline understanding, and fresh analysis for current insights:

Conclusion

Working representations provide fast access to cached psychological models that Honcho automatically builds and maintains. By understanding how to:
  • Retrieve cached representations using session.working_rep()
  • Parse and interpret representation content
  • Handle cases where representations aren’t available
  • Combine cached and fresh analysis appropriately
You can build efficient applications that leverage Honcho’s continuous learning about peer knowledge and mental states without the latency of real-time generation.