Fractal Glyph Tape
Agent Memory OS: Dense, fractal, cross-lingual phrase memory.
Intelligent memory retrieval for AI agents. Fractal Glyph Tape (FGT) clusters phrases, assigns them glyph codes, and uses foveated memory to deliver the right context at the right time—achieving +46.7pp accuracy gain at a 256-token budget on synthetic multi-turn dialogs.
• "Can you send me that file?" (en)
• "Mind emailing the document?" (en)
• "你能发给我那个文件吗?" (zh)
• "¿Puedes enviarme ese archivo?" (es)
What's in this repo?
A complete research prototype for phrase-level semantic compression and cross-lingual LLMs
Agent Memory Service
Production-ready REST API for intelligent memory retrieval. Foveated allocation delivers +46.7pp accuracy gain at a 256-token budget on synthetic multi-turn dialogs.
Semantic Compression
Smaller corpora and logs with reconstructable meaning. 50-70% compression on our test corpora while preserving semantic content.
Effective Context Extension
More usable signal per token under fixed context windows. Fit 2.5-4x more semantic content in the same token budget on our internal benchmarks.
Cross-Lingual Bridging
Shared glyph IDs for phrase families spanning multiple languages. 90-95% cross-lingual precision on EN↔ES↔ZH retrieval experiments.
All metrics are from internal experiments; see README and docs/PHASE-5-RESULTS.md for setup and limitations.
Implementation Includes:
Why It Matters
Three core capabilities that transform how LLMs handle language
Intelligent Memory Retrieval
- •Foveated allocation strategy: 30% early context, 30% relevant, 40% recent
- •Delivers the right memories at the right time for agent decision-making
- •+46.7pp accuracy improvement over naive truncation under tight budgets
Semantic Compression
- •Replace repeated patterns with short glyph codes
- •Store one shared phrase-family table instead of millions of near-duplicates
- •50-70% compression while preserving semantic content
Cross-Lingual by Design
- •English, Spanish, Chinese, and other languages sharing the same intent cluster together
- •Glyph IDs act as language-agnostic anchors for retrieval and analysis
- •90-95% precision across language pairs
How It Works
Three steps to a navigable phrase memory
Cluster
We embed and cluster phrases into phrase families, keeping examples, statistics, and language labels.
Glyph & Fractal
Each family gets a glyph code and a coordinate on a fractal tape—a recursive triangular map of phrase space.
Integrate
A hybrid tokenizer and LLM adapter let existing models consume glyph-coded text and learn to expand glyphs into natural language.
Full Pipeline
Quickstart: Agent Memory API
# Start the memory service
python -m src.memory.service
# Write to agent memory
curl -X POST http://localhost:8000/api/memory/write \
-H "Content-Type: application/json" \
-d '{"agent_id": "my-agent", "turn": {...}}'
# Read with foveated retrieval
curl -X POST http://localhost:8000/api/memory/read \
-H "Content-Type: application/json" \
-d '{"agent_id": "my-agent", "token_budget": 256}'
# Try the Memory Console
# Visit http://localhost:3000/memory-consoleBuild Your Own Tape
# 1) Create environment
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2) Build a demo tape
python scripts/run_full_build.py --config configs/demo.yaml
# 3) Try the CLI
echo "Can you send me that file?" | fgt encode
echo "谷阜" | fgt decode
# 4) Launch the visualizer
uvicorn fgt.viz.app:app --reloadFor Researchers and Builders
If you care about:
- •Tokenization and representation learning
- •Semantic compression and storage
- •Cross-lingual alignment
- •Long-context LLMs
…then FGT is designed to be picked apart, extended, and argued with.
Python implementation
Full codebase available on GitHub. Non-commercial use only. See LICENSE for details.
45+ docs with specs, math, and experiment protocols
Complete technical documentation, from vision to implementation
Ready-made scripts for experiments
Reproducible evaluation suite for compression, context, and retrieval
FGT is research software
We invite feedback, experiments, and extensions. If you're working on tokenization, compression, or cross-lingual LLMs, this is for you.