In BrainSoup, a Context represents a real-time, dynamic set of data that is injected directly into the working memory of the agents. This mechanism provides agents with an enriched comprehension of their operating environment and enables relevant interactions.

A context in BrainSoup is identified by a uniquely defined subject. This context subject acts as a subscription point for chat rooms or individual agents. Upon subscription, the context data becomes immediately accessible to the respective agent, enhancing their response capabilities.

It is important to consider the size and optimization of the context. Context sizes have a direct impact on the cost of using the agent; smaller and optimized contexts contribute to cost-effective utilization.

BrainSoup provides a set of predefined context subjects, including a BrainSoup subject. This subject presents useful data about the application that assists the agent in user guidance and interactions within BrainSoup.

Custom Context

BrainSoup supports the creation of Custom Contexts. These user-generated contexts allow for a deeper real-time, user-specific data alignment. Custom contexts are defined by placing a JSON-formatted file within the Context folder.

Consider the below example which defines a custom context to represent daily key performance indicators (KPIs):


"ecommerce": {

"dailyKPIs": {

"visitors": 13456,

"orders": 3456,

"revenue": 45678.9




Agents subscribing to this context subject will immediately update their working memory with the latest KPIs.

Structure and naming of custom contexts are entirely flexible within the limits of the JSON format. This property encourages comprehensive scripting possibilities for custom context generation and facilitates raw web API output integration.

To summarize, contexts in BrainSoup can be dynamically updated, and agents and chat rooms can be efficiently linked to specific contexts. This functionality empowers BrainSoup users in effectively customizing agent behavior.