Contexts and Agents
How things get done in your Poliglot workspace.
You already work in contexts every day. When you sit down to handle a procurement request, you're operating in a context: you have the request in front of you, you know which systems to check, you remember what happened last time, you make observations about the current state, you take actions, you get approvals, and you move on. When you switch to a hiring workflow, you context-switch: different systems, different information, different decisions. When you come back to the procurement request tomorrow, you pick up where you left off.
A context in Poliglot is the digital version of this, except it's all in one place. It's a persistent working environment where RARS operates the same way: observing the state of systems, making changes, seeking approvals, building up knowledge as it works. Every command, action, observation, and decision lives in the same shared state. When you come back to it later, everything is where you left it.
This is the most foundational concept in Poliglot. Everything else (matrices, actions, security, provenance) exists to make contexts work.
The Context Graph
At the center of every context is a semantic knowledge graph. This is the state management system where all operational state lives: the domain data your matrices define, the observations RARS makes, the process traces of what happened, and the conversation history itself. It's all one unified, queryable graph.
RARS will activate a matrix just-in-time when it requires relevant business logic, and can immediately operate on the defined concepts and invoke relevant actions. Multiple matrices can be active simultaneously, and RARS reasons across all of them as a single concept space.
This graph is persistent. It gets checkpointed so that contexts survive restarts. When you return to a context, the full state is restored, matrices are re-activated, and RARS picks up where it left off.
How RARS Works
You interact with a context through natural language. RARS receives each command directly and operates in a continuous iteration loop: reasoning about what to do, planning, executing operations, and observing the state of your operations.
RARS manipulates your resources through a language called SPARQL. It reads the graph state, invokes actions as functions, constructs new data, and writes it back to the graph. RARS handles execution transparently: resolving service integrations, mapping responses, tracking provenance, validating against shapes.
In addition to your intent, RARS understands three key things:
- The Active Matrix: high-level instruction provided by the activated domain(s)
- Semantic memory: detailed documentation (class definitions, action signatures, properties) specifically selected for a concept's relevance and operational utility
- Working memory: your materialized operational resources selected from queries and workflow results
RARS builds up knowledge over the course of a conversation. As it queries data and executes workflows, the selected results accumulate in working memory. As it discovers new domains and uses concepts, their schemas accumulate in semantic memory.
Matrix Activation
Matrices are activated through two distinct mechanisms:
Explicit activation: RARS activates a matrix directly when it needs to understand a domain for reasoning. If you ask about project management and the project matrix isn't yet active, RARS recognizes it needs that domain's concepts and explicitly activates it. This is a deliberate reasoning decision by RARS.
Lazy activation: when an internal process (an action invocation, a script execution) encounters a namespace prefix from an inactive matrix, the runtime activates that matrix automatically. This is transparent to RARS and to you. For example, if a task action returns data referencing people:Person and the people matrix isn't active, it activates in the background so the data can be properly resolved.
In both cases, the activation result is the same: the matrix's ontology, shapes, and actions merge into the context graph and become immediately available.
This means you don't need to manually configure which matrices are active. Domains load as your workload requires them. This is also why matrix modularity matters (see Modeling Your Domain). Each activation brings a domain's concepts into RARS's working context. Well-modularized matrices keep RARS focused on what's relevant to the current work.
Discovery
RARS can discover new domains during a conversation. If you ask about something that isn't covered by currently activated matrices, RARS can search your workspace's semantic index for relevant matrices. When it finds a match, it explicitly activates the matrix and its capabilities become immediately available.
Over time, RARS builds a rich understanding of the relevant operating model.
Context Lifecycle
Contexts are persistent environments with a defined lifecycle:
Provisioning: when you open a context, a dedicated runtime is provisioned and the knowledge graph is initialized. If the context has been used before, its checkpointed state is restored: the full graph, conversation history, and activated matrices are all brought back.
Working: the active state where you and RARS interact. Matrices activate, workflows execute, the graph accumulates state. This is where the work happens.
Checkpointing: the full context state (graph data, conversation history, memory) is saved automatically after work completes. This happens asynchronously and doesn't interrupt the session. The checkpoint captures everything needed to fully restore the context later.
Restoration: when you return to a context after the runtime has been reclaimed, a new runtime is provisioned and the graph is restored from the checkpoint. Matrices are re-activated, inferences are rebuilt, and the conversation continues where it left off. Hot reconnects (when the runtime is still alive) are near-instant.
Contexts are not ephemeral chat sessions. They're persistent working environments that accumulate knowledge and state over time. A context used for project management today has the full history of observations, decisions, and data when you return to it tomorrow.
Summary
- Contexts are how we work: persistent working environments, the digital version of a business context
- The graph is the state: all operational data, observations, process traces, and conversation history live in one unified, queryable graph
- Two activation paths: RARS explicitly activates matrices for reasoning, the runtime lazily activates them when processes encounter new namespaces
- Knowledge accumulates: working memory and semantic memory build up over the session and persist through checkpoints
- Discovery is live: RARS finds and activates new domains during conversation
- Contexts persist: checkpointed state survives restarts, so conversations continue where they left off