PostPolice is a Chrome extension that detects and verifies claims on web pages in real-time. It uses a local Node.js proxy to securely handle AI requests through Groq and caches results using Valkey for high performance and low latency.
- Node.js (v18 or higher)
- Homebrew (for installing Valkey)
- Valkey (A high-performance Redis-compatible data store)
- Groq API Key (Get one at console.groq.com)
# Install Valkey
brew install valkey
# Start the service
brew services start valkeyClone the repository and install server dependencies:
cd PostPolice/server
npm installCreate a .env file in the root of the project:
# In PostPolice/.env
GROQ_API_KEY=your_api_key_hereRun the local bridge server:
cd PostPolice/server
npm startThe server will be running at http://localhost:3000.
- Open Chrome and navigate to
chrome://extensions. - Enable Developer mode (top right).
- Click Load unpacked.
- Select the
PostPolicedirectory (the root folder containingmanifest.json).
- Real-time Summarization: Automatically extracts verifiable claims from pages.
- Fact Verification: Checks claims against whitelisted news sources using Groq LLM logic.
- Semantic Verification Cache: Skips redundant AI calls by matching claims semantically (>95% similarity) using local vectors.
- High Performance Caching: Uses Valkey to store summaries and verification results for high efficiency.
- Secure Handling: API keys are stored server-side and never exposed to the client.
PostPolice uses a dual-layer caching strategy to minimize AI costs and latency:
- Exact Matching: Checked via SHA-256 hashes of the page content.
- Semantic Matching: Uses the HuggingFace Transformers.js library on the server to generate 384-dimensional embeddings for every claim.
- Model:
Xenova/all-MiniLM-L6-v2(Runs entirely locally). - Logic: If a claim being verified is 95% semantically similar to a previously verified claim, the server reuses the cached verdict instantly.
- Model:
Visit the built-in dashboard to monitor cache performance: 👉 http://localhost:3000/metrics
From the dashboard, you can:
- View Hit/Miss rates, Semantic Hits, and memory usage.
- Clear Cache: Instantly purge all cached data.
- Reset Stats: Zero out the performance counters.
MIT