Skip to main content

Junjo 順序

Japanese Translation: order, sequence, procedure

Junjo is a modern Python library for designing, executing, testing, and debugging complex, graph-based AI workflows.

Whether you’re building a simple chatbot, a complex data manipulation pipeline, or a sophisticated workflow with dynamic branching and parallel execution, Junjo provides the tools to define your logic as a clear graph of nodes and edges.

Docs

Benefits:

  • Asyncio & Pydantic native
  • Visualize your AI workflows
  • Build in redux-inspired state machine
  • Create robust and predictable conditional chains of LLM calls
  • Organize complex workflow executions into a scalable clean Graph structure
  • Manage execution order, loops, and concurrency
  • Supports Eval-Driven Development techniques
    • Test every node of your workflow to 100% evaluation accuracy
    • Test your workflows with dozens or thousands of input cases
    • Rapidly iterate on your AI capabilities knowing for sure you're making progress
  • Native opentelemetry support for clear tracing, observability, and debugging
    • Try our optional, free, open source companion junjo-server telemetry server.

junjo-screenshot.png

Decoupled

Junjo doesn't change how you create AI / LLM calls. Use any AI or LLM service provider or library. Junjo simply helps you organize your python functions into a clean organized graph structure with predictable, testable execution.

Junjo provides the building blocks that let you make any sort of executable workflow. From linear function calls, to complex branching workflows with concurrent sublfows, to fully autonomous agents.

There are zero proprietary AI / LLM implementations in Junjo. Use whatever LLM library you want.

All logs produced are opentelemetry compatible. Existing otel spans are annotated with workflow and node execution span wrappers.

It doesn't matter if the functions you add to a Junjo workflow are LLM API calls, database operations, or traditional business logic. You can write your business logic however you want. We just provide a convenient framework for organizing your desired flow into an executable graph.

Building AI Workflows and Agents as a Graph Workflow

Agentic AI applications use LLMs to determine the order of execution of python functions. These functions may involve LLM requests, API requests, database CRUD operations, etc.

The simplest way to organize functions that can be / need to be executed in a certain order is in the form of a directed graph.

A directed graph gives one the building blocks to create any sort of agentic application, including:

  • High precision workflows in the form of a Directed Acyclic Graph (DAG)
  • Autonomous AI Agents in the form of dynamically determined directed graphs

Priorities

Test (eval) driven development, repeatability, debuggability, and telemetry are CRITICAL for rapid iteration and development of Agentic applications.

Junjo prioritizes the following capabilities above all else to ensure these things are not an afterthought.

  1. Eval driven development / Test driven development with pytest
  2. Telemetry
  3. Visualization
  4. Type safety (pydantic)
  5. Concurrency safe (asyncio)

Contributing

This project was made with the uv python package manager.

# Setup and activate the virtual environment
$ uv venv .venv
$ source .venv/bin/activate

# Install optional development dependencies (graphviz is optional for running the graphviz visualizer)
# Graphviz, if utilized, must also be installed on the host system (see below)
$ uv pip install -e ".[dev,graphviz]"

Visualizing Your Workflows

Junjo Server

Junjo Server is an optional, free, open-source companion telemetry visualization platform for debugging Junjo workflows.

Quick Start:

# Create docker-compose.yml (see docs for full example)
# Start services
docker compose up -d

# Access UI at http://localhost:5153

Features:

  • Interactive graph visualization with execution path tracking
  • State step debugging - see every state change in chronological order
  • LLM decision tracking and trace timeline
  • Multi-execution comparison
  • Built specifically for graph-based AI workflows

Architecture: Three-service Docker setup (backend, ingestion service, frontend) that runs on minimal resources (1GB RAM, shared vCPU).

See the Junjo Server documentation for complete setup and configuration.

Graphviz

Junjo can render workflow graphs as images. It requires Graphviz to be installed on the underlying system (your developer computer or the docker image), as well as the above optional graphviz development dependencies in this python library.

# Install Graphviz on MacOS with homebrew
$ brew install graphviz
# visualize.py
from base.sample_workflow.graph import create_sample_workflow_graph

def main():
    # Every graph can execute .export_graphviz_assets() to generate all graphs and subflow graphs in a workflow
    # Creates .svg renderings, .dot notation files, and an HTML template to render the graphs
    create_sample_workflow_graph().export_graphviz_assets()

if __name__ == "__main__":
    main()
# Run the visualizer
python -m src.base.visualize

Full Example

See the full example inside examples/base.

Contributing

Code Linting and Formatting

This project utilizes ruff for linting and auto formatting. The VSCode settings.json in this project helps with additional formatting.

Building The Sphinx Docs

# 1. ensure optional development dependencies are installed (see above)
# 2. ensure the virtual environment is activated (see above)

# Execute the build command to preview the new docs.
# They will appear in a .gitignored folder docs/_build
$ sphinx-build -b html docs docs/_build

Tests

# Run the tests with uv
$ uv run pytest

Code Generation

Protobuf schema generation

  1. Requires the optional dev dependencies to be installed via uv pip install -e ".[dev]"
  2. Requires protoc which can be installed into your developer environment host machine (instructions).
  3. Copy the .proto files from the junjo-server project to src/telemetry/junjo_server/proto
  4. Run make proto from the project root to generate the proto_gen files for the client
  5. Update any required changes to the src/telemetry/junjo_server/client.py file (type changes, fields, etc.)

Pre-commit Hook

This project uses a pre-commit hook to automatically generate the protobuf files. To install the hook, run the following command:

pre-commit install

Metadata

Release files for junjo 0.61.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for junjo 0.61.0
File Size Uploaded
junjo-0.61.0.tar.gz 42.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for junjo 0.61.0
File Interpreter ABI Platform
junjo-0.61.0-py3-none-any.whl Python 3 none any Details

Total release size: 90.6 kB

Release files / junjo-0.61.0.tar.gz

Download URL junjo-0.61.0.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c481b0d00284c34d8f74981676b3729d45f078d0748d7c0617f57ab4a22a77ad
BLAKE2b-256 checksum
How to use checksums
c2011ad7e082220c3b95710a4f47fa6ab8be7d9e5624c16a7d887c3ee94954df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2025.

Transparency log

Release files / junjo-0.61.0-py3-none-any.whl

Download URL junjo-0.61.0-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1228111111b212f28d118b028af2d0a6fb62d30def2597cd836b91a263c65957
BLAKE2b-256 checksum
How to use checksums
c3d591443708b8c9e157628c41f6c1125cc154e749f0651e53c2c02d392b4d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2025.

Transparency log

Release history Release notifications | RSS feed

0.69.0

2 release files

0.68.0

2 release files

0.67.0

2 release files

0.66.0

2 release files

0.65.0

2 release files

0.64.0

2 release files

0.62.1

2 release files

0.61.1

2 release files

This release

0.61.0 This release

2 release files

0.50.1

2 release files

0.50.0

2 release files

0.45.0

2 release files

0.44.1

2 release files

0.44.0

2 release files

0.43.1

2 release files

0.43

2 release files

0.42

2 release files

0.41

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page