Open Polityra
Independent open-source research and strategic intelligence platform for transparent,
source-grounded analysis using public data.

Website: open.polityra.org
This is an independent, early-stage project. It is not an official government system, public
authority, political party, or government commission. It does not make or automate public
decisions. Human institutions remain responsible for all decisions.
Contents
What is Open Polityra?
Open Polityra is a community-built platform for analysing geopolitical and global developments using
public, lawfully usable data. It supports risk analysis, scenario comparison and source-grounded
reporting. Every material claim should be traceable to a source, every model output requires human
review, and methods and limitations are kept inspectable.
Typical use cases:
- Monitoring and summarising public news and data feeds across regions and topics.
- Comparing transparent scenarios and assumptions instead of single “predictions”.
- Risk analysis for economics, energy, security, critical infrastructure and governance.
- Evaluating AI models against historical data and independent human review.
Project status
The repository is an evolving project scaffold. Features, datasets, models, research methods, and
governance arrangements may be incomplete or experimental. Do not use prototype outputs as the sole
basis for financial, public-policy, security, or operational decisions.
See ROADMAP.md for planned work and CHANGELOG.md for changes.
Goals
- Bring together public, lawfully usable information from documented sources to study global
economics, geopolitics, security, resilience, energy, and governance.
- Support analysis of economic indicators, geopolitical developments, national and international
security, cybersecurity, public services, and critical infrastructure.
- Compare transparent scenarios and assumptions rather than present one predetermined political
answer.
- Make methods, limitations, uncertainty, and source provenance inspectable.
- Evaluate models against historical data and independent human review.
- Build an open community for software engineering, research, and public-interest technology.
Non-goals
- Replacing democratic processes, public authorities, courts, or legislative bodies.
- Giving an AI system political authority or autonomous decision-making power.
- Producing classified intelligence or collecting non-public sensitive information.
- Providing operational instructions for cyberattacks, violence, or other harm.
- Claiming that forecasts are facts or that scenarios are certain predictions.
- Presenting AI-generated analysis as verified factual conclusions without human review.
Repository structure
| Path |
Purpose |
apps/web/ |
Next.js dashboard, landing pages, analysis history, reports and human review |
apps/api/ |
Express backend API — auth, sources, datasets, analyses, reports, and RSS/Atom news ingestion |
services/analysis-worker/ |
Python extraction and analysis service |
services/rust/ |
Durable queue worker, ingestion, normalization, hashing and deduplication |
packages/contracts/ |
Shared schemas and API contracts across all services |
packages/api-client/ |
Typed frontend API client |
packages/ui/ |
Shared design system and reusable components |
packages/database/ |
PostgreSQL migrations, seeds, and query library |
data/ |
Data source catalogues, schemas, validation rules, sample fixtures |
research/ |
Research methods, domain studies, working papers, publications |
models/ |
AI model registry, prompts, adapters, and model cards |
evaluation/ |
Benchmarks, backtesting, calibration, bias evaluation, security testing |
governance/ |
Project governance, community rules, ethics, foundation planning |
docs/ |
Architecture, product specs, developer guides, operations manuals |
infra/ |
Local and deployment infrastructure (PostgreSQL, Redis, containers) |
scripts/ |
Setup, database, data import, and release automation |
tests/ |
Cross-application integration, e2e, performance, and security tests |
.github/ |
Issue templates, CI/CD workflows, repository automation |
Getting started
Prerequisites
- Git
- Node.js 22 or later
- pnpm 12 (matching the root
packageManager version)
- Python 3.11 or later (for the analysis service)
- Rust stable toolchain with Cargo (for the durable pipeline worker)
- PostgreSQL 16+ for application persistence (or
docker compose from infra/)
Setup
git clone https://github.com/Polityra/Open-Polityra.git
cd Open-Polityra
corepack enable
pnpm install
cp .env.example .env
Set strong values for JWT_SECRET, CRON_SECRET and INTERNAL_SERVICE_TOKEN. The internal token
is server-only and must not use a NEXT_PUBLIC_ prefix.
Python analysis worker setup:
cd services/analysis-worker
pipx install poetry
poetry install --with dev
Install and start local Ollama, then pull the configured model:
ollama pull olmo-3:7b
ollama serve
Set AI_MODEL=olmo-3:7b for the Express API and OLLAMA_MODEL=olmo-3:7b for the Python worker.
Both services use OLLAMA_BASE_URL to reach the local Ollama instance. In infra/containers,
Docker Compose starts an Ollama service; run
docker compose -f infra/containers/docker-compose.yml exec ollama ollama pull olmo-3:7b before
running analyses.
The Compose database applies every migration when creating a new volume. The following script
reapplies every migration and is intended only for a fresh database:
DATABASE_URL=postgresql://postgres:change_me@localhost:5432/open_polityra ./scripts/database/migrate.sh
For an existing database with migrations through 005 already applied, export DATABASE_URL and
apply the analysis migrations individually before starting the API:
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f packages/database/migrations/006_analysis_results.sql
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f packages/database/migrations/007_automatic_news_analyses.sql
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f packages/database/migrations/008_evidence_grounded_workflows.sql
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f packages/database/migrations/009_intelligence_pipeline.sql
Development commands (root)
pnpm dev # Start the web app, API, and Python analysis worker
pnpm build # Build all apps and packages
pnpm start # Start the built web app and API in parallel
pnpm lint # Lint all code
pnpm typecheck # Run configured TypeScript checks
pnpm test # Run configured Node workspace tests
Frontend development
cd apps/web && pnpm dev # http://localhost:3000
Backend development
cd apps/api && pnpm dev # http://localhost:4000
Python analysis service
cd services/analysis-worker && poetry run dev # http://localhost:8000
The Python worker dependencies are managed separately from the pnpm workspace, but pnpm dev starts
the worker automatically after setup. Analysis requests use only database-derived context and/or
caller-supplied observed values; the worker does not invent fallback observations. The
fiscal-balance prototype uses a deterministic calculation in the Express API.
The Rust pipeline worker is a separate long-running process:
cargo run --manifest-path services/rust/Cargo.toml --bin polityra-ingestion
Manual and automatic analyses are durable PostgreSQL jobs. POST /api/v1/analyses returns
202 Accepted immediately; the dashboard tracks the saved analysis ID through pending, running,
completed and failed states. Leases, retries and attempt history are stored in PostgreSQL. The
worker and configured Ollama model must both be available for AI synthesis, and generated summaries
require human review.
For news sources, the API checks the supplied feed and discovers advertised same-domain RSS/Atom
feeds or common paths when necessary. Only public HTTPS hosts within the source domain are accepted.
Discovery does not crawl the site and may require a manually supplied feed URL.
Architecture overview
- User → interacts with the Next.js frontend (
apps/web/)
- Frontend → uses the shared API client (
packages/api-client/)
- API Client → communicates with the Express backend (
apps/api/)
- Express Backend → validates requests, checks auth/permissions, accesses PostgreSQL
- Rust Pipeline Worker → claims durable jobs, ingests/normalizes sources and orchestrates
extraction, verification and report generation
- Python Analysis Service → handles computational analysis, typed extraction and evidence
matching
- Dashboard → provides Analysis History, detail pages and a Human Review queue with source
provenance
AI models and providers
Open Polityra is built around open-weight models and does not depend on any single vendor.
- Today: models run through a local or self-hosted Ollama instance
(default
olmo-3:7b, see Getting started). Model governance is described in
MODEL_POLICY.md.
- Planned: a provider adapter for OpenAI-compatible APIs, so the project can run larger
open-weight models on hosted infrastructure without code changes beyond configuration. Progress is
tracked in ROADMAP.md.
- Provider requirements: the project only sends public data to model providers. No personal
data, credentials, or non-public sensitive information are used (see
DATA_POLICY.md and PRIVACY.md). Providers with EU hosting and zero
data retention are preferred.
- Independence: providers and sponsors have no influence over analysis outputs, source
selection, or evaluation results (see SPONSORS.md).
The project is currently unfunded and relies on free tiers and in-kind support. If you operate an AI
service or cloud platform and would like to support open, public-interest analysis tooling, see
SPONSORS.md.
Development principles
- Evidence before narrative: material claims should link to traceable sources.
- Human accountability: outputs inform people; they do not make public decisions.
- Plurality: show competing explanations and policy options fairly.
- Uncertainty: distinguish observations, estimates, assumptions, and scenarios.
- Privacy and minimisation: collect only data necessary for a defined purpose.
- Security by design: use public data by default and protect credentials.
- Reproducibility: version data snapshots, methods, model configurations, and results.
- Independent evaluation: measure factuality, calibration, robustness, and bias.
Get involved
Open Polityra needs more than code. You can help with:
- Software engineering: TypeScript (Next.js, Express), Python, Rust, PostgreSQL.
- Research: methods, scenario design, domain studies in economics, security and energy.
- Data: cataloguing and validating public data sources.
- Evaluation: benchmarks, backtesting, calibration and bias review.
- Documentation and translation.
- Infrastructure support: AI inference capacity, hosting, GPU time (see
SPONSORS.md).
Good first steps:
- Read CONTRIBUTING.md, GOVERNANCE.md,
CODE_OF_CONDUCT.md, and SECURITY.md.
- Browse open issues or start a thread in
Discussions.
- Introduce yourself in the community chat (see below) and tell us what you would like to work on.
For research contributions, include methodology, assumptions, sources, limitations, and
reproducibility information. For code contributions, include tests and update relevant
documentation.
Community and communication
Community roles (maintainer, moderator, contributor, observer) are described in
GOVERNANCE.md. All spaces follow the Code of Conduct.
Open Polityra is currently unfunded and depends on in-kind support, mainly AI inference capacity and
compute, from organisations that share our goals. See SPONSORS.md for what we need,
what we offer in return, and how to get in touch.
Current supporters are listed in SPONSORS.md.
Governance and foundation status
The project may explore establishing a legal foundation in the future. No foundation should be
represented as established until it has been legally founded and registered where required. Until
then, governance documents are proposals for community discussion, not binding foundation rules.
Licensing
- Software: Apache License 2.0, see
LICENSE.
- Project documentation: intended CC BY 4.0 where explicitly marked.
- Datasets, model weights, and third-party materials: their own licenses and terms.
- Branding and trademarks: not automatically licensed for unrestricted use.
See LICENSES.md and THIRD_PARTY_NOTICES.md.
To cite this project, see CITATION.cff.
Disclaimer
This project is provided for research, education, and decision-support development. It is provided
without warranty. Outputs may be incomplete, incorrect, outdated, or misleading. Users must
independently verify information and consult qualified experts before relying on it.
Never disclose vulnerabilities, personal data, credentials, or confidential information in public
issues or discussions.
评论