{ "cells": [ { "cell_type": "markdown", "id": "dfad5f6b", "metadata": {}, "source": [ "# Demo: AI-Powered Scientific Research Companion\n", "This notebook demonstrates how to use the `Dispatcher` to search for papers, retrieve reproducible notebook cells, and fetch a knowledge graph." ] }, { "cell_type": "code", "execution_count": null, "id": "307d78b9", "metadata": {}, "outputs": [], "source": [ "from orchestrator.dispatcher import Dispatcher\n", "\n", "# Initialize dispatcher\n", "dispatcher = Dispatcher()\n", "\n", "# Example query\n", "query = \"CRISPR delivery\"\n", "\n", "# 1. Search for papers\n", "papers = dispatcher.search_papers(query, limit=3)\n", "print(\"Papers found:\")\n", "for p in papers:\n", " print(f\"- {p['title']} (ID: {p['id']})\")\n" ] }, { "cell_type": "code", "execution_count": null, "id": "8db389c8", "metadata": {}, "outputs": [], "source": [ "# 2. Retrieve notebook cells for the first paper\n", "if papers:\n", " first_id = papers[0]['id']\n", " cells = dispatcher.get_notebook_cells(first_id)\n", " print(f\"Notebook cells for paper {first_id}:\")\n", " for i, cell in enumerate(cells, 1):\n", " print(f\"Cell {i}:\")\n", " print(cell)\n", " print(\"------\")\n" ] }, { "cell_type": "code", "execution_count": null, "id": "52666e2a", "metadata": {}, "outputs": [], "source": [ "# 3. Fetch knowledge graph for the first paper\n", "if papers:\n", " graph = dispatcher.get_graph(first_id)\n", " print(\"Graph nodes:\")\n", " for node in graph.get(\"nodes\", []):\n", " print(node)\n", " print(\"Graph edges:\")\n", " for edge in graph.get(\"edges\", []):\n", " print(edge)\n" ] } ], "metadata": {}, "nbformat": 4, "nbformat_minor": 5 }