mgbam commited on
Commit
335600f
·
verified ·
1 Parent(s): 64ff703

Upload 5 files

Browse files
Files changed (5) hide show
  1. .env.example +20 -0
  2. README.md +23 -12
  3. README.space.yaml +8 -0
  4. app.py +40 -0
  5. requirements.txt +12 -0
.env.example ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ OPENAI_API_KEY=
2
+ UMLS_API_KEY=
3
+ NCBI_API_KEY=
4
+ NCBI_EMAIL=
5
+ BIOPORTAL_API_KEY=
6
+ HF_TOKEN=
7
+ GEMINI_API_KEY=
8
+ ELEVEN_LABS_API_KEY=
9
+ NEO4J_URI=bolt://neo4j:7687
10
+ NEO4J_USER=neo4j
11
+ NEO4J_PASSWORD=
12
+
13
+ GENESIS_DISABLE_TRACING=1
14
+ GENESIS_DEEP_MODEL=o3-deep-research
15
+ GENESIS_DEEP_FAST_MODEL=o4-mini-deep-research
16
+ GENESIS_INSTRUCTION_MODEL=gpt-4o-mini
17
+ GENESIS_TRIAGE_MODEL=gpt-4o-mini
18
+ GENESIS_CLARIFY_MODEL=gpt-4o-mini
19
+ GENESIS_SAFETY_MODEL=gpt-4o-mini
20
+ GENESIS_MCP_URL=
README.md CHANGED
@@ -1,12 +1,23 @@
1
- ---
2
- title: SCEINCE
3
- emoji: 📊
4
- colorFrom: green
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 5.42.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GENESIS-AI — Synthetic Biology Deep Research (Hugging Face Space)
2
+
3
+ A production-grade, safety-first **agentic research Space** for high-level literature synthesis in synthetic biology.
4
+ Integrates **OpenAI Deep Research + Agents SDK**, optional **Gemini**/**DeepSeek-compatible** models for summaries,
5
+ and domain tools (UMLS/BioPortal/NCBI/PDBe). **No wet‑lab/operational protocols** are generated.
6
+
7
+ ## Deploy on Spaces
8
+ 1) Create a new Space (SDK: Gradio).
9
+ 2) Upload this zip.
10
+ 3) Add secrets in Space settings matching `.env.example`.
11
+ 4) Run — open the Research tab.
12
+
13
+ ## Local Dev
14
+ ```
15
+ python -m venv .venv && source .venv/bin/activate
16
+ pip install -r requirements.txt
17
+ cp .env.example .env # fill values
18
+ python app.py
19
+ ```
20
+
21
+ ## Safety
22
+ - The app refuses to output step-by-step lab instructions or growth conditions.
23
+ - Use this for **high-level literature review, synthesis, citations, and knowledge graphs** only.
README.space.yaml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ title: GENESIS-AI — Synthetic Biology Deep Research (Safety-First)
2
+ emoji: 🧬
3
+ colorFrom: teal
4
+ colorTo: blue
5
+ sdk: gradio
6
+ sdk_version: 4.44.0
7
+ python_version: 3.10
8
+ license: apache-2.0
app.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ from __future__ import annotations
3
+ import os, asyncio, json
4
+ import gradio as gr
5
+ from dotenv import load_dotenv
6
+
7
+ load_dotenv()
8
+
9
+ from genesis.pipeline import research_once
10
+
11
+ APP_TITLE = "GENESIS-AI — Synthetic Biology Deep Research (Safety-First)"
12
+ APP_DESC = "High-level synthetic biology literature synthesis with citations. This app **never** produces operational protocols."
13
+
14
+ async def run_research(query: str, fast: bool):
15
+ out = await research_once(query, fast=fast)
16
+ final_text = out.get("final_output") or "_No output_"
17
+ cites = out.get("citations", [])
18
+ cites_md = "\n".join([f"- [{c.get('title','link')}]({c.get('url','')})" for c in cites]) or "_None detected_"
19
+ return final_text, cites_md, json.dumps(out, indent=2)
20
+
21
+ with gr.Blocks(theme=gr.themes.Soft(), fill_height=True) as demo:
22
+ gr.Markdown(f"# {APP_TITLE}")
23
+ gr.Markdown(APP_DESC)
24
+
25
+ query = gr.Textbox(label="Your high-level research request", lines=4, placeholder="e.g., High-level synthesis of CRISPR base-editing trends in oncology (last 2 years).")
26
+ fast = gr.Checkbox(label="Fast mode (o4-mini-deep-research)", value=False)
27
+ go = gr.Button("Run Deep Research", variant="primary")
28
+
29
+ with gr.Tabs():
30
+ with gr.Tab("Research Report"):
31
+ report = gr.Markdown()
32
+ with gr.Tab("Citations"):
33
+ citations = gr.Markdown()
34
+ with gr.Tab("JSON Export"):
35
+ json_out = gr.Code(language="json")
36
+
37
+ go.click(fn=run_research, inputs=[query, fast], outputs=[report, citations, json_out])
38
+
39
+ if __name__ == "__main__":
40
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openai>=1.88
2
+ openai-agents>=0.0.19
3
+ gradio>=4.44.0
4
+ httpx>=0.27.0
5
+ pydantic>=2.7.0
6
+ python-dotenv>=1.0.1
7
+ neo4j>=5.25.0
8
+ rich>=13.7.1
9
+ pandas>=2.2.2
10
+ networkx>=3.3
11
+ pyvis>=0.3.2
12
+ google-generativeai>=0.7.2