> ## Documentation Index
> Fetch the complete documentation index at: https://docs.curtly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Welcome to your project

Curtly is a deterministic compression engine that sits directly in front of LLM calls to reduce input token volume before dispatch. It strips conversational padding, verbose boilerplate, and syntactic fluff while strictly isolating code blocks, JSON schemas, template variables, and regex patterns.

***

## Core Characteristics

<CardGroup cols={3}>
  <Card title="In-Memory AST Pipeline" icon="gauge-high">
    Runs entirely in volatile memory with sub-3ms latency. No network hops or secondary LLM calls.
  </Card>

  <Card title="Deterministic Token Pruning" icon="arrow-down-right">
    Removes low-entropy filler words, conversational padding, and redundant determiners systematically.
  </Card>

  <Card title="Immutable Safe Vault" icon="shield-check">
    Guarantees 0.00% syntax drift by vaulting code fences, JSON structures, and interpolation tags before processing.
  </Card>
</CardGroup>

***

## The Input Token Problem

Production prompts, multi-agent messages, and RAG document injections accumulate significant non-essential token overhead:

* **System Scaffolding**: Instructions often contain repetitive guidance, politeness prefixes, and verbose role definitions.
* **Retrieved Context Bloat**: Document fragments, Markdown tables, and structured chunks contain redundant headers, excessive whitespace, and conversational transitions.
* **Direct Impact**: Input token volume directly dictates time-to-first-token (TTFT) and per-request inference cost across all downstream model providers.

***

## Processing Pipeline

```mermaid theme={"dark"}
graph LR
    A[Raw Input Text] --> B[1. AST Boundary Scan & Vault]
    B --> C[2. Scaffolding Simplifier]
    C --> D[3. Information Density Pruner]
    D --> E[4. Safe Vault Rehydration]
    E --> F[Optimized Output]
```

1. **AST Scan & Vaulting**: Identifies code fences, JSON objects, mustache variables (`{{var}}`), and regex expressions. Replaces them with atomic placeholder tokens in memory.
2. **Scaffolding Simplifier**: Condenses verbose system directives into direct instructions (e.g. role and task indicators).
3. **Density Pruning**: Prunes low-entropy qualifiers, hedging, and filler adverbs while protecting logic anchors (`never`, `must`, `only`).
4. **Vault Rehydration**: Restores the vaulted code and JSON contents into exact coordinates with complete byte-level fidelity.

***

## Architectural Guarantees

* **Zero Data Retention**: Prompts and compressed outputs exist only in server RAM during active execution. No prompt text is written to persistent storage, cached in secondary layers, or used for model training.
* **Structural Integrity**: Fenced code blocks and JSON schemas remain unmodified, preventing parser errors in downstream tools.
* **Reproducibility**: The compression algorithm is deterministic. Identical input in the same mode produces identical output.
