⚠️ PROPRIETARY SOFTWARE - ALL RIGHTS RESERVED⚠️ Copyright © 2025 Brenner Cruvinel. This software contains proprietary algorithms and trade secrets. Unauthorized use, reproduction, or distribution is strictly prohibited.
IMPORTANT: This project is currently in early development (approximately 20% complete). The application is not production-ready and contains bugs. We are actively implementing core features and comprehensive testing.
![]()
![]()
Current State: Early Alpha (v0.3.0)
- Completion: ~20%
- Core Features: Under active development
- Testing: Implementing comprehensive test suite
- Stability: Expect bugs and breaking changes
- API: Subject to significant changes
Neural Semantic Compiler (NSC) is a semantic compression tool that reduces LLM token usage by 40-65% while preserving complete semantic meaning with, not just reduce characters, it's revesability engeerning. It works as a preprocessing layer for any LLM interaction, making AI more accessible and cost-effective.
Note: The examples and features described below represent the project's vision. Many are not yet implemented or may work partially.
Python (from source):
git clone https://github.com/brennercruvinel/neuralsemantic.git
cd neuralsemantic/python
pip install -e .
Node.js (coming soon):
# Not yet available
# npm install @neurosemantic/core @neurosemantic/cli
From Source:
git clone https://github.com/brennercruvinel/neuralsemantic.git
cd neuralsemantic
pip install -e .
# Basic compression (partially working)
python -m neuralsemantic.cli.main compress "Your text here"
# These commands are planned but NOT YET IMPLEMENTED:
# echo "Build a production-ready React application with authentication" | nsc compress
# nsc compress --domain web-dev "Implement user authentication system"
# nsc compress --show-stats "Create REST API with Express.js"
from neuralsemantic import NeuralSemanticCompiler
# Initialize
compiler = NeuralSemanticCompiler()
# Compress text
result = compiler.compress("Build a production-ready React application")
print(f"Original: {result.original_text}")
print(f"Compressed: {result.compressed_text}")
print(f"Token reduction: {(1-result.compression_ratio):.1%}")
import { NeuralSemanticCompiler } from '@neurosemantic/core';
const compiler = new NeuralSemanticCompiler();
const result = await compiler.compress("Build a production-ready React application");
console.log(`Compressed: ${result.compressedText}`);
console.log(`Token reduction: ${(1 - result.compressionRatio) * 100}%`);
Input: "Build a production-ready React application with user authentication,
real-time data synchronization, responsive design, error handling"
Output: "bld prod-rdy React app w/ usr auth, RT sync, rsp design, err hdl"
Result: 53% reduction (12 tokens → 5 tokens)
Input: "Implement microservices architecture with Docker containerization,
Kubernetes orchestration, API gateway, monitoring"
Output: "impl μsvc arch w/ Docker, k8s orch, API gtw, mon"
Result: 44% reduction (14 tokens → 8 tokens)
- Token Reduction: 40-65% average compression ratio
- Semantic Preservation: Maintains 100% of meaning
- Real-time Processing: < 20ms average latency
- Framework Agnostic: Works with any LLM (GPT-4, Claude, Llama)
- Domain Optimization: Specialized patterns for different domains
general
- Default compression patternsweb-dev
- Web development and frontenddata-science
- Data analysis and MLdevops
- Infrastructure and deploymentagile
- Project management
Create ~/.neuralsemantic/config.json
:
{
"compression": {
"default_level": "balanced",
"semantic_threshold": 0.90,
"preserve_code": true,
"preserve_urls": true
},
"domains": ["general", "web-dev", "data-science"],
"vector": {
"model": "sentence-transformers/all-MiniLM-L6-v2"
}
}
light
- Conservative compression, highest qualitybalanced
- Optimal balance (default)aggressive
- Maximum compression
Learn patterns from your codebase:
nsc learn --corpus-path ./src --min-frequency 3
Add domain-specific patterns:
nsc add-pattern "authentication system" "auth sys" --domain web-dev
documents = load_documents("./docs")
results = compiler.batch_compress(documents)
for result in results:
print(f"Saved {result.token_savings} tokens")
CompressionResult:
original_text: str # Original input text
compressed_text: str # Compressed output
compression_ratio: float # Compression ratio (0-1)
quality_score: float # Quality score (0-10)
token_savings: int # Tokens saved
processing_time_ms: int # Processing time
# Basic compression
result = compiler.compress(text, level="balanced", domain="general")
# Batch processing
results = compiler.batch_compress(documents)
# Pattern management
compiler.add_pattern(original, compressed, domain, priority)
compiler.learn_from_corpus(documents)
NSC uses a hybrid architecture combining:
- Pattern Matching - SQLite database for structured patterns
- Vector Similarity - ChromaDB for semantic search
- ML Optimization - Automatic pattern discovery
- Quality Validation - Ensures semantic preservation
- Semantic analysis and concept extraction
- Domain-specific pattern matching
- Vector similarity search
- Compression with quality validation
- Smart fallback for edge cases
Metric | Value |
---|---|
Average Compression | 40-65% |
Processing Speed | < 20ms |
Semantic Preservation | > 95% |
Memory Usage | < 100MB |
Throughput | 10,000 req/s |
- OpenAI
- Anthropic Claude
- China models
- Google Gemini
- Meta Llama
- Mistral AI
- Local models (Ollama)
- LangChain
- LlamaIndex
- Semantic Kernel
- AutoGPT
git clone https://github.com/brennercruvinel/neuralsemantic.git
cd neuralsemantic
pip install -e .[dev]
# Run tests
pytest
# Run with coverage
pytest --cov=neuralsemantic
# Run benchmarks
pytest tests/benchmarks/
- Basic project structure
- Core compression algorithms (partial)
- Simple pattern matching
- Basic CLI interface
- Comprehensive test suite
- Pattern database implementation
- Vector similarity search
- Quality validation system
- Domain-specific patterns
- ChromaDB integration
- ML-based pattern learning
- Multi-language support
- API server
- Performance optimizations
- Documentation
- Package publishing (PyPI/NPM)
- Pattern matching is inconsistent
- No proper error handling
- Memory leaks in vector operations
- CLI commands may fail unexpectedly
- Compression quality varies significantly
- No data persistence between sessions
This is proprietary software. External contributions are not accepted.
PROPRIETARY LICENSE - All Rights Reserved
This software is protected by copyright and contains proprietary algorithms and trade secrets. See LICENSE for details.
For licensing inquiries or commercial use:
- Author: Brenner Cruvinel
- Email: cruvinelbrenner@gmail.com
- GitHub: @brennercruvinel
Copyright © 2025 Brenner Cruvinel. All Rights Reserved.
Unauthorized use, reproduction, or distribution of this software is strictly prohibited and will be prosecuted to the fullest extent of the law.