P2P Wiki AI — RAG chat and article generation for the P2P Foundation Wiki
  • Python 56.7%
  • HTML 19.3%
  • JavaScript 14.2%
  • Shell 9.2%
  • Dockerfile 0.6%
Find a file
Jeff Emmett c7ae8e1b2e feat(remix): expose Portico /v1/render via /remix endpoint
- src/api.py: POST /remix wraps Portico render verb (summary, excerpt,
  chunks, translation, markdown, text); surfaces degraded_from when
  engine forms walk the degradation ladder.
- src/intelligence_client.py: render() now passes collection (Portico
  rejects without it) and optional lang.
- src/rag.py: ChromaDB fallback log bumped INFO -> WARNING so silent
  fallback (which masked an unset bearer for weeks) is visible.

Verified live: 5 forms green, summary -> excerpt and translation ->
markdown degradation paths confirmed end-to-end. 16/16 unit tests pass.

Backlog: task-high.1 (FalVideoRunner + Janus deep-research, needs CI
build of rspace-online), task-medium.1 (summary/translation render
pivots).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-06 13:28:50 +00:00
.gitea/workflows wire p2pwiki-ai to the Portico intelligence gateway 2026-05-21 22:50:03 +01:00
backlog feat(remix): expose Portico /v1/render via /remix endpoint 2026-06-06 13:28:50 +00:00
drafts Add draft approval gadgets and wiki draft articles 2026-02-02 16:58:51 +00:00
src feat(remix): expose Portico /v1/render via /remix endpoint 2026-06-06 13:28:50 +00:00
tests feat: generative compute via quote -> execute (TASK-8) 2026-05-21 12:09:40 +01:00
web feat: add rData (Umami) analytics to p2pwiki, p2pf blog and website 2026-03-10 14:06:08 -07:00
wiki_deploy ops: add CF edge-protection automation script 2026-04-20 22:38:07 -04:00
wiki_scripts install_translate_gadget: write to MediaWiki:Common.js instead of Gadget pages 2026-05-09 22:20:08 -04:00
.dockerignore Add .dockerignore for optimized Docker builds 2026-02-21 17:48:54 -07:00
.env.example Complete content split: mount p2pfoundation-wiki as read-only volume 2026-04-16 13:25:03 -04:00
.gitignore Complete content split: mount p2pfoundation-wiki as read-only volume 2026-04-16 13:25:03 -04:00
conftest.py feat: add intelligence API client (TASK-6) 2026-05-21 04:14:53 +01:00
docker-compose.yml fix: OLLAMA_MODEL llama3.2 -> llama3.2:3b 2026-05-22 18:31:42 +01:00
Dockerfile Wire Infisical secret injection for ANTHROPIC_API_KEY 2026-02-24 09:32:37 -08:00
entrypoint.sh Wire Infisical secret injection for ANTHROPIC_API_KEY 2026-02-24 09:32:37 -08:00
pyproject.toml Initial commit: P2P Wiki AI system 2026-01-23 13:53:29 +01:00
README.md refactor: split content from AI tooling, prepare for rename to p2pwiki-ai 2026-04-14 14:24:05 -04:00

P2P Wiki AI

AI-augmented system for the P2P Foundation Wiki with two main features:

  1. Conversational Agent — Ask questions about 23,000+ wiki articles using RAG (Retrieval Augmented Generation)
  2. Article Ingress Pipeline — Drop article URLs to automatically analyze content, find matching wiki articles, and generate drafts

Content (wiki articles, XML dumps, infrastructure configs) lives in a separate repo: p2pfoundation-wiki

Quick Start

Prerequisites

  • Python 3.10+
  • Ollama installed locally (or access to a remote Ollama server)
  • Optional: Anthropic API key for Claude (higher quality article drafts)

Install & Run

pip install -e .

# Parse wiki content (from XML dumps or articles directory)
python -m src.parser

# Generate embeddings
python -m src.embeddings

# Start server
python -m src.api

Visit http://localhost:8420/ui for the web interface.

Content Directory

By default, the system looks for xmldump/ and articles/articles/ in the project root. To point at the separate content repo:

# In .env
CONTENT_DIR=/path/to/p2pfoundation-wiki

Or mount via Docker:

HOST_XMLDUMP_DIR=/opt/content/p2pfoundation-wiki/xmldump docker compose up -d

Docker Deployment

docker compose up -d --build
docker compose logs -f

Configuration

Copy .env.example to .env and configure:

Variable Default Description
CONTENT_DIR (unset) Path to content repo (resolves xmldump + articles)
HOST_XMLDUMP_DIR ./xmldump Host path for XML dump volume mount
OLLAMA_BASE_URL http://localhost:11434 Ollama server URL
OLLAMA_MODEL llama3.2 Model for chat Q&A
CLAUDE_MODEL claude-sonnet-4-20250514 Model for article drafts
USE_CLAUDE_FOR_DRAFTS true Route drafts to Claude
USE_OLLAMA_FOR_CHAT true Route chat to Ollama
ANTHROPIC_API_KEY (unset) Claude API key (or via Infisical)

API Endpoints

Endpoint Method Description
/chat POST Ask questions about wiki content
/ingress POST Process external article URL
/review GET List items in review queue
/review/action POST Approve/reject draft
/search GET Direct vector search
/articles GET List article titles
/health GET Health check

License

The AI system code is provided as-is for educational purposes. Wiki content is from the P2P Foundation under CC BY-SA 3.0.