Universal multi-domain research system with RAG (Retrieval-Augmented Generation) capabilities
Project description
Viincci-RAG
Universal multi-domain research system with RAG (Retrieval-Augmented Generation) capabilities
๐ Try It Now (Google Colab)
No installation required! Run these notebooks in your browser:
Minimal Examples โ Safe mock mode + real SerpAPI integration
Complete Testing โ All domains (poetry, medical, botany, art, carpentry)
๐ Quick Start
Installation
# Install from source
pip install -e .
# With development dependencies
pip install -e ".[dev]"
# All features
pip install -e ".[all]"
Basic Usage
from viincci_rag import ConfigManager, RAGSystem, UniversalResearchSpider
# Initialize configuration
config = ConfigManager(domain="botany")
# Create RAG system
rag = RAGSystem(config)
rag.load_llm()
# Create research spider
spider = UniversalResearchSpider(config)
# Or import all classes
from viincci_rag import *
๐ฆ What's Included
| Component | Purpose |
|---|---|
ConfigManager |
Configuration management with domain support |
RAGSystem |
Retrieval-Augmented Generation pipeline |
UniversalResearchSpider |
Multi-domain research and web scraping |
UniversalArticleGenerator |
Content generation for any domain |
SerpAPIMonitor |
API credit monitoring and management |
FloraDatabase |
Database operations and management |
๐งช Testing
# Run all tests
pytest tests/
# Run integration tests
pytest tests/test_integration.py -v
# With coverage report
pytest tests/ --cov=viincci_rag --cov-report=html
๐ Documentation
All documentation has been moved to the docs/ folder:
- docs/DOCS.md - Documentation index and quick reference
- docs/MIGRATION.md - Complete migration guide
- docs/RESTRUCTURING_SUMMARY.md - Architecture overview
- docs/BACKWARD_COMPATIBILITY_SHIMS.md - Technical details
- docs/package_structure.md - Packaging guide
๐ Backward Compatibility
All old imports continue to work:
# Old import (still works)
from V4 import ConfigManager, RAGSystem
# New import (recommended)
from viincci_rag import ConfigManager, RAGSystem
# Both are identical
๐ Project Structure
viincci_rag/
โโโ core/ # Core RAG modules with wrappers
โโโ database/ # Database adapters
โโโ utils/ # Utility functions
โโโ config/ # Configuration files
โโโ templates/ # Output templates
V4/ # Original codebase (unchanged)
docs/ # Documentation
tests/ # Test suite
๐ค Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pytest tests/ - Submit a Pull Request
๐ License
MIT License - See LICENSE file for details
๐ Support
- ๐ง Issues: GitHub Issues
- ๐ Documentation: docs/
- ๐ฌ Discussions: GitHub Discussions
Version: 4.0.0 | Status: Beta | License: MIT
## โจ Features
- ๐ฌ **Multi-Domain Research**: Botany, medical, mathematics, carpentry, and more
- ๐ค **RAG System**: Retrieval-Augmented Generation for intelligent answers
- ๏ฟฝ **Multiple Database Backends**: SQLite, PostgreSQL, MongoDB, MySQL
- ๐ฏ **API Monitoring**: Built-in SerpAPI credit tracking
- โ๏ธ **Fully Configurable**: Models, databases, content processing
- โ
**Tested & Documented**: Comprehensive test suite and documentation
- ๐ **Backward Compatible**: All old imports still work
# Clone the repository
git clone https://github.com/yourusername/viincci-rag.git
cd viincci-rag
# Install in development mode
pip install -e .
# Or install with all dependencies
pip install -e ".[all]"
For Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Or use the built-in test command
viincci-test
๐ Setup
-
Get a SerpAPI Key: Sign up at serpapi.com
-
Set Environment Variable:
export SERP_API_KEY='your_api_key_here'
-
Verify Installation:
viincci-research --list-domains
๐ Usage
Command Line Interface
Basic Research Article
viincci-research -q "Rosa rubiginosa" -d botany
Plain Text Output
viincci-research -q "diabetes" -d medical --format text
JSON Structured Output
viincci-research -q "Pythagorean theorem" -d mathematics --format json
Arts & Humanities Research
viincci-research -q "Impressionism" -d art_history
viincci-research -q "Shakespeare sonnets" -d literature
Creative Writing with RAG
# Generate a poem
viincci-research -q "Van Gogh" -d art_history --content-type poem --rag
# Generate an essay
viincci-research -q "Baroque music" -d music --content-type essay --rag
Check API Status
viincci-research --check-credits
Python API
from V4 import ConfigManager, UniversalResearchSpider, RAGSystem, UniversalArticleGenerator
# Initialize configuration for a domain
config = ConfigManager(domain="mathematics", verbose=True)
# Perform research
spider = UniversalResearchSpider(config)
sources = spider.research("Pythagorean theorem")
# Generate article with RAG
rag = RAGSystem(config)
texts = [s['text'] for s in sources]
metadata = [s['metadata'] for s in sources]
rag.build_index(texts, metadata)
rag.load_llm()
generator = UniversalArticleGenerator(config, rag_system=rag)
article = generator.generate_full_article("Pythagorean theorem", sources)
# Save article
with open("article.html", "w") as f:
f.write(article)
Domain Information
# List all domains
viincci-research --list-domains
# Get detailed domain info
viincci-research --domain-info medical
๐๏ธ Architecture
viincci-rag/
โโโ V4/ # Main package
โ โโโ __init__.py # Package exports
โ โโโ ConfigManager.py # Configuration management
โ โโโ Spider.py # Web scraping & search
โ โโโ RagSys.py # RAG system implementation
โ โโโ UniversalArticleGenerator.py # Article generation
โ โโโ ApiMonitor.py # API credit monitoring
โ โโโ FloraDatabase.py # Database operations
โ โโโ config/ # Configuration files
โ โ โโโ domains.json # Domain definitions
โ โ โโโ ai_settings.json # AI model settings
โ โ โโโ api_monitor.json # API monitoring config
โ โ โโโ ...
โ โโโ db/ # Database directory
โโโ research_cli.py # Command-line interface
โโโ test_v4.py # Test suite
โโโ requirements.txt # Dependencies
โโโ setup.py # Package setup
โโโ README.md # This file
๐งช Testing
Run the comprehensive test suite:
# Using pytest
pytest
# Using built-in test runner
viincci-test
# With verbose output
viincci-test --verbose
# Run specific test
pytest tests/test_config.py -v
๐ Configuration
All configuration is stored in V4/config/ as JSON files:
- domains.json: Define research domains, sources, questions
- ai_settings.json: LLM and embedding model settings
- api_monitor.json: API usage thresholds and alerts
- search_config.json: Web scraping parameters
- domain_reliability.json: Source reliability scores
Example: Add a New Domain
Edit V4/config/domains.json:
{
"your_domain": {
"name": "Your Domain Name",
"description": "Description of your domain",
"primary_sources": ["university", "research_institute"],
"questions": [
"what are the key concepts",
"what are the applications"
],
"keywords": ["keyword1", "keyword2"]
}
}
๐ง Advanced Features
RAG System Customization
from V4 import ConfigManager, RAGSystem
config = ConfigManager()
# Change LLM model
config.set_llm_model("LiquidAI/LFM-40B-MoE")
# Initialize RAG with custom settings
rag = RAGSystem(config)
rag.load_llm(device="cuda", load_in_8bit=True)
# Query with custom parameters
result = rag.query(
"What are the benefits?",
k=10,
max_new_tokens=500,
temperature=0.8
)
API Cost Estimation
from V4 import SerpAPIMonitor, ConfigManager
config = ConfigManager()
monitor = SerpAPIMonitor(config)
# Estimate research cost
estimate = monitor.estimate_research_cost("Plant name", questions=4)
monitor.print_estimate(estimate)
# Check if can afford
if estimate['can_afford']:
# Proceed with research
pass
๐ Documentation
For detailed documentation, visit the Wiki.
Key Topics
๐ค Contributing
Contributions are welcome! Please read our Contributing Guidelines first.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- SerpAPI for search capabilities
- Hugging Face for transformers and models
- FAISS for efficient similarity search
- Wikimedia Commons for images
๐ Support
- ๐ง Email: Viincci@proton.me
- GitHub: MrViincciLeRoy
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
๐บ๏ธ Roadmap
- Add more research domains
- Implement caching for search results
- Add web interface
- Support for more LLM providers
- Multilingual support
- Export to more formats (PDF, DOCX)
- Integration with reference managers
๐ Changelog
See CHANGELOG.md for version history.
Made with โค๏ธ by the Viincci-RAG Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file viincci_rag-2.0.0.tar.gz.
File metadata
- Download URL: viincci_rag-2.0.0.tar.gz
- Upload date:
- Size: 53.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c728650dae1c4893eeeda6cace91ba97af2744434f264c20b5561521366c8ee1
|
|
| MD5 |
98157a5763e46e00f7f193b60d9e2113
|
|
| BLAKE2b-256 |
fc129951425e598db977e1270a9233c560dcfa04a4c5434aff828e919dcfd9bf
|
File details
Details for the file viincci_rag-2.0.0-py3-none-any.whl.
File metadata
- Download URL: viincci_rag-2.0.0-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02825147d881889d54ef0d808c22f76de0001089be6539fbed124e56b2b7f55
|
|
| MD5 |
077f668efd3edea96dc4f7e498c3e8b6
|
|
| BLAKE2b-256 |
a0364787036c20a1255f6e5051178603c0f0d2da97f07e8ee8a69064ce38d729
|