Inside Dynamic Juno

A Multi-Agent Collaboration Framework for Scholarly Research and Long-Form Writing

Dynamic Juno is a writing environment powered by cooperative AI specialists that collaborate to help authors structure, research, draft, edit, and critique both creative writing and academic papers. Instead of operating as a single generic chat assistant, the platform uses a Coordinator-Specialist model that routes inputs to highly specific agents, runs background tasks, reads and writes files directly to the project folder, and simulates critique reviews.

Under the Hood: Dynamic Juno runs on a Python backend powered by FastAPI and the Agent Development Kit (ADK), integrated with an asynchronous SQLite database session state manager and a live SSE (Server-Sent Events) streaming frontend.

System Architecture

When you type a message or select a passage, your prompt is routed dynamically based on a pipeline of analysis, tool invocations, and filesystem writes. Specialist agents invoke dedicated tools to access and cross-reference various context documents (such as outlines, world building lore, and voice profiles) to maintain narrative coherence across drafts.

Caching Payload User UI React (SSE Stream) Coordinator Intents Routing & Handoff Summaries SQLite Session DB ADK Session History Specialist Agents 14 Specialist Agents Gemini Context Cache Cached Story Context Chapters & Ideas Markdown on disk World & Lore World category files Voice Profiles JSON style matrices

User Workflow & How to Work

Dynamic Juno is designed to assist you from the initial spark of an idea to a finalized, polished manuscript. By collaborating with specialized AI agents, you can maintain full creative control while leveraging automated planning, drafting, and analysis tools.

The Basics of Working in Dynamic Juno

Understanding the core interface interactions will help you write more efficiently:

Project-Centric Workspace

All your work is organized within projects. Each project contains its own ideas, outlines, characters, and chapters. As you work, agents generate and save local files (artifacts) on disk, creating a smarter, more responsive workspace context.

Natural Language & Intent Routing

Simply express what you want to do in natural language (e.g., "Brainstorm some ideas about..."). The Coordinator Agent automatically interprets your intent and routes the task to the correct specialist. You can also target agents directly using chat commands like @writer or by clicking sidebar buttons.

Hybrid Collaboration

Dynamic Juno gives you multiple ways to edit. Use the chat box to converse, query, and coordinate tasks with your agent network, and use the side-by-side artifact modals to edit outlines and drafts manually, giving you fine-grained control.

Application Modes

Dynamic Juno adapts to three primary project types. Within each, genre-specific leans fine-tune the agent register and craft priorities:

Fiction

Agents focus on scene craft, character voice, and emotional pacing. All fiction genres use the narrative lean; World Builder and series tooling layer on as needed.

  • Narrative lean — Scene structure, character arc, and draft evaluation on emotional engagement and pacing.
  • Multi-Book / Series — Span multiple novels in one project, sharing world lore and research while each book's outline and chapters stay independent.
  • World Builder — Characters, locations, factions, and lore in shared category files, with a write-guard against accidental overwrite across books.
Non-Fiction

The agent team shifts its craft lean to match your genre — a persuasive essay, a history book, and a memoir call for different registers even within non-fiction.

  • Argument lean — Self-Help, Philosophy, Business, Essay: agents foreground thesis clarity and reader persuasion.
  • Expository lean — History, Science, and general nonfiction: agents prioritize factual accuracy and clear explanation.
  • Narrative lean — Memoir, True Crime, Travel: agents balance storytelling craft with factual grounding.
  • Multi-Book / Collection — Span multiple titles sharing research while each book's drafts stay independent.
Scholarly

Full academic tooling: paper constraints, an honest citation workflow, and simulated peer review. Agents write in an academic register and skip personal voice profiles.

  • Paper (IMRAD) — Default layout for journal articles, with per-section word budgets and required-section compliance checks.
  • Scholarly Monograph — Switch to a chapter-based structure for book-length academic work. Same citation and compliance tooling, chapter vocabulary.
  • Citation engine — Seven resolvers with retraction detection. Research Agent marks gaps [CITATION NEEDED] rather than fabricating sources.
  • Simulated Peer Review — Configure reviewer personas and a rubric matched to your paper type; receive independent reviewer reports and an Editor's Decision.

Interactive Workflow Stepper

Explore the recommended stages of writing and editing. Select a phase below, and click individual steps to view their detailed roles, participating agents, and output files.

🗣️
Debater Agent Integration: Throughout both the Writing and Editing phases, you can engage the Debater Agent to challenge your concepts, outlines, and chapter drafts, helping you catch plot holes or weak arguments before they make it into prose.

The Cooperative Agent Network

Dynamic Juno assigns specialized tasks to different specialized agents. When the Coordinator receives a query, it selects the correct agent using intent routing or respects direct user overrides (e.g., typing @writer or @research).

Interactive Flow Simulator

Select a common user action below to trace how a request coordinates between agents, databases, and files on disk. Click Simulate Flow to animate the step-by-step pipeline.

User UI input
Coordinator Routing
Specialist Handoff
Tool & Database Run
Disk Write & Sync

Targeted Passage Editing

When a writer highlights a specific sentence or paragraph in the Reader Panel, enters a prompt (e.g., "Make this sound more foreboding"), and clicks edit, Dynamic Juno triggers a Passage Edit workflow:

Step 1
Snippet Highlight
User selects text in ReaderPanel. Text and intent are packed.
Step 2
Routing Block
UI prepends [PASSAGE EDIT]. Coordinator bypasses chat logic.
Step 3
Editor Handoff
Editor or Writer Agent is invoked directly with targeted snippet.
Step 4
Precise Replacer
Agent calls save_artifact_with_passage_edit to update file.
Step 5
Exit Marker
Coordinator closes loop with back to global mode notification.

By isolating edits to the highlighted selection, Dynamic Juno prevents the LLM from rewriting portions of the chapter that the author is already happy with. This ensures the formatting of the surrounding chapter remains completely untouched.

AI Models & Presets

Dynamic Juno's 14-agent team can run on two model families. A per-agent tier system routes each agent to the right-sized model for its task — agents that perform deep multi-step reasoning get the Pro-tier model; agents with shorter, focused outputs run on Flash. Users choose a preset in Settings (per-user default) or in the composer toolbar (per-session override).

Default — all tiers
Core (Gemini)
  • Pro gemini-3.1-pro-preview
  • Flash 3.5 gemini-3.5-flash
  • Flash 3 gemini-3-flash-preview
Includes Google Search grounding and Gemini implicit context caching. Always the active preset for Free-tier users.
Membership & BYOK
Premium (Claude)
  • Pro claude-opus-4-8
  • Flash 3.5 claude-sonnet-4-6
  • Flash 3 claude-haiku-4-5-20251001
Direct Anthropic API with explicit prompt caching (1 h system prefix, 5 min history). Research Agent always stays on Gemini for Google Search access.

Tier Assignment

Agents that perform complex, multi-step reasoning — Coordinator, Writer, Editor, Research, Peer Review, and Citation Auditor — run on the Pro-tier model. Agents with shorter, focused outputs (Idea, Outline, Debater, Reader, Voice, World Builder) run on Flash 3.5. Lightweight conversational agents (Persona Builder, Reviewer Builder) run on Flash 3. Operator-level AGENT_MODEL_* env vars can override any assignment per-agent.

Context Caching & Session Compaction

Large AI contexts — project files, outlines, drafts, and conversation history — get expensive and slow at scale. Dynamic Juno uses provider-native prompt caching on both Gemini and Claude, plus an active compaction cycle, to keep each turn fast and affordable.

Gemini Context Caching

When a session starts, all background knowledge (ideas, outlines, world details, and previous chapter drafts) is loaded into a single large system context block. This context is cached by the Gemini API for up to 60 minutes. Subsequent requests re-use the cache, avoiding the need to process the entire history each turn.

Response Time (Seconds)
Standard Run (100k tokens) 32s
With Context Caching 3.5s
Estimated API Token Cost (Credits)
Standard Run (Per 100 turns) 6,250
With Context Caching 600

Anthropic Prompt Caching

When running on the Premium (Claude) preset, a CachingAnthropicLlm wrapper injects Anthropic cache_control breakpoints at two tiers: a 1-hour cache on the tools definition and system instruction prefix (stable across turns), and a 5-minute cache on recent message history (refreshed as the conversation grows). This dramatically reduces response latency on long sessions where the system prefix and conversation history are large.

Active Compaction

If the session history grows too large, the Coordinator runs a compaction routine. It summarizes older conversation turns, storing the raw detail in a markdown log on disk (under projects/<project-name>/chat_history/) and replacing the active session history with the summary. This maintains maximum reasoning capability without hitting LLM context limits.

File System Indexing & Synchronization

Dynamic Juno operates as a local-first file manager. The workspace files on disk are the source of truth:

projects/
└── The Untold/
    ├── ideas.md                 # Concept brainstorming
    ├── outline.md               # Story beats and structure
    ├── metadata.json            # Word count, chapter count, genre, status
    ├── chapters/
    │   ├── chapter-01.md        # Compiled draft
    │   └── chapter-02.md
    └── World/
        ├── settings.md          # Lore and location profiles
        └── characters.md        # Persona descriptions

When you click ↻ Sync Files:

  1. The server scans the projects/ directory, auto-registering any new folders as projects.
  2. It dynamically scrapes the chapter files (chapter-*.md) and re-calculates chapter and word counts.
  3. It saves these metrics to the project's local metadata.json and compiles everything into a central index file (.projects-index.json).
  4. The UI refreshes the project list and stats dynamically without requiring a page reload.