About the Project

Mixafi is not just an application; it comes with AI development Kit called Mix Theory and example demo called Open Journal that run in the Mixafi. Built as a foundational Kotlin Multiplatform (KMP) library, it bridges the gap between traditional coding and visual orchestration. At its core lies Mix Theory, a reactive architecture that treats logic as immutable data, allowing you to build autonomous, multi-modal agents that run anywhere—from high-performance cloud servers to local devices.

While most AI implementations rely on fragile, linear "chat" interfaces, Mixafi introduces a Semantic Operating System. It allows developers to orchestrate "Agent Swarms"—specialized AI units that collaborate to solve complex problems. To demonstrate this power, we built Open Journal, an autonomous publishing suite where Gemini 3 acts as Strategist, Designer, and Editor to build entire media brands from a single text seed.

Inspiration

I've been tired of using libraries like Koog and ADK, and focusing on reactive graph in school in the past along music production this became a now brainer. The time was right, Gemini allowed me to scale some core concepts I was a fan off to a level beyond my expectation.

The view point is that instead of think of AI and agents, we just view things as flows of information that we can mix and turn into whatever we like. With the release of Gemini 3, I realized we could finally move away from "AI-as-a-chatbot" and toward AI-as-a-processor. Our viewpoint is that AI should be a flow of information that we can mix and turn into whatever we like, maintaining the "Pro-Code" control of a developer with the "No-Code" ease of a visual graph.

What it does

  • Orchestrated DSL: Mixafi replaces messy prompts with a clean Kotlin DSL. You define atomic logic units (Mixables) and compose them using mathematical operators:

    • (Chain): Create sequential pipelines.

    and / into (Parallel/Join): Merge multi-agent reasoning into a single context.

  • Thinking-to-Action: You don’t just get a text response; you get a coordinated workflow where one agent's "thought" triggers another agent's "action."

  • Source-as-Truth Visualization: Mixafi bridges the gap between coding and visualizing. You write standard Kotlin code, and the library automatically generates a live, editable graph of your AI’s logic.

How we built it

The project is built on a stack designed for performance, type safety, and multi-platform reach:

Mix Theory Core: A custom graph execution engine built using Kotlin Coroutines and Flows. Every node in the graph is a reactive entity.

KSP (Kotlin Symbol Processing): Our "secret sauce." We use KSP to extract metadata from Kotlin Data Classes at compile time. This allows us to feed Gemini 3 exact JSON schemas, constraining its "Thinking" process to our application's strict type system.

Gemini 3.0 Integration: We utilized Gemini 3.0 Flash and Pro, specifically leveraging the new ThinkingConfig. This allows agents to "reason" through complex layout and logic decisions before committing to an output.

Full-Stack Kotlin: * Frontend: Compose Multiplatform (Android, Desktop, and Wasm).

Backend: A Ktor-based proxy (MixCloud) that securely manages API keys and streams state updates via Server-Sent Events (SSE).

Challenges we ran into

The greatest challenge was State Synchronization. In a branching graph where multiple agents are "thinking" simultaneously, maintaining a consistent UI state is difficult. We solved this by implementing a unique mathematical addressing system: Address = [index1, index2, ..., indexn] By mapping every AI emission to a specific coordinate, we enabled the flowWithAddresses mechanism. This allows the UI to reactively update specific "blocks" of the journal as agents complete their tasks.Another hurdle was Model Constraint. By utilizing Gemini 3’s advanced instruction following and our KSP-generated schemas, we forced the model to treat the UI layout as a mathematical constraint problem rather than a creative writing exercise.

Accomplishments that we're proud of

Type-Safe Agentics: We successfully moved AI away from "strings" and into "types." Seeing Gemini 3 perfectly populate complex Kotlin interfaces via KSP was a massive win.

The "Flow" Experience: We achieved a UI that feels "alive." Watching the Open Journal compositor build a layout while the writer is still drafting is a level of fluidity rarely seen in AI apps.

Wasm Support: Bringing a complex graph-execution engine to the browser via Kotlin/Wasm demonstrates the true portability of the Mixafi library.

-- Can run on Web Desktop and Android

What we learned

Type Safety is Non-Negotiable: Integrating AI into professional software requires the same rigors as database management.

The Power of "Thinking": Gemini 3’s ability to reason significantly reduces the need for manual "Chain of Thought" prompting.

Infrastructure over Prompts: The future of AI isn't in better prompts, but in better semantic infrastructure.

Reactive AI: Using Kotlin Flows to stream AI "thoughts" creates a much more "alive" user experience than waiting for a full JSON response to finish.

What's next for Mixafi: Build Anything

Open Journal is just the beginning. We are expanding the Mix Theory ecosystem to include:

Local Execution: Integrating Gemini Nano for local-first, privacy-focused agent nodes.

Visual Editor: A full IDE where users can build Mixafi graphs visually and export them as production-ready Kotlin code.

Multi-Modal Swarms: Adding deep integration for video and audio nodes, allowing users to "Mix" entirely different mediums into a single cohesive output.

Mixafi proves that when you give Gemini a structured "home" (Mix Theory), it stops being a chatbot and starts being a co-architect.

More Info

To understand Mix Theory, it helps to stop thinking about "prompts" and start thinking about Signals. You are a sound engineer for AI, "mixing" different intelligence streams together.

Here are the four core patterns of the Mix DSL:


1. Chaining (+)

The Sequential Flow. Use this when the output of Agent A is required as the starting point for Agent B.

// Define the agents
val researcher by mix { "Find 3 key facts about $input" }
val writer     by mix { "Write a professional email using these facts: $input" }

// Chain them: Research happens first, then the Writer gets the facts.
val emailWorkflow = researcher + writer

val result = emailWorkflow runWith gemini("The benefits of Kotlin Wasm")

2. Splitting (and)

The Parallel Flow. Use this when you need multiple perspectives on the same input simultaneously. It saves time and prevents one agent's bias from affecting the others.

val copyWriter by mix { "Write a catchy headline for $input" }
val legal      by mix { "Identify potential trademark risks for $input" }

// Split: Both agents start at the same time using the same input.
val splitWorkflow = copyWriter and legal

3. Joining (into)

The Synthesis. Use this to merge the results of a Split back into a single "thought." This is where the Mix Theory Joiner looks at the parallel outputs and creates a final result.

val finalDraft by join { 
    // 'outputs' is a list containing [CopyWriterResult, LegalResult]
    "Merge this headline: ${outputs[0]} with these legal warnings: ${outputs[1]}"
}

// Complete Workflow: Split -> Parallel Work -> Join
val fullPipeline = (copyWriter and legal) into finalDraft

4. Recursive Remixing (remix)

The Feedback Loop. Use this for quality control. An agent observes its own previous work and "remixes" it until it meets a certain standard.

val editor by remix { 
    // 'lastRender' is the previous output of this node
    "This was your last draft: $lastRender. Improve the flow and remove jargon."
}

// This will run the logic, then pass the result back into itself for refinement.
val refinedWorkflow = researcher + editor


In Mix Theory, moving from abstract reasoning to a concrete result (like a UI or an image) requires two specialized types of nodes: Actualizers and Visualizers.

Here is how they work and how Mixafi manages the complex "context" that flows between them.


1. The Actualizer (Turning Thought into Data)

An Actualizer is the bridge between a text prompt and a structured object. It uses the KSP-generated schemas to force Gemini 3 to output a specific Kotlin data class.

  • How it works: You define a Type (e.g., JournalPost). The Actualizer sends the schema of JournalPost to Gemini.
  • The Result: You get a real Kotlin object that your UI can render perfectly.
// 1. Define the structure
data class JournalPost(val title: String, val content: String)

// 2. Create the Actualizer
val postActualizer by actualize<JournalPost> { 
    "Write a blog post about $input" 
}

2. The Visualizer (Turning Thought into Media)

A Visualizer takes a conceptual description and transforms it into a visual asset (like a cover image or an icon). In Open Journal, the Visualizer doesn't just "guess"; it looks at the Actualizer's context to ensure the image matches the text.

val coverVisualizer by visualize { 
    // It looks at the previous output to generate a prompt for Imagen/DALL-E
    "A high-quality editorial cover photo for an article titled: ${lastRender.title}" 
}


3. Handling Context (The "Memory" of the Graph)

In complex agent swarms, "Context" can get messy. Mixafi uses three strategies to keep the AI focused:

A. The joinedContext Operator

When you have multiple agents working in parallel (e.g., a Strategist and a Researcher), you need to "Join" their findings before the Writer starts. The into operator automatically bundles their outputs into a structured list.

val workflow = (strategist and researcher) into writer
// Inside 'writer', the context (input) is now a combined map of both results.

B. State Addressing ()

Every node has a unique "Address." When an Actualizer finishes, its result is stored at that specific address. This allows a later node to reach back and say: "Give me the context from three steps ago."

C. Immutable History

Context in Mixafi is immutable. When an agent "remixes" a thought, it doesn't overwrite the old context; it creates a new version. This allows you to show "Version History" in the UI (like in Open Journal's editorial review).


Putting it all together: The "Open Journal" Pipeline

This example shows how a seed becomes a full, multimodal page using these concepts:

// 1. ACTUALIZE: Turn the seed into a Structured Layout
val layoutNode = architect + compositorActualizer 

// 2. VISUALIZE: Generate art based on that layout
val artNode = layoutNode + coverVisualizer

// 3. JOIN: Merge the Layout and Art into the final View
val finalPage = (layoutNode and artNode) into pageRenderer

Built With

  • android
  • compose
  • desktop
  • kotlin
  • ksp
  • ktor
  • sse
  • wasm
Share this project:

Updates