Thaum is a revolutionary .NET Core application implementing superposed vector compression methodology for two breakthrough use cases:
- Codebase Optimization: LSP-based hierarchical code analysis with 4-level compression system
- LLM Conversation Compression: Apply the same compression engine to conversation contexts - massively superior to traditional CLI agent
/compactcommands
Features superposed vector prompt engineering, parallel processing, and lossless compression with perfect reconstruction guarantees.
- Multi-Language Support: Python, C#, JavaScript, TypeScript, Rust, Go, and more via LSP
- Hierarchical Optimization: Function → Class → Module → Directory level analysis with superposed vector compression
- 4-Level Compression System: Optimize → Compress → Golf → Endgame compression levels
- Parallel Processing: Concurrent symbol optimization for maximum performance
- Incremental Updates: Smart change detection and cache invalidation
- Same System, New Domain: Apply hierarchical compression to LLM conversations instead of code
- Superposed Vector Methodology: Advanced prompt engineering using
/operator semantic superposition - Context Window Optimization: Compress long conversations while preserving complete semantic meaning
- Superior to CLI Agents: Massively better than traditional
/compact,/compresscommands - Lossless Compression: Complete conversational context preservation in minimal representation
- Emergent Grammar Generation: Spontaneous compression patterns for maximum semantic density
- Conversation Summarization: Extract key insights/patterns across conversation threads
- Context Preservation: Maintain perfect reconstruction guarantee for compressed conversations
- LLM Integration: Supports OpenAI, Anthropic, OpenRouter, and Ollama providers
- MCP Integration: Model Context Protocol server for AI tool integration
- Native AOT: Compiles to single-file native executables
- Cross-Platform: Windows, Linux, macOS support
- LSP Integration: Uses OmniSharp.Extensions.LanguageProtocol for multi-language support
- Summarization Engine: Implements hierarchical summarization with key extraction
- LLM Provider: Abstract provider supporting multiple AI services
- Caching System: SQLite-based caching for performance
- Change Detection: File system watching with dependency tracking
- Terminal UI: Rich console interface using Terminal.Gui v2
- MCP Server: Exposes tools via Model Context Protocol
- Symbol Extraction: Extract functions, classes, modules via LSP
- Function Summarization: Summarize deepest scope symbols first
- Key Extraction: Extract common patterns (K1) from function summaries
- Class Summarization: Summarize classes using K1 context
- Key Refinement: Extract K2 from class summaries
- Re-summarization: Update all summaries with K1+K2 context
- Hierarchy Building: Construct nested symbol hierarchy
- .NET 9.0 or later
🎉 Language servers are now automatically downloaded! No manual installation required.
Supported languages with automatic LSP server management:
- C#: OmniSharp (auto-downloaded from GitHub releases)
- Rust: rust-analyzer (auto-downloaded from GitHub releases)
- Go: gopls (auto-downloaded from GitHub releases)
- Python: pylsp (requires
pip install python-lsp-server) - TypeScript/JavaScript: typescript-language-server (requires
npm install -g typescript-language-server)
The application uses proper LSP (Language Server Protocol) integration via JSON-RPC over stdio for enhanced symbol analysis and code intelligence. Language servers are automatically downloaded, cached, and updated as needed.
git clone https://github.com/your-repo/thaum.git
cd thaum
dotnet restore
dotnet builddotnet publish -c Release -r linux-x64 --self-contained
# Creates single-file executable in bin/Release/net9.0/linux-x64/publish/# Basic optimization
./thaum summarize /path/to/project
# Maximum endgame compression
./thaum summarize --compression endgame
./thaum summarize -c golf
./thaum summarize --endgame# Compress conversation file using superposed vectors
./thaum compress-conversation input.txt --compression endgame
# Real-time conversation compression
./thaum conversation-server --port 8080
# Batch compression with context preservation
./thaum compress-batch conversations/ --output compressed/Revolutionary Advantage: Unlike traditional CLI agent compression (/compact, /compress) which uses simple truncation or basic summarization, Thaum applies the same sophisticated hierarchical compression with:
- K1/K2 Key Extraction: Extract conversational patterns across message threads
- Superposed Vector Compression: Use
/operator methodology for maximal semantic density - Perfect Reconstruction: Maintain complete conversational context in compressed form
- Emergent Grammar: Generate spontaneous compression patterns specific to conversation style
- 4-Level Intensity: From basic optimization to endgame superposed vector retopologization
./thaumUse the Terminal.Gui interface to:
- Open projects (Ctrl+O)
- Start optimization (Ctrl+S)
- Browse symbol hierarchies
- View optimizations and extracted keys
- Load conversation files for compression
Configure via appsettings.json:
{
"LLM": {
"Provider": "openai|anthropic|ollama",
"BaseUrl": "https://api.openai.com/v1",
"ApiKey": "your-api-key",
"DefaultModel": "gpt-4"
},
"Cache": {
"Directory": "/path/to/cache"
}
}Or via environment variables:
export LLM__Provider=openai
export LLM__ApiKey=your-api-keyStart the MCP server for Claude Code integration:
./thaum --mcp-serverRegister in Claude Code's MCP configuration:
{
"mcpServers": {
"thaum": {
"command": "/path/to/thaum",
"args": ["--mcp-server"]
}
}
}Thaum exposes these tools via Model Context Protocol:
Analyze and summarize a codebase using hierarchical approach.
Parameters:
project_path(string, required): Project root directorylanguage(string, required): Programming languageforce_refresh(boolean): Force refresh cached summariesmax_depth(number): Maximum hierarchy depthllm_model(string): LLM model override
Search for symbols in a summarized codebase.
Parameters:
project_path(string, required): Project root directoryquery(string, required): Search querysymbol_kinds(array): Filter by symbol typesmax_results(number): Result limit
Get detailed summary of a specific symbol.
Parameters:
project_path(string, required): Project root directorysymbol_name(string, required): Symbol namefile_path(string, required): File containing symbol
Get the extracted summarization keys for a project.
Parameters:
project_path(string, required): Project root directory
Get the complete symbol hierarchy for a project.
Parameters:
project_path(string, required): Project root directory
Invalidate cached summaries for a project.
Parameters:
project_path(string, required): Project root directorypattern(string): Cache pattern to invalidate
F1- Show helpCtrl+Q- Quit applicationCtrl+O- Open projectCtrl+S- Start summarizationCtrl+R- Refresh symbolsTab- Navigate between panelsEnter- Select item/Execute actionEscape- Go back/Cancel
| Language | LSP Server | Status |
|---|---|---|
| Language | LSP Server | Status |
| ------------ | ------------ | --------- |
| C# | omnisharp | ✅ Full - Auto-download |
| Rust | rust-analyzer | ✅ Full - Auto-download |
| Go | gopls | ✅ Full - Auto-download |
| Python | pylsp | ✅ Full - System install required |
| JavaScript | typescript-language-server | ✅ Full - System install required |
| TypeScript | typescript-language-server | ✅ Full - System install required |
| Java | jdtls | 🚧 Planned |
| C++ | clangd | 🚧 Planned |
🚀 Auto-Download Feature: Thaum automatically downloads, installs, and manages LSP servers for supported languages. Servers are cached locally and updated automatically. No manual installation required for C#, Rust, and Go!
- Native AOT: Fast startup, low memory usage
- Incremental Processing: Only re-summarize changed symbols
- SQLite Caching: Persistent caching with expiration
- Parallel Processing: Concurrent summarization of symbols
- Smart Invalidation: Dependency-aware cache invalidation
- Fork the repository
- Create a feature branch
- Implement changes with tests
- Submit a pull request
MIT License - see LICENSE file for details.
-
compress-conversationcommand with file input/output -
conversation-serverHTTP API for real-time compression -
compress-batchfor directory processing - Conversation-specific prompts (message/thread/context levels)
- Integration with popular chat formats (Claude, GPT, Discord, Slack)
- Streaming compression for long conversations
- Conversation reconstruction validation
- Performance benchmarks vs traditional
/compactcommands
- Additional language support (Java, C++)
- Web interface alongside Terminal.Gui
- Prompt optimization with self-play
- Distributed processing for large codebases
- Integration with more AI providers
- Visual dependency graphs
- Export formats (Markdown, HTML, JSON)