Skip to content

abozaralizadeh/SandBox

Repository files navigation

SandBox

These projects are not isolated tools but rather facets of a broader exploration into AI autonomy. The presence of these three distinct yet related projects reveals a cohesive vision. My work is not merely about code but about exploring the potential of agentic AI to interact with and reason about the real world in increasingly sophisticated ways. The repository's associated topics, such as AI governance, ethics, and simulation, underscore this focus on the higher-order implications of autonomous systems.

AI Open Problem Solver

Autonomous Creative Mathematician & Deep-Research Agent
AI Open Problem Solver extends the LangGraph infrastructure with a creative autonomous mathematician that actively attempts to solve open mathematical problems — including the Millennium Prize Problems. Rather than just searching the internet for existing work, the agent formulates original conjectures, runs computational experiments, develops proof strategies, and uses web research only as a supplement. Each daily iteration is recorded as a rich HTML lab notebook entry. Read more

📐 Architecture: Technical flow and Mermaid diagrams

Key Capabilities

  • Creative Problem Solving: The agent thinks independently — formulating hypotheses, testing conjectures computationally, building proof sketches, and pivoting when approaches fail, rather than passively summarizing existing research.
  • Python Math Sandbox: A dedicated computational tool gives the agent a full mathematical laboratory with SymPy (symbolic algebra/calculus), NumPy (numerical computation), SciPy (optimization, integration, special functions), and Matplotlib — enabling it to run experiments, verify proofs numerically, and search for counterexamples.
  • Symbolic Calculator: A lightweight tool for quick symbolic operations (simplify, factor, solve, integrate, differentiate, series expansion) without writing full Python scripts.
  • Deep Search Agent: Uses LangGraph's deep-search workflow (with a ReAct fallback) to supplement its own thinking with web research — looking up specific theorems, checking whether an approach has been tried, or finding relevant papers.
  • Tuned for Creativity: Higher LLM temperature (configurable via AIOPS_LLM_TEMPERATURE) encourages novel and diverse mathematical thinking across iterations.
  • Persistent Research Memory: Stores every daily update, plus structured summaries, next steps, and citations in Azure Table Storage.
  • Resume & Continue: On each run, the agent ingests the historical context and advances the same problem instead of starting from scratch.
  • Infinite Timeline UI: A Flask route (/ai-open-problem-solver) serves an infinite-scroll page that streams the latest findings first and lazily loads earlier milestones from storage.
  • Dynamic Problem Picker: The UI queries Azure Table Storage to populate a dropdown of all tracked problems, so you can switch research threads instantly.
  • Problem Catalog Table: Configure aiops_problem_table_name for the dedicated problem registry table; add or remove problems there to control which threads are available in the UI.

Set up the storage names (aiops_table_name, aiops_blob_name) and optionally define AIOPS_DEFAULT_PROBLEM in .env to choose the default unsolved problem tackled by the agent. Tune creativity with AIOPS_LLM_TEMPERATURE (default 0.8) and sandbox execution time with AIOPS_SANDBOX_TIMEOUT (default 120 seconds).

Live Demo View the daily progress of AI open problems solver: https://sandboxes.live/ai-open-problem-solver

AIBlog

AI Blog

An Autonomous AI Researcher That Writes About AI AIBlog is an autonomous agent that discovers new developments in machine learning and generative AI, performs multi-source research, and publishes a daily blog post written entirely by AI. It uses a ReAct agent wrapped in a LangGraph state machine to orchestrate web search, academic reading, synthesis, and final composition into clean HTML.

Each post is automatically:

  • Researched via arXiv, OpenAI, DeepMind, HuggingFace, and other credible sources.
  • Enriched with citations, code snippets, tables, and technical diagrams.
  • Published as a fully responsive, styled HTML article.
  • Illustrated with a custom banner image generated by DALL·E 3 and hosted on Azure Blob Storage.

AIBlog showcases the potential of recursive agent architectures to create high-quality, verifiable technical content without any human-in-the-loop. Read more

📐 Architecture: Technical flow and Mermaid diagrams

Live Demo View the daily AI-written blog: https://SandBoxes.Live/aiblog

AIBlog

Tomorrow News

AI-Driven News Prediction and Decision-Making TomorrowNews is an experimental open-source project that uses LangChain Agents and Azure OpenAI to generate speculative, AI-driven news predictions based on real-world events. The project aims to simulate decision-making for the future, providing a creative glimpse into what might happen in various sectors, such as politics, economy, society, and the environment.

By feeding real news as input, this project generates predictions and outcomes for the following day, creating speculative headlines and decisions related to global topics. Read more

📐 Architecture: Technical flow and Mermaid diagrams

Key Features:

  • Autonomous AI Predictions: Uses real-time news data to predict plausible future events.
  • Generative AI Agents: Powered by Azure OpenAI, the system creates detailed and imaginative newspaper articles.
  • Responsive HTML Layout: The final output is a beautifully designed newspaper page optimized for both desktop and mobile screens.
  • Dynamic Image Generation: Incorporates AI-generated images that complement the headlines, ensuring a cohesive and engaging visual experience.

Core Components

1. LangGraph Framework

LangGraph is the backbone of this project, providing a stateful, multi-actor environment for building agent workflows. Key features of LangGraph include:

  • Cycles and Branching: Allows the implementation of loops and conditionals within the application.
  • Persistence: Saves the state of the application after each step, supporting error recovery and human-in-the-loop workflows.
  • Human-in-the-Loop: Enables interruption of graph execution for human approval or edits.
  • Streaming Support: Outputs are streamed as they are generated by each node.
  • Integration with LangChain: Seamlessly integrates with LangChain and LangSmith for enhanced functionality.

2. Azure OpenAI Integration

The project leverages Azure OpenAI for generating news content and images. Using GPT-4, the AI models analyze current events and generate predictions for the next day's newspaper.

3. Tools and Agents

  • News Feed Tool: Fetches the latest news to provide the AI with the necessary context for predictions.
  • Image Generation Tool: Creates realistic images based on detailed prompts to enhance the newspaper's visual appeal.
  • Agent Workflow: The agent processes the news feed, generates predictions, and formats the output into an HTML page. This process involves multiple iterations and decision-making steps to ensure high-quality content.

How It Works

  1. News Collection: The system fetches the latest news every hour using the News Feed Tool.
  2. AI Analysis and Prediction: The generative AI agent analyzes the current news and predicts potential future events.
  3. Content Creation: The agent creates detailed articles and generates appropriate images using the Image Generation Tool.
  4. HTML Newspaper Generation: The content is formatted into an HTML page that resembles a traditional newspaper layout, complete with headlines, articles, and images.
  5. Output Delivery: The HTML page is ready to be rendered in a browser, providing users with a speculative look at tomorrow’s news.

Note: All content generated by this project is purely speculative, based on AI's interpretation of current events, and should not be viewed as factual or actual news predictions.

Live Demo You can view the live version of the project here: https://SandBoxes.Live/tomorrownews

TN

GenBox

This experimental project explores the potential of AI as an autonomous decision-maker for a virtual world. Using Azure OpenAI and a structured prompt-response loop, the system generates daily high-level decisions on critical areas such as economy, society, environment, and global politics. Each decision is designed to be realistic, impactful, and ethically informed, balancing immediate outcomes with long-term sustainability. The goal is to create an engaging and evolving narrative that demonstrates the capabilities of generative AI while inviting users to reflect on governance and the complexities of decision-making in a simulated world. Read more

The decisions are presented on a retro CRT television: the classic experience scrolls the day's decision as green terminal text, and the four physical knobs let you step backward/forward through the timeline and pause or reverse the scroll.

📐 Architecture: Technical flow and Mermaid diagrams

I invite you to explore the very simple interface at https://SandBoxes.Live/genbox, where you can witness the AI’s daily decisions and follow the evolving narrative of this virtual world.

TV

AI News Anchor (Sora 2 Video)

GenBox now broadcasts each daily decision as an AI-generated TV news segment that plays on the CRT in place of the scrolling text. Instead of reading the (often long) decision verbatim, it's covered like a real bulletin — a short anchor headline ("The AI Government today decided to…"), a field report with b-roll, and a brief interview — all with natively generated speech and lip-sync from Sora 2 on Azure OpenAI. When a video is available it becomes the default display mode; the original scrolling text is always one button-press away.

Key Features

  • News-Bulletin Format: An OpenAI Agents SDK "Producer" agent distills the decision (not a verbatim read) into a segmented shot list — anchor lead → field report → interview → sign-off — with every spoken line sized to Sora's 4/8/12-second clip limits.
  • Anchor, Reporter & Interviewee: Beyond the studio anchor, the segment features an on-location correspondent and an interviewee (an official, expert, or citizen), each rendered as their own on-camera speaker.
  • Native Speech & B-Roll: Sora 2 generates synchronized audio and dialogue directly, so each speaker actually talks. The producer interleaves face-free b-roll cutaways (cityscapes, factories, solar farms, maps) to illustrate the report.
  • Scene Consistency (via remix): Sora 2 has no seed and rejects human faces in input_reference, so each speaker's first clip is a fresh generation and every later clip of that same speaker is a remix of it — reusing the source's layout, wardrobe, and lighting so the anchor/reporter/interviewee stay recognizable. Face-free b-roll is additionally chained via last-frame→first-frame (input_reference).
  • Seamless Stitching: All clips are merged with a bundled static ffmpeg (via imageio-ffmpeg, no system package required) into a single MP4 stored in Azure Blob Storage and streamed back to the TV.
  • Non-Blocking Generation: Rendering runs in a background thread guarded by a single-flight table lock, so the page never hangs — the TV shows text immediately and switches to video automatically once the segment is ready. Status is polled via /genbox-video-status and cached per day.
  • CRT Controls, Now for Video: The lowest knob toggles between the classic scrolling text and the news video. The back/next knobs move through the timeline (loading each day's video when available), and the pause knob pauses/plays the clip. Older, text-only decisions keep working exactly as before.

Configuration

Video is generated for new dates only (configurable cutoff). Point GenBox at a dedicated Sora 2 deployment and storage container via .env:

AZURE_OPENAI_ENDPOINT_SORA       # Sora 2 resource endpoint(s)
AZURE_OPENAI_API_KEY_SORA        # matching API key(s)
AZURE_OPENAI_MODEL_SORA=sora-2   # deployment name(s)
AZURE_OPENAI_API_VERSION_SORA=preview
AZURE_OPENAI_MODEL_TTS=tts       # text-to-speech deployment on the SAME resources
genbox_video_blob_name=genbox-video   # blob container for merged MP4s + narration
GENBOX_VIDEO_CUTOFF_DATE=2026-06-05   # only dates >= this get video + narration
GENBOX_VIDEO_ENABLED=true
GENBOX_VIDEO_MAX_CLIPS=6               # cost cap on clips per segment
GENBOX_TTS_VOICE=onyx                 # narration voice (optional)

When AZURE_OPENAI_MODEL_TTS is set, GenBox also narrates the daily decision in a government-spokesperson tone (via the same resources' TTS deployment). The narration renders quickly — well before the video — and plays over the scrolling text, with the scroll slowed to match the speech length. It's gated, cached, stored (in the video blob container), and referenced in the table just like the video, and served same-origin via /genbox-audio.

Multiple Sora resources / distributed credits. Sora's API is job-scoped: a create call returns a video id that only exists on the resource that served it, so the follow-up poll {id} and download {id} must hit that same resource — a round-robin gateway in front of several resources breaks this affinity. To spread load across resources instead, list them directly (not behind a balancer) as comma-separated values aligned by index; GenBox round-robins at the job level and pins each clip's whole create→poll→download lifecycle to the resource it picked (and fails a clip over to the next resource on error):

AZURE_OPENAI_ENDPOINT_SORA=https://res1.openai.azure.com,https://res2.openai.azure.com,https://res3.openai.azure.com
AZURE_OPENAI_API_KEY_SORA=key1,key2,key3
AZURE_OPENAI_MODEL_SORA=sora-2   # single value applies to all, or give one per resource

Tech Stack

  • OpenAI Agents SDK (openai-agents) — the Producer agent that scripts the segment
  • Sora 2 on Azure OpenAI — text/image-to-video with native audio (/openai/v1/videos)
  • imageio-ffmpeg — bundled static ffmpeg for last-frame extraction and clip concatenation
  • Azure Table & Blob Storage — per-date video status/metadata and merged MP4 hosting

ComicBook

Multi-Agent AI Comic Strip Generator
ComicBook produces a daily AI-generated comic strip using three collaborating agents built on the OpenAI Agents SDK. Each agent hands off to the next via the SDK's native handoff mechanism, forming a Director → Storyteller → Cartoonist pipeline that runs end-to-end without human intervention.

📐 Architecture: Technical flow and Mermaid diagrams

Agent Pipeline

  • Director — Invents original story arcs (genre, characters, art style), decides when an arc starts and ends based on narrative progression (not a fixed day count), and plans each episode's panel layout and tone.
  • Storyteller — Transforms the Director's outline into a panel-by-panel script with dialogue, captions, sound effects, camera angles, and per-panel size directives (wide / tall / square).
  • Cartoonist — Generates a character reference sheet first for visual consistency, then produces each panel image using the reference via Azure OpenAI image editing. Assembles the final responsive HTML comic page.

Key Features

  • Dynamic Story Arcs: The Director agent decides arc length organically — a story runs for as many episodes as it needs (3, 8, 15…), then closes and a completely fresh arc with new characters, world, and genre begins.
  • Character Consistency: The Cartoonist creates a single reference image of all characters and the environment before drawing any panels. Every panel is generated with that reference to maintain visual coherence.
  • Configurable Panel Sizes: Each panel can be wide (1536×1024 for landscapes/action), tall (1024×1536 for reveals), or square (1024×1024 for dialogue) — chosen by the Storyteller based on pacing needs.
  • Arc Memory: Azure Table Storage tracks arc metadata (title, logline, genre, characters, art style, episode count), daily episode summaries, and panel notes so each strip honors continuity.
  • Responsive Comic Layout: The final HTML uses comic-book styling (speech bubbles, caption boxes, sound effects) and adapts to mobile and desktop screens.
  • Frontend: /comicbook fetches the latest strip (or a selected date) and renders the comic page.

Tech Stack

  • OpenAI Agents SDK (openai-agents) — Agent definitions, @function_tool tools, handoffs, Runner.run()
  • Azure OpenAI — GPT for agent reasoning, gpt-image for image generation
  • Azure Table & Blob Storage — Arc/episode persistence, image and HTML hosting

ComicBook


Command to run the project

gunicorn --bind=0.0.0.0 --timeout 600 main:app

About

An AI-powered simulation project that models and visualizes potential futures in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors