Pick two authors and a topic, and watch them debate, each one arguing only from their own writing. It's built on retrieval-augmented generation (RAG): every turn retrieves passages from that author's books, letters and essays, and the answer must cite them.
Moderator ─► Tolstoy ─► Dostoevsky ─► Tolstoy ─► … ─► Moderator summary
│ │
retrieve(own texts, topic + opponent's last argument)
Desktop/Projects/
├── agora/ ← this repo (code, config, generated data; no weights)
└── agora-models/ ← model weights, NOT in git
├── embeddings/ ← sentence-transformers cache (bge-m3)
└── ollama/ ← Ollama models (point OLLAMA_MODELS here)
Needs Python 3.11+ and Ollama (or an API key, see below).
cd $HOME\Desktop\Projects\agora
py -3.12 -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"
copy .env.example .env # set MODELS_DIR and check the model names
# Keep Ollama's models outside the repo too (once, then quit and restart Ollama;
# in recent Ollama versions you can also set the model location in its Settings):
setx OLLAMA_MODELS "$HOME\Desktop\Projects\agora-models\ollama"
python scripts\setup_models.py # downloads bge-m3, pulls the Ollama modelNVIDIA GPU? pip installs the CPU build of PyTorch, which makes agora index take
hours. Swap in the CUDA build and it takes minutes:
pip uninstall -y torch
pip install torch --index-url https://download.pytorch.org/whl/cu126
python -c "import torch; print(torch.cuda.is_available())" # Trueagora download # fetch texts from Project Gutenberg (Gutendex API)
agora index # clean, chunk, embed -> data/index
agora ask tolstoy "what gives life meaning" # check retrieval
agora debate "Is suffering necessary for a meaningful life?" --rounds 2
streamlit run app\streamlit_app.py # run from the repo rootThe web app is styled as a retro arcade fighting game: health bars, ROUND / FIGHT! banners, speech bubbles with citation tags, and a transcript under each round. HP tracks grounding, not who is right: a turn with valid citations lands a hit, a turn without any is a MISS, and every invented citation is a FOUL that costs the speaker HP.
The default corpus is 11 public-domain works: Tolstoy's essays, journal and fiction, and
Dostoevsky's novels plus his notebook for The Life of a Great Sinner. A few classics
(A Confession, The Death of Ivan Ilych, Dostoevsky's letters) are not on Gutendex in
English, so config/authors.yaml uses the closest available substitutes.
Set AUTHOR_MODEL / MODERATOR_MODEL in .env (LiteLLM format):
| Hardware | Suggestion |
|---|---|
| 16 GB RAM laptop | ollama/qwen3:8b |
| 16 GB GPU | ollama/phi4, Mistral Small |
| 24 GB+ GPU | a ~27B model such as Qwen3.6-27B or Gemma 4 mid-size |
| API | any Claude Sonnet / Haiku, OpenAI or Gemini model (add the API key to .env) |
Edit config/authors.yaml: add a key, the Gutenberg author name, and works tagged
letter, essay, diary or fiction. Then agora download --author <key> and
agora index --author <key>. Use public-domain texts and public-domain translations only.