import gradio as gr from agents import scout, hypothesis, simulation, publishing, meta_learning def run_pipeline(query): papers = scout.search_and_summarize(query) titles = [p['title'] for p in papers] summaries = [p['summary'] for p in papers] hypo = hypothesis.generate(papers) sim_result = simulation.simulate(hypo) report = publishing.save_report(hypo, sim_result) logs = meta_learning.log(hypo, sim_result) return titles, summaries, hypo, sim_result, report, logs.to_markdown() with gr.Blocks() as demo: gr.Markdown("# 🤖 EurekaCrew: Self‑Evolving AI R&D Lab") query_in = gr.Textbox(label="Enter AI research topic") run_btn = gr.Button("Run EurekaCrew") titles_out = gr.JSON(label="Top matching paper titles") summaries_out = gr.JSON(label="Paper summaries") hypo_out = gr.Textbox(label="Generated Hypothesis") sim_out = gr.Textbox(label="Simulation Result") report_out = gr.File(label="Markdown Report") logs_out = gr.Markdown(label="Recent Logs") run_btn.click(run_pipeline, inputs=[query_in], outputs=[titles_out, summaries_out, hypo_out, sim_out, report_out, logs_out]) if __name__ == "__main__": demo.launch()