A modular, AI-driven pipeline for intelligent document processing—from raw URLs to polished content.
Scriptoria Project is an advanced AI-powered content processing system that transforms web content through intelligent scraping, reinforcement learning, and multi-agent AI collaboration. The system processes URLs through a sophisticated pipeline that includes content extraction, AI analysis, rewriting, and human-in-the-loop feedback.
![]() |
![]() |
![]() |
![]() |
- Intelligent Content Analysis: AI-driven review and scoring of web content quality
- Multi-Agent Collaboration: Writer and reviewer agents powered by Google Gemini
- Reinforcement Learning: Adaptive search and reward scoring for optimal content discovery
- Streamlit Web UI: Interactive interface with real-time processing visualization
- FastAPI Backend: RESTful API for integration with other applications
- CLI Orchestrator: Command-line interface for automated workflows
- Voice Integration: speech-to-text via Vosk with audio processing
- Speaking Agent: text-to-speech on AI Written summary page
- Modular Pipeline: Extensible components for web scraping, AI processing, and content enhancement
- Vector Storage: Semantic search and retrieval using ChromaDB
- Cross-Platform: Native support for Windows, Linux, and macOS
- GPU Optimization: Optional GPU acceleration with CPU fallback
graph TD
A[URL, Name, RLQuery Input] --> B[Web Scraping & Screenshot]
B --> C[RL Search & Scoring]
C --> D[AI Content Analysis/Review]
D --> E[Content Quality Scoring]
E --> F[AI Rewriting]
F --> G[Human Feedback]
G --> H{Feedback Type}
H --> I[Text Input]
H --> J[Audio Input]
H --> K[No Input]
I --> D
J --> D
K --> L[Final Output]
L --> M[Restart Workflow]
L --> N[Vector Storage Deletion]
M --> A
- Python 3.11 or higher
- Google Gemini API Key (Get free API key)
# Create environment from YAML
conda env create -f environment.yml
conda activate scriptenv
# Install Playwright browsers
playwright install
# Create virtual environment
python -m venv scriptenv
# Activate (Windows PowerShell)
.\scriptenv\Scripts\Activate.ps1
# If permission Error:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
# Install Python packages
pip install -r requirements.txt
# Install Playwright browsers
playwright install
# PowerShell
$env:GEMINI_API_KEY="your-api-key-here"
# bash/zsh
export GEMINI_API_KEY="your-api-key-here"
streamlit run src/streamlit_app.py
Features:
- Interactive web interface
- Real-time processing visualization
- Audio input and output support
- Step-by-step workflow guidance
uvicorn src.api_server:app --reload
API Endpoints:
GET /
- API documentationGET /write?url=link
- Content writing endpointGET /review?url=link
- Content review endpoint
python src/main.py
Features:
- Lightweight command-line interface
- Automated batch processing
- Integration with existing workflows
Scriptoria-Project/
├── agents/ # AI Agent Modules
│ ├── ai_writer.py # Content generation agent
│ ├── ai_reviewer.py # Quality assessment agent
│ └── voice_api.py # Speech processing
├── chromadb/ # Vector Database Storage
├── data/
│ ├── demo/ # Demonstration screenshots
│ ├── logo/ # Brand assets
│ ├── model/ # Vosk speech model
│ ├── raw_content/ # Original content storage
│ ├── processed_content/ # Enhanced content storage
│ └── screenshots/ # UI documentation
├── src/ # Core Application
│ ├── api_server.py # FastAPI backend
│ ├── main.py # CLI entry point
│ ├── rl_reward.py # RL search result reward function
│ ├── rl_search.py # Intelligent search
│ ├── scraper.py # Web content extraction
│ ├── streamlit_app.py # Primary GUI Application
│ └── versioning.py # Content version management
├── .vscode/ # Editor settings
├── example-urls.txt # Sample URLs & friendly names
├── requirements.txt # Python dependencies
├── terminal-commands.txt # Step-by-step guide to run it in CLI, Streamlit and API mode
├── enviroment.yml # Enviroment Config Setup by "conda".
├── output.mp3 # Output MP3 generated from streamlit_app.py and acts as a record of last webpage audio
└── README.md # Instructions file
Features:
- URL input with validation
- Content naming and categorization
- Reinforcement learning query configuration
- Example URL integration
Process:
- Intelligent web scraping with HTML cleaning
- Screenshot capture for visual reference
- Content structure analysis
Analysis Includes:
- Content quality assessment
- Readability scoring
- Improvement recommendations
- Text-to-speech audio generation
Enhancement Features:
- AI-powered content rewriting
- Quality improvement tracking
- Style and tone optimization
- Multi-format output support
![]() |
![]() |
Feedback Options:
- Text-based suggestions and edits
- Voice feedback with speech-to-text
- Iterative improvement cycles
- Quality validation
Output Features:
- Version management
- Process restart capability
- Export functionality
The system works with various web content types. Example URLs include:
Content Title | Example URL | Content Type | Use Case |
---|---|---|---|
Joy of Discipline | library.acropolis.org | Philosophical Essay | Personal development insights |
Gates of Morning | Wikisource | Literature | Classic text modernization |
Born or Built Smart | Psychology Today | Article | Intelligence and effort analysis |
Sufficient Reason | Stanford Encyclopedia | Academic | Conceptual deep dive |
Infinity's Existence | Scientific American | Research | Abstract theory accessibility |
Sample URLs File: example-urls.txt
contains curated starting points.
![]() |
![]() |
CLI Advantages:
- Scriptable and automatable
- Resource-efficient operation
- Batch processing capabilities
- Integration with CI/CD pipelines
# Required
GEMINI_API_KEY="your-gemini-api-key"
src/rl_reward.py
for custom scoring algorithmsagents/ai_writer.py
for writing style customizationagents/ai_reviewer.py
for reviewing style customizationsrc/versioning.py
for different aspects of versioning.
The system automatically detects and utilizes GPU resources when available. Key optimizations include:
- TensorFlow GPU support for ML operations
- ONNX Runtime for model inference acceleration
- Parallel processing for multi-document handling
- Chunked processing for large documents
- Efficient vector storage with ChromaDB
- Automatic cache management
We welcome contributions! Please see our development guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
API Key Problems:
# Verify API key is set
echo $GEMINI_API_KEY # Linux/Mac
echo $env:GEMINI_API_KEY # Windows PowerShell
Playwright Installation:
# Reinstall browsers if needed
playwright install
Dependency Conflicts:
# Fresh environment setup
conda env remove -n scriptenv
conda env create -f environment.yml
- Google Gemini for AI capabilities
- Vosk for speech-to-text functionality
- Chromadb for vector storage solutions
- Streamlit for interactive UI components
- Playwright for robust web scraping
🎯 Architect of agentic RL workflows, reproducible environments, and browser-audible AI interfaces.
💡 Driven by clarity, modularity, and a passion for empowering teams through automation and documentation.
🔗 GitHub: Kratugautam99
📘 Project: Scriptoria – AI-Driven Content Processing
This project is licensed under the MIT License - see the LICENSE file for details.