Skip to content

Commit 4e70441

Browse files
docs: replace em-dashes with prepositions and colons throughout README
Co-authored-by: Ona <no-reply@ona.com>
1 parent b4a4af6 commit 4e70441

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
**Open-source context preprocessing for LLM applications.**
1212

13-
Distill sits between your application and any LLM. It cleans up context before it's sent deduplicating semantically redundant chunks, compressing conversation history as it ages, and placing cache markers on stable content so Anthropic's prompt cache actually fires.
13+
Distill sits between your application and any LLM. It cleans up context before it's sent: deduplicating semantically redundant chunks, compressing conversation history as it ages, and placing cache markers on stable content so Anthropic's prompt cache actually fires.
1414

1515
The result: fewer tokens sent, lower cost per request, and context windows that don't fill up with noise.
1616

1717
**[Learn more →](https://distill.siddhantkhare.com)**
1818

19-
> 📖 Distill implements the 4-layer context engineering stack described in **[The Agentic Engineering Guide](https://agents.siddhantkhare.com/05-context-engineering-stack/)**a free, open book on AI agent infrastructure.
19+
> 📖 Distill implements the 4-layer context engineering stack described in **[The Agentic Engineering Guide](https://agents.siddhantkhare.com/05-context-engineering-stack/)**, a free open book on AI agent infrastructure.
2020
2121
```
2222
RAG / tools / memory / docs
@@ -29,7 +29,7 @@ RAG / tools / memory / docs
2929

3030
## The Problem
3131

32-
3040% of context assembled from multiple sources is semantically redundant. The same information arrives from docs, code, memory, and tool outputs competing for attention in the same prompt.
32+
30-40% of context assembled from multiple sources is semantically redundant. The same information arrives from docs, code, memory, and tool outputs, all competing for attention in the same prompt.
3333

3434
This causes non-deterministic outputs, confused reasoning, and failures that only show up at scale. Better prompts don't fix it. The context going in needs to be clean.
3535

@@ -40,7 +40,7 @@ No LLM calls. Fully deterministic. ~12ms overhead.
4040
| Stage | What it does |
4141
|-------|-------------|
4242
| **Deduplicate** | Cluster semantically similar chunks, keep one representative per cluster |
43-
| **Compress** | Extractive compression remove noise, preserve signal |
43+
| **Compress** | Extractive compression to remove noise and preserve signal |
4444
| **Summarize** | Progressively condense conversation history as turns age |
4545
| **Cache** | Annotate stable prefixes with `cache_control`, track TTL per prefix |
4646

@@ -52,10 +52,10 @@ All four stages chain together via `POST /v1/pipeline` or `distill pipeline` CLI
5252
Query → Over-fetch (50) → Cluster → Select → MMR Re-rank (8) → LLM
5353
```
5454

55-
1. **Over-fetch** retrieve 3–5× more chunks than needed
56-
2. **Cluster** group semantically similar chunks (agglomerative clustering)
57-
3. **Select** pick the best representative from each cluster
58-
4. **MMR Re-rank** balance relevance and diversity
55+
1. **Over-fetch** - retrieve 3-5x more chunks than needed
56+
2. **Cluster** - group semantically similar chunks (agglomerative clustering)
57+
3. **Select** - pick the best representative from each cluster
58+
4. **MMR Re-rank** - balance relevance and diversity
5959

6060
**Result:** Deterministic, diverse context. No LLM calls. Fully auditable.
6161

@@ -684,7 +684,7 @@ Record Anthropic API usage with `metrics.RecordCacheUsage(UsageRecord{...})` aft
684684
| `distill_cache_read_tokens_total` | Counter | Tokens read from Anthropic cache (charged at 0.10× input price) |
685685
| `distill_uncached_input_tokens_total` | Counter | Uncached input tokens (charged at 1.00×) |
686686
| `distill_cache_hit_rate` | Gauge | Rolling hit rate: `cache_read / (cache_read + cache_creation + input)` |
687-
| `distill_cache_write_efficiency` | Gauge | Reads/writes ratio — values < 1.0 mean cache writes that expire before being read |
687+
| `distill_cache_write_efficiency` | Gauge | Reads/writes ratio. Values below 1.0 mean cache writes that expire before being read |
688688

689689
**Per-call-site hit rate tracking**
690690

@@ -792,8 +792,8 @@ The `DecayWorker` emits typed events on every state transition so that cache bou
792792

793793
| Event | When | Cache boundary action |
794794
|-------|------|-----------------------|
795-
| `EventCompressed` | Entry compressed to summary or keywords | Retreat boundary cached prefix is now stale |
796-
| `EventEvicted` | Entry removed from store | Retreat boundary entry no longer exists |
795+
| `EventCompressed` | Entry compressed to summary or keywords | Retreat boundary: cached prefix is now stale |
796+
| `EventEvicted` | Entry removed from store | Retreat boundary: entry no longer exists |
797797
| `EventStabilized` | Entry promoted to stable | Advance boundary to include entry |
798798

799799
Register a handler on any `Store`:
@@ -813,8 +813,8 @@ Multiple handlers can be registered; they are called in registration order. Hand
813813
```go
814814
result, _ := store.Recall(ctx, req)
815815
if result.CacheHint != nil {
816-
// result.CacheHint.StableEntryIDs IDs likely stable this turn
817-
// result.CacheHint.ConfidenceScore mean relevance of returned entries
816+
// result.CacheHint.StableEntryIDs - IDs likely stable this turn
817+
// result.CacheHint.ConfidenceScore - mean relevance of returned entries
818818
}
819819
```
820820

@@ -861,7 +861,7 @@ session:
861861
KV cache for repeated context patterns (system prompts, tool definitions, boilerplate). Sub-millisecond retrieval for cache hits.
862862

863863
- **MemoryCache** - In-memory LRU with TTL, configurable size limits (entries and bytes), background cleanup
864-
- **PatternDetector** - Identifies cacheable content and emits `CacheAnnotation` per chunk. Use `AnnotateChunksForCache` to get a `CacheControlPlan` up to 4 `cache_control` markers (Anthropic's limit) placed at the highest-token-count stable chunks. Auto-placement is skipped when the caller has already set markers manually.
864+
- **PatternDetector** - Identifies cacheable content and emits `CacheAnnotation` per chunk. Use `AnnotateChunksForCache` to get a `CacheControlPlan` with up to 4 `cache_control` markers (Anthropic's limit) placed at the highest-token-count stable chunks. Auto-placement is skipped when the caller has already set markers manually.
865865
- **PrefixPartition** - Splits a chunk slice into a frozen cache prefix and a dedup-eligible suffix. Used by the `preserve_cache_prefix` dedup option to prevent Distill from reordering chunks that appear before a `cache_control` breakpoint.
866866
- **StabilityValidator** - Tracks prefix hashes across requests and detects dynamic content bleeding into cached prefixes. Reports instability with a likely cause and supports static text analysis for pre-flight checks.
867867
- **RedisCache** - Interface for distributed deployments (requires external Redis)
@@ -908,7 +908,7 @@ tracker := cache.NewTTLTracker(0) // 0 = use AnthropicCacheTTL (5 min)
908908
// After each request that carries a cache_control marker:
909909
wasAlive := tracker.Touch(plan.PrefixHash)
910910
if !wasAlive {
911-
log.Warn("cache cold start first request or TTL expired")
911+
log.Warn("cache cold start: first request or TTL expired")
912912
}
913913
914914
// For batch workloads: latest safe time to send next request
@@ -922,15 +922,15 @@ fmt.Printf("hits: %d misses: %d alive: %v\n", entry.HitCount, entry.MissCount,
922922

923923
#### Prefix stability validator
924924

925-
Detects dynamic content (timestamps, request IDs, UUIDs) bleeding into cached prefixes the most common cause of 0% cache hit rates:
925+
Detects dynamic content (timestamps, request IDs, UUIDs) bleeding into cached prefixes, which is the most common cause of 0% cache hit rates:
926926

927927
```go
928928
validator := cache.NewStabilityValidator(cache.DefaultStabilityConfig())
929929
930-
// Runtime check call on every request
930+
// Runtime check, call on every request
931931
issues := validator.Check("agent/planner.go:84", chunks)
932932
for _, issue := range issues {
933-
log.Warnf("%s", issue) // "cache-prefix-unstable: stability=12% likely dynamic interpolation: request id"
933+
log.Warnf("%s", issue) // "cache-prefix-unstable: stability=12%, likely dynamic interpolation: request id"
934934
}
935935
936936
// Static pre-flight check
@@ -1178,7 +1178,7 @@ For commercial licensing, contact: siddhantkhare2694@gmail.com
11781178

11791179
- [Website](https://distill.siddhantkhare.com)
11801180
- [Playground](https://distill.siddhantkhare.com/playground)
1181-
- [The Agentic Engineering Guide](https://agents.siddhantkhare.com) the book behind the concepts Distill implements
1181+
- [The Agentic Engineering Guide](https://agents.siddhantkhare.com) - the book behind the concepts Distill implements
11821182
- [FAQ](FAQ.md)
11831183
- [Blog Post](https://dev.to/siddhantkcode/the-engineering-guide-to-context-window-efficiency-202b)
11841184
- [MCP Configuration](mcp/README.md)

0 commit comments

Comments
 (0)