Skip to main content
Honcho provides a sophisticated filtering system that allows you to query workspaces, peers, sessions, and messages with precise control. The filtering system supports logical operators, comparison operators, metadata filtering, and wildcards to help you find exactly what you need.

Basic Filtering Concepts

Filters in Honcho are expressed as dictionaries that define conditions for matching resources. The system supports both simple equality filters and complex queries with multiple conditions.

Simple Filters

The most basic filters check for exact matches:

Logical Operators

Combine multiple conditions using logical operators for complex queries:

AND Operator

Use AND to require all conditions to be true:

OR Operator

Use OR to match any of the specified conditions:

NOT Operator

Use NOT to exclude specific conditions:

Combining Logical Operators

Create sophisticated queries by combining different logical operators:

Comparison Operators

Use comparison operators for range queries and advanced matching:

Numeric Comparisons

List Membership

Metadata Filtering

Metadata filtering is particularly powerful in Honcho, supporting nested conditions and complex queries:

Basic Metadata Filtering

Advanced Metadata Queries

If you want to do advanced queries like these, make sure not to create metadata fields that use the same names as the included comparison operators! For example, if you have a metadata field called contains, it will conflict with the contains operator.

Wildcards

Use wildcards (*) to match any value for a field:

Resource-Specific Examples

Filtering Workspaces

Filtering Messages

Filtering Conclusions

Conclusions are scoped to an observer/observed peer pair (accessed via peer.conclusions for self-conclusions or peer.conclusions_of(target) for conclusions about another peer). The observer and observed are filled in automatically by the scope, so the filters you pass add to them. The most useful conclusion-specific field is level, the reasoning level:
  • explicit — extracted directly from messages
  • deductive / inductive / contradiction — derived later during dreaming
A common request is to surface only the directly-stated facts and exclude anything inferred during dreaming — filter level to explicit:

Error Handling

Handle filter errors gracefully:

Conclusion

Honcho’s filtering system provides powerful capabilities for querying your conversational data. By understanding how to:
  • Use simple equality filters and complex logical operators
  • Apply comparison operators for range and pattern matching
  • Filter metadata with nested conditions
  • Handle wildcards and dynamic filter construction
  • Follow best practices for performance and validation
You can build sophisticated applications that efficiently find and process exactly the conversations, messages, and insights you need from your Honcho data.