---
title: "Six Ideas — Context Infrastructure"
description: "Six ideas explain almost everything Alchemyst does."
canonical: "https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/six-ideas"
last_updated: "2018-10-20"
book: "Context Infrastructure"
label: "Chapter 3"
---

# Six Ideas

Six ideas explain almost everything Alchemyst does. Builders will meet them as API parameters, stakeholders as outcomes, team leaders as policies.

## Idea 1: Context arithmetic

Context arithmetic is the set of rules by which Alchemyst selects, combines, filters and ranks context at query time. Think of it as set algebra over meaning rather than a database query: the final window is *computed* from scope, intent, constraints and relevance.

**Context arithmetic turns a large corpus into a small, correct window.** Worked example: "How do we handle JWT refresh tokens in API v2?"

| Operation, applied at query time | What it does in the example |
| --- | --- |
| **∪ Union: semantic matches** — docs, code, PRs, incidents, combined | Every chunk about JWT refresh tokens, from any source |
| **∩ Intersect: groupName** — a document must carry every tag | Keep chunks tagged engineering, backend and auth |
| **∩ Intersect: metadata** — exact-match filters | Keep chunks where version = v2 |
| **− Subtract** — superseded, duplicate, out of scope | Drop deprecated specs, drafts and near-duplicates |
| **Rank, then keep the top K** — similarity, recency, metadata signals | The top 5 survivors enter the model's context window |

*Figure 3.1 · Context arithmetic, step by step*

Out of a corpus of, say, 50,000 documents, the model never sees frontend docs, marketing material or outdated auth specs. Nobody filtered them by hand; the arithmetic removed them. Union widens recall, intersection sharpens precision, and good context design balances the two.

## Idea 2: groupName scoping

Every document carries a `groupName`: an array of tags. A search filter matches a document only when the document carries **all** the filter's tags. With three documents A `[main, g1]`, B `[main, g2]`, C `[main, g1]`:

| Search filter | Matches | Why |
| --- | --- | --- |
| `[main]` | A, B, C | All three carry `main` |
| `[main, g1]` | A, C | B lacks `g1` |
| `[g1]` | A, C | Only A and C carry `g1` |
| `[main, g3]` | none | No document carries both |

The filter defines a scope; documents must fall inside it. This is what makes scopes composable without asking the whole organisation to agree on one taxonomy first.

## Idea 3: Context Traces

When an agent gives a wrong answer about internal data, inspect what it retrieved before touching the prompt. A Context Trace records the sources, scores and rules that assembled each context window. Developers use it to separate retrieval failures from model failures; compliance and business teams use it to see which information supported an answer.

## Idea 4: Canonical business definitions

When "revenue" means different things to GTM and Finance, both definitions are stored, each scoped to its team (`["gtm", "revenue"]` and `["finance", "revenue"]`). A CXO's query scoped to `["revenue"]` sees both, clearly separated, instead of a silent blend. Underneath, Alchemyst layers **references** (raw data) and **inferences** (derived meanings); an inference at one layer becomes a reference for the next, which is how meanings are reconciled as the business changes.

## Idea 5: Memory and knowledge come from one graph

Agent memory (what happened in earlier interactions) and a knowledge base (policies, product docs) are different things, and most agents need both. Alchemyst stores both in one institutional knowledge graph and derives memory behaviours from scope: recall what happened, resolve what it means, inform how to act. Memory types are outcomes of the arithmetic, not separate modules.

## Idea 6: A sidecar, not a replacement

Existing databases, models, telephony and agents stay in place. Alchemyst sits underneath them and changes what they can see. That is why a pilot can start under an agent a customer already runs, without migrating anything.

---

- Previous: [Chapter 2: The Layer](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/the-layer.md)
- Contents: [Context Infrastructure](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business.md)
- Next: [Chapter 4: The Map](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/the-map.md)
