Skip to content

Repository files navigation

SHATTERED

SHATTERED - Intelligence Analysis Platform

A modular, local-first platform for document analysis and investigative research

License: MIT Python 3.10+ TypeScript React 18

Philosophy | Architecture | Features | Quick Start | Security | Production | Shards | Documentation

Recommended deployment. Use the default Docker installation for one investigator on a trusted machine. Remote connections are unsafe and unsupported. The standard setup blocks outbound provider connections. Existing accounts retain their data, with access restrictions for older features. Known limitations and test results · Upgrade instructions

Screenshots (click to expand)

Dashboard & LLM Configuration

Configure local or cloud LLM providers with one-click switching between LM Studio, Ollama, OpenAI, Groq, and custom endpoints.

Dashboard

ACH Analysis with AI Assistant

Full Analysis of Competing Hypotheses implementation with AI-powered observations, recommendations, and devil's advocate mode.

ACH Matrix with AI

Graph Visualization

Interactive network analysis with 10+ visualization modes including force-directed layouts and geospatial mapping.

Force-Directed Geospatial
Force Graph Geospatial

Timeline Analysis

Temporal event extraction with AI-powered analysis, conflict detection, and phase management.

Timeline

Pattern Detection

Automated pattern recognition across documents with statistical analysis and AI interpretation.

Patterns

Credibility Assessment

Source reliability scoring with deception detection checklists (MOM, POP, MOSES, EVE).

Credibility

Search with Regex Presets

Hybrid semantic/keyword search with built-in regex patterns for PII, financial data, and technical indicators.

Search

Media Forensics

Image authenticity analysis with EXIF extraction, Error Level Analysis (ELA), perceptual hashing, and reverse image search integration.

Media Forensics


Philosophy

SHATTERED isn't a product - it's a platform. The shards are the products. Or rather, bundles of shards configured for specific use cases.

Core Principles:

  • Build domain-agnostic infrastructure that supports domain-specific applications
  • Lower the bar for contribution so non-coders can build custom shards
  • Provide utility to people in need, not just those who can pay
  • Local-first: Your data never leaves your machine unless you want it to
  • Privacy-preserving: No telemetry, no cloud dependencies, full data sovereignty

The Meta-Pattern

Every investigative workflow follows the same fundamental pattern:

INGEST --> EXTRACT --> ORGANIZE --> ANALYZE --> ACT
  |          |           |            |          |
  |          |           |            |          +-- Export, Generate, Notify
  |          |           |            +-- ACH, Contradictions, Patterns, Anomalies
  |          |           +-- Timeline, Graph, Matrix, Provenance
  |          +-- Entities, Claims, Events, Relationships
  +-- Documents, Data, Communications, Records
  • Core shards handle INGEST and EXTRACT
  • Domain shards handle ORGANIZE and ANALYZE
  • Output shards handle ACT

Architecture

SHATTERED uses the Voltron architectural philosophy: a modular, plug-and-play system where self-contained shards combine into a unified application.

                    +------------------+
                    |   ArkhamFrame    |    <-- THE FRAME (immutable core)
                    |   (17 Services)  |
                    +--------+---------+
                             |
                    +--------+---------+
                    |   arkham-shell   |    <-- THE SHELL (UI renderer)
                    | (React/TypeScript)|
                    +--------+---------+
                             |
        +--------------------+--------------------+
        |         |          |          |         |
   +----v----+ +--v--+ +-----v-----+ +--v--+ +---v---+
   |Dashboard| | ACH | |  Search   | |Graph| |Timeline|  <-- SHARDS (26)
   +---------+ +-----+ +-----------+ +-----+ +--------+

Core Design Principles

  1. Frame is Immutable: Shards depend on the Frame, never the reverse
  2. No Shard Dependencies: Shards communicate via events, not imports
  3. Schema Isolation: Each shard gets its own PostgreSQL schema
  4. Graceful Degradation: Works with or without AI/GPU capabilities
  5. Event-Driven Architecture: Loose coupling through pub/sub messaging

Features

AI-Powered Analysis

Feature Description
AI Junior Analyst LLM-powered analysis across all shards - anomaly detection, contradiction finding, pattern recognition, credibility assessment, and insight synthesis
LLM Summarization Automatic document and corpus summarization with multiple formats (brief, standard, detailed, executive, key points)
Deception Detection AI-assisted credibility assessment using MOM, POP, MOSES, and EVE checklists
Query Expansion Semantic search enhancement via LLM
Devil's Advocate AI-generated counter-arguments for ACH analysis

Structured Analytic Techniques

Technique Capabilities
ACH (Analysis of Competing Hypotheses) Full matrix analysis, evidence scoring, premortem analysis, cone of plausibility, corpus search integration, scenario planning, devil's advocate mode
Contradiction Detection Automated identification of conflicting claims across documents with severity scoring and resolution tracking
Pattern Recognition Recurring patterns, behavioral patterns, temporal patterns, correlation analysis with statistical significance
Anomaly Detection Statistical anomalies, contextual anomalies, collective anomalies with LLM-powered analysis
Credibility Assessment Source reliability scoring, bias indicators, deception detection checklists
Provenance Tracking Evidence chains, data lineage, audit trails, artifact verification

Advanced Visualization

Graph Analysis - 10+ visualization modes:

Mode Description
Force-Directed Interactive network layout with physics simulation
Hierarchical Tree-based layouts (top-down, bottom-up, radial)
Circular Entities arranged in circular patterns
Sankey Flow diagrams showing relationships and quantities
Matrix Adjacency matrix for dense relationship analysis
Geographic Map overlays with Leaflet integration
Causal Cause-and-effect relationship visualization
Argumentation ACH integration showing evidence-hypothesis relationships
Link Analysis i2 Analyst Notebook-style investigation graphs
Temporal Time-based graph evolution

Graph Analytics:

  • Centrality measures (degree, betweenness, closeness, eigenvector, PageRank)
  • Community detection algorithms
  • Path finding (shortest path, all paths, critical paths)
  • Cycle detection
  • Component analysis

Timeline Analysis:

  • Temporal event extraction and visualization
  • Date normalization across formats
  • Conflict detection for overlapping events
  • Phase/period management
  • Gap analysis
  • Event clustering

Document Processing Pipeline

Stage Capabilities
Ingest Multi-format support (PDF, DOCX, images, HTML, TXT), batch processing, duplicate detection, job queue management
OCR Local Tesseract for standard OCR, Vision LLM for complex documents (supports local Qwen-VL or cloud APIs like GPT-4o), language detection, confidence scoring
Parse 8 chunking strategies, metadata extraction, relations extraction, table detection
Embed Multiple embedding models, batch processing, incremental updates
Entity Extraction spaCy-powered NER (PERSON, ORG, GPE, DATE, etc.), relationship detection, duplicate merging
Claim Extraction Factual claim identification, source attribution, verification status tracking

Search Capabilities

Type Description
Semantic Search Vector similarity using pgvector embeddings
Keyword Search PostgreSQL full-text search with BM25 ranking
Hybrid Search Combined semantic + keyword with configurable weights
Similarity Search Find documents similar to a reference document
Faceted Search Filter by project, document type, date range, entities

Export & Reporting

Feature Formats
Data Export JSON, CSV, PDF, DOCX
Analytical Reports Investigation summaries, entity profiles, timeline reports, ACH reports
Letters FOIA requests, complaints, legal correspondence with templates
Packets Complete investigation bundles with versioning and sharing
Templates Jinja2-based template system with placeholder validation

Frame Services

The Frame provides 17 core services available to all shards:

Service Description
ConfigService Environment + YAML configuration management
ResourceService Hardware detection, GPU/CPU management, tier assignment
StorageService File/blob storage with categories and lifecycle
DatabaseService PostgreSQL with per-shard schema isolation
VectorService pgvector-based vector storage for embeddings and similarity search
LLMService OpenAI-compatible LLM integration (LM Studio, Ollama, vLLM)
ChunkService 8 text chunking strategies (semantic, sentence, fixed, etc.)
EventBus Pub/sub messaging for inter-shard communication
WorkerService PostgreSQL-based job queues (SKIP LOCKED) with specialized worker pools
DocumentService Document CRUD with content and metadata access
EntityService Entity extraction, relationships, and deduplication
ProjectService Project organization and management
ExportService Multi-format export (JSON, CSV, PDF, DOCX)
TemplateService Jinja2 template rendering and management
NotificationService Email, webhook, and log notifications
SchedulerService APScheduler-based job scheduling
AIJuniorAnalystService LLM-powered cross-shard analysis

Implemented Shards

System (3 shards)

Shard Description Key Features
Dashboard System monitoring and administration Service health, database stats, worker management, event log, LLM configuration
Projects Project organization Project CRUD, document organization, bulk operations
Settings Application configuration 7 setting categories, import/export, reset capabilities

Data Pipeline (6 shards)

Shard Description Key Features
Ingest Document ingestion Multi-format support, batch processing, job queue, duplicate detection
Documents Document management CRUD operations, content access, metadata, batch operations
Parse Document parsing 8 chunking strategies, relations extraction, table detection
Embed Vector embeddings Multiple models, batch processing, incremental updates
OCR Text extraction Tesseract, optional PaddleOCR, Vision LLM (local or cloud), language detection, confidence scoring
Entities Entity management NER extraction, relationships, deduplication, type management

Search (1 shard)

Shard Description Key Features
Search Document search Semantic, keyword, hybrid search, facets, suggestions

Analysis (9 shards)

Shard Description Key Features
ACH Analysis of Competing Hypotheses Matrix analysis, premortem, cone of plausibility, corpus search, scenarios
Claims Claim extraction Document extraction, verification status, source attribution
Credibility Source assessment Reliability scoring, bias detection, deception checklists (MOM/POP/MOSES/EVE)
Contradictions Conflict detection Cross-document analysis, severity scoring, resolution tracking
Anomalies Anomaly detection Statistical, contextual, collective anomalies, LLM analysis
Patterns Pattern recognition Recurring, behavioral, temporal, correlation patterns
Provenance Evidence chains Data lineage, audit trails, artifact verification
Summary Auto-summarization Multiple summary types, batch processing, auto-summarize on ingest
Media Forensics Image authenticity analysis EXIF extraction, ELA analysis, perceptual hashing, C2PA verification, reverse image search

Visualization (2 shards)

Shard Description Key Features
Graph Network visualization 10+ layout modes, analytics, cross-shard integration
Timeline Temporal visualization Event extraction, date normalization, phases, gap detection

Export (5 shards)

Shard Description Key Features
Export Data export JSON, CSV, PDF, DOCX, job management
Reports Report generation Multiple report types, templates, scheduling
Letters Letter generation FOIA, complaints, legal templates
Packets Investigation bundles Versioning, sharing, access control
Templates Template management Jinja2 syntax, versioning, validation

For the permissions, export changes and recovery procedure in the document security update, see the Reports and Letters upgrade guide.


Tech Stack

Backend

Component Technology
Runtime Python 3.10+
API Framework FastAPI with async/await
Database PostgreSQL 15+ with pgvector extension
Job Queue PostgreSQL (SKIP LOCKED pattern)
Vector Store pgvector (PostgreSQL extension)

Frontend

Component Technology
Framework React 18 + TypeScript 5
Build Tool Vite
Styling TailwindCSS + shadcn/ui
Icons Lucide React
State URL state + local storage
Charts Recharts
Maps Leaflet

AI/ML (Optional)

Component Options
LLM Inference LM Studio, Ollama, vLLM, OpenAI API
NER spaCy (en_core_web_sm/lg/trf)
OCR Tesseract, optional PaddleOCR, Vision LLM (Qwen-VL local, or cloud GPT-4o/Claude)
Embeddings sentence-transformers, OpenAI
Reverse Image Search TinEye and Google Vision (optional APIs for Media Forensics)

Quick Start

Use Docker Engine 28 or newer with Linux containers, Docker Compose v2 and Python 3.10 or newer on the same trusted computer. For a fresh installation, run these commands in the repository.

python scripts/configure_local.py
python scripts/local.py build
python scripts/local.py up
docker exec shattered-app python -m arkham_frame.auth.bootstrap

Open ArkhamMirror on that computer. Enter the one-time setup token and choose your owner password. Run python scripts/local.py status to check the running configuration. Use python scripts/local.py stop to stop without removing data.

To skip the build on Linux x86-64, install both published Docker images with the matching release checkout.

Already have case files? Follow the upgrade and backup instructions first. Keep your existing database password, configuration and volumes. Review template ownership if saved templates are missing.

Authentication & Security

The supported default is one investigator on one trusted computer. The installation owner has the full workspace in the original single organization. Existing additional accounts retain only their limited organization features. Project selection in a tab is a view preference. It does not restrict account access.

An optional project teams pilot adds case assignments for analysts and read-only access for supervised viewers on that same computer. Upgrade leaves it off. Enabling it permanently replaces the limited organization features for other accounts. All administrators gain access to every active project. Review the accounts and test a backup first. Remote and shared production hosting remain unsupported.

After upgrading, sign in again. The app locks after 15 minutes of inactivity and sessions expire after one hour by default. Save edits before leaving the computer. Security and reporting

Local operation

Remote access, LAN hosting, reverse proxies and tunnels are unsafe and unsupported. The web port is fixed to IPv4 loopback. The app and database run on private internal networks. A separate offline worker processes supported files without a case volume or credentials. Keep the host, Docker and browser updated.

The build needs internet access. The default running app has no outbound route. Keyword search, English Tesseract OCR and the bundled map work locally. Cloud AI, model downloads and even a model server on the host require explicit outbound access. See the network choices and offline guide before changing that setting.

Manual source setups are for development with disposable data. See the startup guide.

Use Cases

SHATTERED supports diverse investigative workflows:

Journalism & OSINT

  • Social Media Analysis: Archive posts, extract entities, map networks
  • FOIA Tracking: Request templates, deadline tracking, response analysis
  • Source Verification: Credibility assessment, claim verification, contradiction detection
  • Publication Prep: Claim extraction, citation tracing, fact-check reports

Legal Self-Advocacy

  • Tenant Defense: Violation chronology, housing code matching, evidence packets
  • Employment Rights: Incident documentation, labor law elements, EEOC prep
  • Consumer Protection: Warranty extraction, demand letters, small claims prep
  • Case Building: Timeline construction, evidence organization, pattern identification

Healthcare Self-Advocacy

  • Chronic Illness Management: Lab results parsing, symptom tracking, treatment analysis
  • Insurance Appeals: Denial tracking, appeal letters, medical necessity documentation
  • Diagnosis Research: Test organization, symptom progression, specialist prep

Civic Engagement

  • Government Oversight: Meeting minutes parsing, vote tracking, promise vs action analysis
  • Campaign Finance: Donor identification, bundling detection, money flow mapping
  • Policy Analysis: Document comparison, stakeholder mapping, impact assessment

Financial Analysis

  • Fraud Detection: Benford analysis, transaction anomalies, duplicate detection
  • Investment Research: SEC filings analysis, financial statement parsing, news tracking
  • Audit Support: Evidence chains, provenance tracking, documentation verification

Intelligence Analysis

  • Structured Analysis: ACH matrices, alternative hypotheses, scenario planning
  • Link Analysis: Entity relationships, network mapping, path analysis
  • Temporal Analysis: Event timelines, pattern detection, prediction support

Development

Creating a New Shard

  1. Use arkham-shard-ach as reference implementation
  2. Follow the manifest schema in docs/shard_manifest_schema_prod.md
  3. Implement the ArkhamShard interface from the Frame
  4. No direct shard imports - use events for inter-shard communication
  5. Add comprehensive tests

Shard Structure

packages/arkham-shard-{name}/
+-- pyproject.toml          # Package definition with entry point
+-- shard.yaml              # Manifest (navigation, events, capabilities)
+-- README.md               # Documentation
+-- arkham_shard_{name}/
    +-- __init__.py         # Exports {Name}Shard class
    +-- shard.py            # Shard implementation
    +-- api.py              # FastAPI routes
    +-- models.py           # Pydantic models (optional)
    +-- services/           # Business logic (optional)

Testing

# Run all tests
pytest

# Run specific shard tests
pytest packages/arkham-shard-ach/tests/

# Type checking
mypy packages/arkham-frame/
mypy packages/arkham-shard-ach/

# Linting
ruff check packages/

API Development

All shards expose REST APIs that are auto-documented via FastAPI:

from fastapi import APIRouter, Depends
from arkham_frame import get_frame

router = APIRouter(prefix="/api/myshard", tags=["myshard"])

@router.get("/items")
async def list_items(frame=Depends(get_frame)):
    # Access frame services
    db = frame.db
    events = frame.events
    llm = frame.llm  # Optional service
    return {"items": [...]}

Documentation

Document Description
SECURITY.md Security best practices and deployment guide
CLAUDE.md Project guidelines and development standards
docs/voltron_plan.md Architecture deep-dive
docs/shard_manifest_schema_prod.md Production manifest schema
packages/arkham-frame/README.md Frame services documentation
packages/arkham-shard-shell/README.md UI shell documentation

Each shard has its own README with API documentation, events, and usage examples.


Project Status

Metric Value
Lines of Code ~217,000
Total Packages 27 (26 shards + shell)
Frame Services 17
API Endpoints 400+
Graph Visualization Modes 10+
Chunking Strategies 8
Infrastructure PostgreSQL-only (pgvector + SKIP LOCKED)

Recent Major Features

  • PostgreSQL-only architecture - Eliminated Redis and Qdrant dependencies
  • pgvector integration - Native PostgreSQL vector search
  • AI Junior Analyst integration across all analysis shards
  • Full ACH implementation with premortem, cone of plausibility, corpus search
  • Link Analysis mode (i2-style) for graph visualization
  • Deception detection with MOM/POP/MOSES/EVE checklists
  • Evidence chain provenance tracking
  • Shared template system for exports

Support

If you find SHATTERED useful, consider supporting development:

Support on Ko-fi

Contributing

Contributions welcome! See CLAUDE.md for project guidelines.

Ways to contribute:

  1. Bug Reports: Open issues with reproduction steps
  2. Feature Requests: Describe your use case
  3. Code: Follow the shard development guidelines
  4. Documentation: Help improve guides and examples
  5. Bundles: Create pre-configured shard bundles for specific use cases

License

MIT License - Copyright (c) 2025-2026 Justin McHugh

See LICENSE for details.


SHATTERED - Break documents into pieces. Reassemble the truth.

Built for journalists, investigators, advocates, and anyone seeking truth in documents.