{
  "markdown": "# Tru8 — AI-Powered Evidence Research Platform\n\nTru8 organises evidence so you can decide what matters. Submit a claim or URL, and Tru8 retrieves evidence from the open web and specialist APIs, classifies it by tier (primary / reporting / commentary) and type (data / official / news / analysis / opinion / academic), decomposes claims into elements, maps evidence to those elements, and presents the full landscape — structured, not summarised.\n\n**Mission:** \"We organise; you decide.\"\n\n## Quick Start\n\n### Prerequisites\n\n- Docker & Docker Compose\n- Python 3.11+\n- Node.js 20+\n\n### 1. Start Infrastructure\n\n```bash\ndocker-compose up -d    # PostgreSQL 16, Redis 7, Qdrant\n```\n\n### 2. Backend\n\n```bash\ncd backend\npython -m venv venv\nsource venv/bin/activate    # Windows: venv\\Scripts\\activate\npip install -r requirements.txt\ncp .env.example .env        # Edit with your API keys\nalembic upgrade head\nuvicorn app.main:app --reload    # http://localhost:8000\n```\n\n### 3. Frontend\n\n```bash\ncd web\nnpm install\nnpm run dev    # http://localhost:3000\n```\n\n## Project Structure\n\n```\ntru8/\n├── backend/              # FastAPI backend + evidence pipeline\n│   ├── app/\n│   │   ├── api/v1/       # REST endpoints (checks, agent, verify, payments)\n│   │   ├── core/         # Config, auth, pricing, manifest signing\n│   │   ├── models/       # SQLModel schemas (Check, Claim, Evidence, ClaimConsensus)\n│   │   ├── pipeline/     # Two-phase evidence pipeline\n│   │   ├── services/     # API adapters, search, payments, consensus\n│   │   └── utils/        # Classifiers, deduplication, query planning\n│   ├── alembic/          # Database migrations\n│   ├── tru8_mcp/         # MCP server package for AI agents\n│   └── tests/            # 990 unit + integration tests\n├── web/                  # Next.js 14 frontend\n│   ├── app/              # Pages (dashboard, developers, public reports)\n│   ├── components/       # Evidence views, claim map, marketing\n│   └── lib/              # API client, tiers, diagnostics\n├── shared/               # Shared TypeScript types\n├── docker-compose.yml    # PostgreSQL, Redis, Qdrant, MinIO (optional)\n└── .claude/CLAUDE.md     # Full engineering context\n```\n\n## Pipeline\n\nTwo-phase pipeline with user claim selection gate (article mode):\n\n```\nPhase 1:  Ingest → Extract claims → Classify article → Rank claims\n          [PAUSE — user selects claims]\n\nPhase 2:  Fact-check lookup → Decompose into elements → Retrieve evidence →\n          Score relevance → Classify tier/type → Map evidence to elements →\n          Derive orientation → Complete\n\nPost:     Coverage recovery (Stage 5.1), video recommendations, auto-archiving\n```\n\nEvidence flows through web search plus specialist source adapters:\n\n| Category | Sources |\n|----------|---------|\n| Web search | Serper.dev, Brave Search, SerpAPI (fallback chain) |\n| Fact-check | Google Fact-Check API |\n| Government | GOV.UK, Hansard, GovInfo, Companies House, ONS |\n| Legal | UK Legislation (legislation.gov.uk) |\n| Economic | FRED, Marketaux, World Bank |\n| Academic | Semantic Scholar, OpenAlex, PubMed |\n| Climate | NOAA, WeatherAPI, Open-Meteo, GBIF |\n| Archives | Wikipedia (+ reference mining), Library of Congress, Internet Archive |\n| Health | WHO |\n| Sports | Transfermarkt, Football-Data.org |\n| Video | YouTube Data API |\n\n## Six Evidence Views\n\n| View | Question it answers |\n|------|-------------------|\n| Cartographer | What's the shape of this conversation? |\n| Librarian | Is this the full set, clearly labelled? |\n| Interpreter | Does this evidence answer this sub-question? |\n| Projectionist | What's been said on camera? |\n| Chronologist | When did the evidence appear? |\n| Seeker | What don't we know yet? |\n\n## API & Agent Access\n\nTru8 exposes a developer API and MCP server for AI agents.\n\n### Agent Commerce Gateway\n\n```bash\n# Quick check (~15s, heuristic classification)\ncurl -X POST https://api.trueight.com/api/v1/agent/quick \\\n  -H \"X-API-Key: $TRU8_API_KEY\" \\\n  -d '{\"claim\": \"UK inflation is 3.2%\"}'\n\n# Smart endpoint with tier fallback (lookup → consensus → quick → full)\ncurl -X POST https://api.trueight.com/api/v1/agent/check \\\n  -H \"X-API-Key: $TRU8_API_KEY\" \\\n  -d '{\"claim\": \"UK inflation is 3.2%\", \"max_tier\": \"full\"}'\n```\n\n| Tier | Cost | Time | What you get |\n|------|------|------|-------------|\n| Lookup | ~£0.02 | instant | Cached prior analysis |\n| Consensus | ~£0.03 | instant | Cross-user aggregate landscape (k>=3 checks) |\n| Quick | ~£0.07 | ~15s | Web search + heuristic classification |\n| Full | ~£0.15 | ~60-90s | web + specialist APIs, LLM classification, element decomposition |\n\nThree payment rails: x402 (USDC/SIWE), Skyfire (JWT), prepaid credits.\n\n### MCP Server\n\n```json\n{\n  \"mcpServers\": {\n    \"tru8\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"tru8_mcp\"],\n      \"env\": { \"TRU8_API_KEY\": \"tru8_sk_...\" }\n    }\n  }\n}\n```\n\nTools: `tru8_check` (evidence research with tier fallback), `tru8_get_result` (with analytics), `tru8_get_result_raw`.\n\n### Manifest Verification\n\nEvery completed check receives an HMAC-SHA256 signed manifest. Verify the signed fields haven't changed since signing:\n\n```bash\ncurl https://api.trueight.com/verify/{check_id}\n```\n\n## Testing\n\n```bash\ncd backend\npytest tests/ -v                        # Full suite (990 tests)\npytest tests/unit/pipeline/ -v          # Pipeline unit tests\npytest tests/unit/agent/ -v             # Agent/commerce tests\npytest tests/integration/ -v            # Integration tests\n```\n\n## Infrastructure\n\n| Service | Port | Purpose |\n|---------|------|---------|\n| PostgreSQL 16 | 5433 | Primary database (SQLModel) |\n| Redis 7 | 6379 | Cache + rate limiting |\n| Qdrant | 6333 | Vector similarity search |\n| MinIO (optional) | 9000 | Local S3 for file uploads |\n\nAuth: Clerk (JWT + JWKS) for dashboard, API keys for developer access.\nPayments: Stripe (4 subscription tiers) + Agent per-use payments.\n\n## API Documentation\n\n- **Swagger UI:** http://localhost:8000/api/docs\n- **ReDoc:** http://localhost:8000/api/redoc\n- **Health:** http://localhost:8000/api/v1/health/\n\n## Environment Variables\n\nCopy `backend/.env.example` to `backend/.env`. Key groups:\n\n| Group | Required | Variables |\n|-------|----------|-----------|\n| Database | Yes | `DATABASE_URL` |\n| Redis | Yes | `REDIS_URL` |\n| Auth | Yes | `CLERK_SECRET_KEY`, `CLERK_JWT_ISSUER` |\n| LLM | Yes | `GOOGLE_AI_API_KEY`, `OPENAI_API_KEY` |\n| Search | Yes (at least one) | `SERPER_API_KEY`, `BRAVE_API_KEY`, `SERP_API_KEY` |\n| Payments | For subscriptions | `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` |\n| Government APIs | Optional | `FRED_API_KEY`, `NOAA_API_KEY`, etc. |\n| Manifest signing | Optional | `MANIFEST_SIGNING_ENABLED`, `MANIFEST_SIGNING_KEY` |\n\nFeature flags (all default to sensible values): `ENABLE_API_RETRIEVAL`, `ENABLE_LLM_RELEVANCE_SCORER`, `ENABLE_QUERY_PLANNING`, etc. See `backend/.env.example` for the full list.\n\n## Licence\n\nPrivate — All rights reserved.\n",
  "bytes": 6925,
  "sha": "996f6b843597c940db7471f0949ff89dca6396a6fbc2ecfb68873d444ac55333",
  "repo_slug": "samyatessmith/tru8",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_samyatessmith_tru8_a680680e/readme"
}