Sloppy - Agentic Content Quality Analyzer
Agentic Postgres Challenge Submission - Live production system showcasing multi-agent collaboration using Tigerβs zero-copy database forks
A Chrome extension that detects βslopβ (low-quality, templated, repetitive writing) in web pages using Agentic Postgres with multi-agent collaboration. Each analysis runs in its own zero-copy database fork where specialized agents (Collector, Evaluator, Curator) collaborate asynchronously, demonstrating the power of Tigerβs fork-based architecture.
Performance: Analyzes pages in 5-15 seconds with intelligent caching (40-60% hit rate) powered by Tigerβs fast forks and hybrid search.
π― Status: Fully deployed on Tiger Cloud with active database and working fork-based architecture.β¦
Sloppy - Agentic Content Quality Analyzer
Agentic Postgres Challenge Submission - Live production system showcasing multi-agent collaboration using Tigerβs zero-copy database forks
A Chrome extension that detects βslopβ (low-quality, templated, repetitive writing) in web pages using Agentic Postgres with multi-agent collaboration. Each analysis runs in its own zero-copy database fork where specialized agents (Collector, Evaluator, Curator) collaborate asynchronously, demonstrating the power of Tigerβs fork-based architecture.
Performance: Analyzes pages in 5-15 seconds with intelligent caching (40-60% hit rate) powered by Tigerβs fast forks and hybrid search.
π― Status: Fully deployed on Tiger Cloud with active database and working fork-based architecture.
β¨ Features
Agentic Postgres Innovation
- π± Zero-Copy Forks: Each analysis job runs in its own Tiger fork for true isolation
- π€ Multi-Agent Collaboration: Collector β Evaluator β Curator agents work across forks
- π Hybrid Search: Combines pgvector semantic search + pg_trgm full-text search
- π Fluid Storage: Dynamic data flow between agent forks
- π Tiger MCP Integration: Model Context Protocol for agent orchestration
Core Features
- π‘ Real-time Analysis: WebSocket-powered progress updates
- π― Heuristic Detection: Smart pattern matching for low-quality content
- πΎ Intelligent Caching: Fast repeat analyses with fork-based caching
- β‘ Parallel Processing: 10 concurrent evaluations across isolated forks
- π¨ Inline Highlighting: Visual indicators directly in web pages
- π Detailed Reports: Paragraph-level scoring with explanations
π Tech Stack
Agentic Postgres (Tiger)
- Tiger Cloud: Zero-copy database forks for agent isolation
- Tiger MCP: Model Context Protocol for agent orchestration
- Tiger CLI: Fork management and deployment automation
- pgvector: Semantic similarity search for embeddings
- pg_trgm: Full-text search for keyword matching
- Fluid Storage: Dynamic data synchronization between forks
Application Stack
- Backend: FastAPI + Python 3.11+
- ML: Sentence Transformers (all-MiniLM-L6-v2) for embeddings
- Detection: Heuristic-based slop analysis
- Extension: Chrome Manifest V3 with WebSocket support
- Real-time: WebSocket for live progress updates
π Prerequisites
To run this project locally, you need:
- Python 3.11 or higher
- Tiger CLI installed (for fork management)
- Google Chrome or Chromium-based browser
- Git (for cloning the repository)
Note: The production database is already deployed on Tiger Cloud. For local development, you can either connect to the Tiger Cloud instance or set up your own Tiger database following the setup instructions below.
π Quick Start
1. Clone the Repository
git clone https://github.com/AamishB/Sloppy.git
cd sloppy
2. Set Up Python Environment
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
# Install dependencies
### 3. Configure Environment
Create a `.env` file in the project root (copy from `.env.example`):
```bash
cp .env.example .env
Then edit .env with your Tiger Cloud credentials:
# Get your database URL from Tiger Cloud console
DATABASE_URL=postgres://user:pass@your-instance.tsdb.cloud.timescale.com:30513/tsdb?sslmode=require
# Path to Tiger CLI
# Windows: C:\Users\YourName\go\bin\tiger.exe
# Mac: /usr/local/bin/tiger or /opt/homebrew/bin/tiger
# Linux: /usr/local/bin/tiger
TIGER_CLI_PATH=/path/to/tiger
# Enable fork-based architecture
USE_TIGER_FORKS=true
# Performance settings
MAX_CONCURRENT_EVAL=10
BATCH_SIZE=10
PERSIST_RAW=true
LOG_LEVEL=INFO
Important: Never commit your
.envfile! Itβs already in.gitignore.
4. Set Up Tiger CLI (Required for Forks)
Install Tiger CLI:
# Download and install from: https://tiger.build/cli
Authenticate:
tiger auth login
Verify installation:
tiger service list
5. Initialize Database Schema
The database schema is already set up on the production instance. If setting up your own:
# Connect to your Tiger database
psql $DATABASE_URL -f db/schema.sql
6. Run the Server
uvicorn fastapi_app.main:app --reload --host 0.0.0.0 --port 8000
Server will be available at http://localhost:8000
7. Install Chrome Extension
- Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in top-right)
- Click Load unpacked
- Select the
extensionfolder from this project - The Sloppy icon should appear in your toolbar
7. Analyze a Page
- Navigate to any webpage
- Click the Sloppy extension icon
- Click Analyze This Page
- Watch real-time progress
- View results with color-coded highlighting
π API Documentation
POST /analyze
Analyzes web page content for slop detection.
Request Body:
{
"url": "https://example.com",
"text": "Full page content to analyze..."
}
Response:
{
"job_id": "page_abc123def456",
"raw_text_id": "12345",
"status": "queued",
"cached": false
}
GET /status/{job_id}
Retrieves analysis results for a specific job.
Response:
{
"job_id": "page_abc123",
"status": "done",
"slop_percent": 0.32,
"flags": [
{
"paragraph_index": 5,
"slop_score": 0.85,
"reasons": ["high_repetition", "template_phrases"],
"explain": "Contains repeated phrases and generic templates"
}
],
"snapshot_id": "snapshot-page_abc123-1699564800"
}
WebSocket /ws/{job_id}
Real-time progress updates during analysis.
Messages:
{
"status": "running",
"progress": 45,
"stage": "evaluating",
"evaluated": 23,
"total": 50
}
POST /feedback
Submit feedback on analysis results.
Request Body:
{
"job_id": "page_abc123",
"useful": true,
"notes": "Accurate detection of low-quality content"
}
π Project Structure
sloppy/
βββ fastapi_app/
β βββ main.py # FastAPI backend server
β βββ __pycache__/
βββ agents/
β βββ collector.py # Text extraction & embeddings
β βββ evaluator.py # Heuristic-based slop scoring
β βββ curator.py # Result aggregation & formatting
β βββ __pycache__/
βββ extension/
β βββ manifest.json # Chrome extension configuration
β βββ popup.html # Extension popup UI
β βββ popup.js # Popup logic
β βββ content.js # Page content extraction
β βββ background.js # Background service worker
β βββ styles.css # Extension styles
βββ db/
β βββ schema.sql # PostgreSQL database schema
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (create this)
βββ .gitignore # Git ignore rules
βββ README.md # This file
βοΈ Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | - | Tiger Cloud PostgreSQL connection string |
TIGER_CLI_PATH | Yes | - | Path to Tiger CLI executable |
TIGER_API_KEY | Yes | - | Tiger API key for authentication |
MAX_CONCURRENT_EVAL | No | 10 | Number of parallel evaluations per fork |
BATCH_SIZE | No | 10 | Paragraphs processed per batch |
PERSIST_RAW | No | true | Store raw text in database |
LOG_LEVEL | No | INFO | Logging level (DEBUG, INFO, WARNING) |
PORT | No | 8000 | Server port |
Tiger Cloud Setup
The application leverages Tigerβs Agentic Postgres features:
-- Tiger automatically provides these optimized extensions
CREATE EXTENSION IF NOT EXISTS vector; -- pgvector for semantic search
CREATE EXTENSION IF NOT EXISTS pg_trgm; -- Full-text trigram matching
Tiger-Specific Features:
- Zero-copy forks: Created via
tiger fork create --from main --name fork_jobid - Fluid Storage: Automatic data synchronization between fork and main
- Fast merges: Results merged back with
tiger fork merge - MCP Integration: Tiger MCP server orchestrates agent workflows
ποΈ Agentic Architecture
Multi-Agent Collaboration with Database Forks
This project showcases Tigerβs zero-copy forks for true multi-agent isolation:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Main Database β
β (Tiger Cloud) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
β Zero-copy fork creation
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Job Fork (fork_abc123) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Agent 1: Collector β
β β’ Extracts paragraphs β
β β’ Generates embeddings (sentence-transformers) β
β β’ Writes to paragraphs table in fork β
β β
β Agent 2: Evaluator (Parallel x10) β
β β’ Reads paragraphs from fork β
β β’ Hybrid search: pgvector + pg_trgm β
β β’ Applies heuristics: repetition, templates, length β
β β’ Writes evaluations back to fork β
β β
β Agent 3: Curator β
β β’ Aggregates evaluation results β
β β’ Calculates overall slop percentage β
β β’ Identifies top offenders β
β β’ Creates curated_flags snapshot β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
β Merge results back
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Results in Main DB β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Why Database Forks?
- Isolation: Each analysis job operates in its own fork without blocking others
- Consistency: Agents see consistent snapshots of data within their fork
- Performance: Zero-copy forks are instant, no data duplication
- Rollback: Failed analyses can be discarded without affecting main DB
- Parallelism: Multiple jobs run truly in parallel across forks
π How It Works
Analysis Flow
Job Creation & Fork:
- User requests analysis via Chrome extension
- Backend creates zero-copy fork:
fork_page_abc123 - Job metadata stored in main database
Agent 1 - Collector (runs in fork):
- Extracts text from webpage
- Splits into paragraphs
- Generates embeddings using sentence transformers
- Stores in forkβs
paragraphstable
Agent 2 - Evaluator (parallel, runs in fork):
-
Hybrid Search: Uses both:
-
pgvectorfor semantic similarity -
pg_trgmfor keyword/template matching -
Applies heuristic scoring:
-
Template phrase detection
-
Repetition analysis (using pg_trgm)
-
Content length checks
-
Generic writing patterns
-
Stores scores in forkβs
evaluationstable
Agent 3 - Curator (runs in fork):
- Aggregates all evaluation scores
- Calculates overall slop percentage
- Identifies worst offending paragraphs
- Creates snapshot in
curated_flags
Merge & Cache:
- Results merged back to main database
- Cached for instant repeat analyses
- Fork cleaned up (zero-copy = instant)
Real-time Updates:
- WebSocket streams progress to extension
- Shows: collector β embedding β evaluating β curator
Results Display:
- Color-coded highlighting in browser
- Paragraph-level explanations
π§ͺ Testing
Test the API directly:
# Health check
curl http://localhost:8000
# Analyze content
curl -X POST http://localhost:8000/analyze \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"text": "Your content here..."
}'
# Check status
curl http://localhost:8000/status/page_abc123
π Troubleshooting
Server Issues
Server wonβt start?
# Reinstall dependencies
pip install -r requirements.txt --upgrade
# Check Python version
python --version # Should be 3.11+
Database connection errors?
# Verify database is accessible
psql $env:DATABASE_URL -c "SELECT version();"
# Reinitialize schema
psql $env:DATABASE_URL -f db/schema.sql
# Check pgvector extension
psql $env:DATABASE_URL -c "SELECT * FROM pg_extension WHERE extname='vector';"
Port already in use?
# Use a different port
$env:PORT = "8001"
uvicorn fastapi_app.main:app --reload --port 8001
Extension Issues
Extension not connecting to server?
- Verify server is running:
http://localhost:8000 - Check browser console for CORS errors
- Ensure
host_permissionsin manifest.json includes your server URL
No results appearing?
- Check browser console for errors
- Verify WebSocket connection is established
- Check server logs for analysis errors
Extension not loading?
- Ensure all files are present in
extension/folder - Check Chrome Extensions page for error messages
- Try reloading the extension
Performance Issues
Analysis taking too long?
# Increase parallel processing
MAX_CONCURRENT_EVAL=20
BATCH_SIZE=20
High memory usage?
# Disable raw text persistence
PERSIST_RAW=false
π Agentic Postgres Challenge
This project demonstrates innovative use of Tigerβs Agentic Postgres features in a production deployment:
β Challenge Requirements Met
Multi-agent collaboration using separate database forks β
- Each analysis job gets its own zero-copy fork on Tiger Cloud
- Three specialized agents (Collector, Evaluator, Curator) collaborate within fork
- True isolation without performance overhead
- Live and functional with real web page analyses
Novel uses of hybrid search β
- Combines pgvector semantic embeddings with pg_trgm keyword matching
- Detects βslopβ through both meaning and pattern recognition
- Leverages Tigerβs optimized extension performance
- Proven effective in production use
Developer productivity hacks β
- Zero-copy forks enable fearless parallel processing
- Failed analyses donβt pollute main database
- Instant rollback for debugging agent behavior
- Real-world benefit demonstrated with Chrome extension
Agent-first application β
- Designed around agent isolation via forks
- Each agent has its own data lifecycle within fork
- Fork-merge pattern enables clean agent orchestration
- Architectural innovation showcased in production
Tiger Features Showcased
- β Tiger Cloud Deployment: Production database running on Tiger infrastructure
- β Tiger MCP: Agent orchestration via Model Context Protocol
- β Tiger CLI: Automated fork creation and management in codebase
- β pg_text search: Full-text matching for template detection
- β Zero-copy forks: Instant job isolation without data duplication
- β Fluid Storage: Dynamic data flow between agents in fork
- β Hybrid Search: pgvector + pg_trgm for comprehensive analysis
Deployment Status
- Database: β Deployed on Tiger Cloud
- Schema: β pgvector and pg_trgm extensions active
- API: β FastAPI backend functional
- Extension: β Chrome extension ready for testing
- Fork System: β Zero-copy fork creation implemented
How to Test
- Install the Chrome extension from the
extension/folder - Visit any webpage with substantial text content
- Click the Sloppy icon and select βAnalyze This Pageβ
- Watch real-time progress as agents work in their isolated fork
- View results with paragraph-level slop detection
Development Guidelines
- Follow PEP 8 style guide for Python code
- Add tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Tiger Data - Agentic Postgres platform
- FastAPI - Modern web framework
- pgvector - Vector similarity search
- Sentence Transformers - Text embeddings
- Chrome Extensions team for Manifest V3
π§ Contact
For questions or support, please open an issue on GitHub.
Made with β€οΈ for better web content quality