TVC Distributed Learning
TVC (Ternary Vector Corpus) is Trinity's distributed continual learning system. It provides zero-forgetting knowledge storage using ternary vector embeddings, bundled into a persistent corpus for instant retrieval.
Commandsโ
tvc-demoโ
Interactive demonstration of the TVC distributed learning system.
Aliases: tvc
tri tvc-demo
Shows:
- Corpus architecture and configuration
- Hit/miss semantics with cosine similarity
- Bundling and retrieval demo
- Distributed learning flow
Example output:
TVC DISTRIBUTED LEARNING โ DEMO
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Architecture:
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Query โโโโโโ TVC Corpus โ
โ (embed) โ โ 10K entries โ
โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโดโโโโโโโโโ
โ Similarity โฅ ฯโปยนโ
โ (0.618)? โ
โโโโโโโโโโฌโโโโโโโโโ
YES โ NO
โโโโโโโโโ โ โโโโโโโโโ
โ CACHE โ โ LLM โ
โ HIT โ โ CALL โ
โโโโโโโโโโ โโโโโโโโโ
Configuration:
Capacity: 10,000 entries (100x TextCorpus)
Dimensions: 1,000 trits per vector
Threshold: phi^-1 = 0.618
Encoding: Ternary {-1, 0, +1}
File format: .tvc (TVC1 magic header)
Memory: ~26 MB heap-allocated
tvc-statsโ
Display TVC corpus configuration and statistics.
tri tvc-stats
Example output:
TVC STATISTICS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TVC Enabled: Ready
Max Entries: 10,000
Vector Dimension: 1,000 trits
Threshold: 0.618 (phi^-1)
File Format: .tvc (TVC1 magic)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Architectureโ
How TVC Worksโ
- Query embedding: User input is converted to a 1,000-trit ternary vector
- Similarity search: Cosine similarity is computed against all corpus entries
- Threshold check: If similarity , it's a cache hit
- Hit: Return cached response instantly (no LLM call needed)
- Miss: Call LLM, then store the query-response pair in the corpus
Zero-Forgetting Bundlingโ
TVC uses the VSA bundle operation (majority vote) to accumulate all learned patterns into a single memory_vector. This means:
- No patterns are ever discarded
- New knowledge is bundled with existing knowledge
- Retrieval uses cosine similarity against the bundled vector
- Capacity: 10,000 discrete entries + 1 bundled memory vector
Comparison with TextCorpusโ
| Feature | TextCorpus | TVC Corpus |
|---|---|---|
| Capacity | 100 entries | 10,000 entries |
| Vector type | Float32 | Ternary 1 |
| Memory | ~40 MB | ~26 MB |
| Compression | None | 20x (vs float32) |
| Forgetting | FIFO eviction | Zero-forgetting |
| Bundling | No | Yes (majority vote) |
| File format | JSON | .tvc binary |
File Formatโ
TVC files use a binary format with a TVC1 magic header:
Offset Size Field
0x00 4 Magic: "TVC1"
0x04 4 Version
0x08 4 Entry count
0x0C 4 Vector dimension
0x10 48 Reserved
0x40 ... Entries (vector + metadata)
Save path: trinity_chat.tvc (auto-saved on REPL exit)
Sacred Mathematicsโ
The TVC threshold is derived from the golden ratio:
This is the Needle threshold (Koschei's Needle) โ the minimum similarity required for a cache hit. The number is the reciprocal of the golden ratio and appears throughout Trinity's architecture as the quality gate.
Integration with Chatโ
TVC is automatically loaded when starting the REPL or using tri chat:
# TVC is loaded automatically
tri chat "What is VSA?"
# First time: LLM call + stored in TVC
# Second time: instant cache hit
tri chat "What is VSA?"
The TVC corpus persists across sessions via the trinity_chat.tvc file.
See Alsoโ
- Interactive REPL โ REPL mode with TVC integration
- Core Commands โ Chat command details
- Demos & Benchmarks โ Needle Check benchmarks
- Sacred Math โ Golden ratio constants