- Pyproject.toml mit FastAPI, Pydantic v2, SQLAlchemy, httpx, asyncio, BeautifulSoup4, selectolax, trafilatura, uvicorn, pytest-asyncio - Multi-stage Dockerfile (Python 3.12-slim, Non-Root-User nsct) - docker-compose.yml (nsct-api + postgres + optional searxng) - .env.example mit allen Config-Parametern - Config-System: AppSettings mit LLMConfig, VisionConfig, AudioConfig, DatabaseConfig — komplett aus Environment, keine Hardcodes - Strukturiertes Logging mit research_id/llm_request_id Tracking - Pydantic v2 Schemas: SearchQuery, Source, Claim, EvidenceRelation, CitationEdge, ResearchReport - SQLAlchemy 2.0 Declarative Models + async Engine Factory - SSRF-Schutz: URL-Validation, IP-Blocklist (RFC1918, Cloud Metadata, file://, ftp://) - Provider-Interfaces: LLMProvider, VisionProvider, AudioProvider, SearchProvider, ContentFetcher als ABCs - Health-Endpoints: /health, /ready (LLM-Connect-Test), /providers - FastAPI App mit CORS, lifespan (LLM Pre-Flight) - CLI-Stub mit Entry-Points: nsct, nsct-core, nsct-api - 6 Test-Cases: /health, /ready, /providers + No-Secrets-Test - Vollständige Dokumentation: README, ARCHITECTURE, SECURITY, METHODOLOGY, API, DEPLOYMENT - .gitignore (Python, Docker, IDE, .env)
99 lines
3.6 KiB
Markdown
99 lines
3.6 KiB
Markdown
# ============================================================
|
|
# NSCT — Neutral Search Crawler Tool
|
|
# ============================================================
|
|
|
|
**NSCT** ist ein vollständig lokal betreibbares, containerisiertes Recherche- und
|
|
Analyse-System. Es durchsucht Webquellen, extrahiert Inhalte, vergleicht
|
|
Behauptungen (Claims) aus verschiedenen Quellen und erzeugt einen neutralen,
|
|
quellengestützten Bericht.
|
|
|
|
**NSCT steht für:** Neutral Search Crawler Tool.
|
|
|
|
## Architektur-Übersicht
|
|
|
|
```
|
|
┌─────────────┐ ┌──────────────┐ ┌───────────────┐
|
|
│ User / CLI │───▶│ NSCT API │───▶│ FastAPI / │
|
|
│ │ │ (FastAPI) │ │ uvicorn │
|
|
└─────────────┘ └──────────────┘ └───────────────┘
|
|
│
|
|
┌────────────┼─────────────┐
|
|
▼ ▼ ▼
|
|
┌───────────┐ ┌─────────┐ ┌──────────┐
|
|
│ LLM │ │ Vision │ │ Audio │
|
|
│ Provider │ │ Model │ │ Model │
|
|
└───────────┘ └─────────┘ └──────────┘
|
|
│ │ │
|
|
▼ ▼ ▼
|
|
┌─────────────────────────────────────┐
|
|
│ PostgreSQL (evidence store) │
|
|
└─────────────────────────────────────┘
|
|
▲
|
|
│
|
|
┌──────────────┐
|
|
│ SearXNG │ (optional search backend)
|
|
└──────────────┘
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
### Docker Compose
|
|
|
|
```bash
|
|
# 1. Kopiere die Beispiel-Env
|
|
cp .env.example .env
|
|
# 2. Trage deine Endpunkte ein (LLM, Vision, Audio, PostgreSQL)
|
|
|
|
# 3. Starte alles
|
|
docker compose up --build
|
|
|
|
# 4. Prüfe den Health-Check
|
|
curl http://localhost:8080/health
|
|
```
|
|
|
|
Die API ist danach unter `http://localhost:8080` erreichbar.
|
|
`/docs` zeigt die auto-generierte Swagger-Dokumentation (nur bei `NSCT_DEBUG=true`).
|
|
|
|
## Projektstruktur
|
|
|
|
```
|
|
nsct/
|
|
├── src/nsct/
|
|
│ ├── api/ # FastAPI-Routen
|
|
│ ├── models/ # Pydantic-Schemata
|
|
│ ├── providers/ # Abstrakte Provider-Interfaces
|
|
│ ├── security/ # SSRF-Schutz, URL-Validierung
|
|
│ └── storage/ # SQLAlchemy Models + Engine
|
|
├── tests/ # pytest-Tests
|
|
├── docker-compose.yml
|
|
├── Dockerfile
|
|
├── pyproject.toml
|
|
├── README.md
|
|
├── ARCHITECTURE.md
|
|
├── SECURITY.md
|
|
├── METHODOLOGY.md
|
|
├── API.md
|
|
├── DEPLOYMENT.md
|
|
└── .env.example
|
|
```
|
|
|
|
## Status
|
|
|
|
**Stage 0** — Repository und Architekturgrundlage.
|
|
|
|
Stage 0 enthält:
|
|
- Vollständige Projektstruktur mit allen Konfigurationsdateien
|
|
- Pydantic v2 Datenmodelle
|
|
- SQLAlchemy 2.0 Persistenzmodelle
|
|
- Sicherheitshards (SSRF-Schutz, IP-Blocklist)
|
|
- Provider-Interfaces (abstrakte Basisklassen)
|
|
- Health-, Ready- und Provider-Endpunkte
|
|
- Strukturiertes Logging
|
|
- Docker-Konfiguration für PostgreSQL, SearXNG und NSCT
|
|
|
|
Die eigentliche Evidence-Pipeline (Search, Fetch, Extract, Claim, Compare, Report)
|
|
wird in späteren Stages implementiert.
|
|
|
|
## Lizenz
|
|
|
|
MIT |