Spaces:
Running on Zero
Running on Zero
|
Download docs/ARCHITECTURE.md from nonsonpratico/murdermind: direct link, hf CLI and curl.
- Browser
- Download file 4.05 kB
-
https://huggingface.co/spaces/nonsonpratico/murdermind/resolve/main/docs/ARCHITECTURE.md
- Command line
-
hf download hf://spaces/nonsonpratico/murdermind/docs/ARCHITECTURE.md
-
curl -L -o ARCHITECTURE.md https://huggingface.co/spaces/nonsonpratico/murdermind/resolve/main/docs/ARCHITECTURE.md
4.05 kB
MurderMind Technical Architecture
1. Overview
MurderMind is a multi-agent narrative design engine built to create playable, logically solvable Murder Mystery Dinner Games (Cene con Delitto) using compact local language models (unsloth/Qwen3.5-2B) as well as remote OpenAI-compatible providers for cloud/Hugging Face Spaces deployment.
+-------------------------------------------------------------------------+
| Web UI (Gradio Studio) |
| [1. Studio Creativo] [2. Control Room] [3. Game Dossier & Export] |
+------------------------------------+------------------------------------+
|
v
+-------------------------------------------------------------------------+
| Game Director / Multi-Agent Orchestrator |
| - Stepwise workflow execution (Phases 1..10) |
| - Targeted inter-agent review & revision cycles (bounded iterations) |
| - Observable event & critique stream |
+-----------------+------------------+------------------+-----------------+
| | |
v v v
+--------------------+ +------------------+ +-------------------+
| 10 Modular Agents | | Single Source of | | Graph Validator |
| (Independent | | Truth (Pydantic | | - Timeline order |
| modules + prompts)| | InformationGraph)| | - Alibi/Clue link |
+---------+----------+ +--------+---------+ | - Secret firewall |
| | +-------------------+
v v
+--------------------+ +------------------+
| OpenAI-Compatible | | Persistence & |
| LLM Client Core | | Dossier Exporter |
| - Local: :8888 | | - SQLite DB |
| - Remote: HF/API | | - MD/JSON/PDF/ZIP|
+--------------------+ +------------------+
2. Four Core Design Principles
- Compact-Model Multi-Agent Collaboration (
Qwen3.5-2BFriendly) Agents are not 10 unconstrained free-text calls. Each agent has a bounded responsibility, a focused system prompt, a compact slice of shared context, and a structured JSON contract validated by Pydantic. - Story as an Information Graph (Single Source of Truth)
Characters (
char_01...), clues (clue_01...), timeline events (evt_01...), secrets, and subplots (sub_01...) are linked by canonical IDs insideMysteryProject. Automated graph validation verifies that:- The secret solution is established before clues are distributed.
- Every clue and subplot references valid character IDs.
- At least one non-red-herring clue exposes the culprit's alibi contradiction or links them to the crime.
- Strict Information Firewall (Master vs. Player Views)
The exporter and view builders enforce a strict separation between Master material (
secret_solution.md,master_manual.md,master_report.md) and Player character sheets (characters/character_XX.md). A player sheet never leakssecret_solution,culprit_id, or another character's hidden secrets. - Observable Creative Process
Every agent execution, inter-agent critique, and targeted revision is recorded as an
AgentActivityEventandReviewCritiqueinside the project state and surfaced in the Control Room UI.
3. LLM Provider Abstraction
murdermind/core/llm_client.py separates inference configuration by environment:
- Local Development (
LLM_PROVIDER=local): Connects tohttp://127.0.0.1:8888/v1/chat/completionsrunningunsloth/Qwen3.5-2B. - Remote Deployment (
LLM_PROVIDER=remoteorauto): Connects to a remote OpenAI-compatible endpoint (such as Hugging Face Inference Routerhttps://router.huggingface.co/v1or OpenRouter/OpenAI) when hosted on Hugging Face Spaces, since a cloud Space cannot access the developer's127.0.0.1.