Spaces:
Sleeping
Sleeping
Update README.md
Browse filesUpdated Readme.md
README.md
CHANGED
|
@@ -1,23 +1,209 @@
|
|
| 1 |
---
|
| 2 |
title: DVNC.AI
|
| 3 |
emoji: π§
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
|
|
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
|
|
|
| 9 |
short_description: Connectome-native scientific discovery workspace
|
| 10 |
---
|
| 11 |
|
| 12 |
# DVNC.AI
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
-
This patch assumes the repository already contains the uploaded folder:
|
| 18 |
-
- `dvnc_ai_v2_hf/`
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: DVNC.AI
|
| 3 |
emoji: π§
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.29.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
short_description: Connectome-native scientific discovery workspace
|
| 12 |
---
|
| 13 |
|
| 14 |
# DVNC.AI
|
| 15 |
|
| 16 |
+
DVNC.AI is a connectome-native scientific discovery workspace designed to search, expand, and structure research topics into an interactive knowledge graph. The application supports topic-led discovery, paper lookup, document upload, graph expansion, and AI-assisted reasoning over research artifacts.
|
| 17 |
|
| 18 |
+
This repository currently runs as a **Gradio Space** with a root-level launcher file required by Hugging Face Spaces. The production UI lives in the nested application package, and the root `app.py` exists so the Space can boot correctly in the default Gradio runtime.
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
## Current repository layout
|
| 21 |
|
| 22 |
+
```text
|
| 23 |
+
.
|
| 24 |
+
βββ app.py # Root Hugging Face launcher
|
| 25 |
+
βββ app_old.py # Legacy root app
|
| 26 |
+
βββ requirements.txt # Python dependencies for the Space
|
| 27 |
+
βββ README.md
|
| 28 |
+
βββ dvnc_ai_hf/ # Earlier app package
|
| 29 |
+
βββ dvnc_ai_v2_hf/ # Current primary app package
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## How the current Space starts
|
| 33 |
+
|
| 34 |
+
The Space is configured as a **Gradio Space**, which means Hugging Face expects a root `app.py` and installs dependencies from `requirements.txt`. The root launcher simply imports the active Gradio demo from `dvnc_ai_v2_hf.app` and starts it.
|
| 35 |
+
|
| 36 |
+
That pattern is intentional and should remain in place unless the Space is migrated to Docker.
|
| 37 |
+
|
| 38 |
+
## Supported architecture options
|
| 39 |
+
|
| 40 |
+
Two deployment patterns are supported for the next phase of development.
|
| 41 |
+
|
| 42 |
+
### Option 1: Gradio Space + external parser services
|
| 43 |
+
|
| 44 |
+
This is the simplest path and is the recommended option if the goal is to keep the current Space lightweight.
|
| 45 |
+
|
| 46 |
+
#### How it works
|
| 47 |
+
|
| 48 |
+
- Hugging Face runs the Gradio app using the root `app.py`.
|
| 49 |
+
- The main UI and orchestration logic live in `dvnc_ai_v2_hf/`.
|
| 50 |
+
- External scholarly/document parsing services are called over HTTP.
|
| 51 |
+
- PDF parsing can use a layered fallback:
|
| 52 |
+
1. External GROBID endpoint for scholarly TEI extraction.
|
| 53 |
+
2. Local Docling-based conversion for layout-aware parsing.
|
| 54 |
+
3. Local PyMuPDF fallback for raw text extraction.
|
| 55 |
+
|
| 56 |
+
#### Recommended environment variables
|
| 57 |
+
|
| 58 |
+
- `ANTHROPIC_API_KEY` β required for Claude-powered reasoning.
|
| 59 |
+
- `GROBID_URL` β optional external GROBID server URL.
|
| 60 |
+
- `SEMANTIC_SCHOLAR_API_KEY` β optional, improves Semantic Scholar API access.
|
| 61 |
+
- `OPENALEX_EMAIL` β optional polite-pool identity for OpenAlex-style requests.
|
| 62 |
+
- `CROSSREF_MAILTO` β optional polite contact for metadata requests.
|
| 63 |
+
|
| 64 |
+
#### Recommended use cases
|
| 65 |
+
|
| 66 |
+
Use this mode if:
|
| 67 |
+
- the Space should remain a standard Gradio Space;
|
| 68 |
+
- the parser stack can live outside the Space;
|
| 69 |
+
- fast iteration is more important than bundling every service into one runtime.
|
| 70 |
+
|
| 71 |
+
### Option 2: Docker Space + bundled parsing stack
|
| 72 |
+
|
| 73 |
+
This is the recommended option if the application needs a first-class parsing service bundled with the app runtime.
|
| 74 |
+
|
| 75 |
+
#### How it works
|
| 76 |
+
|
| 77 |
+
- The Space is converted from `sdk: gradio` to `sdk: docker`.
|
| 78 |
+
- A custom `Dockerfile` starts the web app and any required background services.
|
| 79 |
+
- GROBID can run inside the same container or through an internal companion service.
|
| 80 |
+
- The app can expose a single user-facing web interface while running a richer backend.
|
| 81 |
+
|
| 82 |
+
#### Recommended use cases
|
| 83 |
+
|
| 84 |
+
Use this mode if:
|
| 85 |
+
- the Space should include GROBID directly;
|
| 86 |
+
- system packages or custom services are required;
|
| 87 |
+
- document parsing quality is a core product feature;
|
| 88 |
+
- the app needs more control over startup, ports, or service orchestration.
|
| 89 |
+
|
| 90 |
+
#### YAML for Docker migration
|
| 91 |
+
|
| 92 |
+
If the Space is migrated to Docker, replace the YAML block at the top of this README with:
|
| 93 |
+
|
| 94 |
+
```yaml
|
| 95 |
+
***
|
| 96 |
+
title: DVNC.AI
|
| 97 |
+
emoji: π§
|
| 98 |
+
colorFrom: indigo
|
| 99 |
+
colorTo: blue
|
| 100 |
+
sdk: docker
|
| 101 |
+
pinned: false
|
| 102 |
+
license: mit
|
| 103 |
+
short_description: Connectome-native scientific discovery workspace with bundled parsing and graph expansion services.
|
| 104 |
+
***
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
In Docker mode, `app_file` is no longer used because startup is controlled by the `Dockerfile`.
|
| 108 |
+
|
| 109 |
+
## Product direction
|
| 110 |
+
|
| 111 |
+
The target application architecture supports:
|
| 112 |
+
|
| 113 |
+
- **Research topic discovery** β search papers by topic or concept.
|
| 114 |
+
- **Paper lookup** β search by title, DOI, paper name, or direct link.
|
| 115 |
+
- **Autonomous discovery** β retrieve candidates from multiple scholarly sources.
|
| 116 |
+
- **User selection** β show candidate papers and let the user choose which ones enter the graph.
|
| 117 |
+
- **PDF upload** β allow users to upload papers directly.
|
| 118 |
+
- **Structured parsing** β extract title, abstract, sections, references, and metadata from documents.
|
| 119 |
+
- **Graph expansion** β turn selected or parsed documents into graph nodes and edges for the self-learning graph.
|
| 120 |
+
|
| 121 |
+
## Planned source connectors
|
| 122 |
+
|
| 123 |
+
The next implementation phase is designed to support a multi-source retrieval layer such as:
|
| 124 |
+
|
| 125 |
+
- Crossref for DOI and bibliographic metadata.
|
| 126 |
+
- OpenAlex for topic/title discovery and scholarly metadata enrichment.
|
| 127 |
+
- Semantic Scholar for academic graph enrichment and relevance ranking.
|
| 128 |
+
- arXiv for preprints and open metadata.
|
| 129 |
+
- Europe PMC for biomedical and life-science literature.
|
| 130 |
+
- Direct URL ingestion from paper landing pages and PDFs.
|
| 131 |
+
|
| 132 |
+
## Parser strategy
|
| 133 |
+
|
| 134 |
+
Document parsing should use a priority-based parser stack:
|
| 135 |
+
|
| 136 |
+
1. **GROBID** for scholarly PDF parsing into structured TEI/XML.
|
| 137 |
+
2. **Docling** for layout-aware extraction, tables, and document conversion.
|
| 138 |
+
3. **PyMuPDF** for fast native PDF text extraction fallback.
|
| 139 |
+
|
| 140 |
+
This approach keeps the PDF uploader in the product while improving document understanding significantly over plain text extraction alone.
|
| 141 |
+
|
| 142 |
+
## Running locally
|
| 143 |
+
|
| 144 |
+
### Gradio mode
|
| 145 |
+
|
| 146 |
+
Install dependencies:
|
| 147 |
+
|
| 148 |
+
```bash
|
| 149 |
+
pip install -r requirements.txt
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
Start the Space locally:
|
| 153 |
+
|
| 154 |
+
```bash
|
| 155 |
+
python app.py
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
If an external parser is used, export the parser endpoint first:
|
| 159 |
+
|
| 160 |
+
```bash
|
| 161 |
+
export GROBID_URL=http://localhost:8070
|
| 162 |
+
export ANTHROPIC_API_KEY=your_key_here
|
| 163 |
+
python app.py
|
| 164 |
+
```
|
| 165 |
+
|
| 166 |
+
### Docker mode
|
| 167 |
+
|
| 168 |
+
Once a `Dockerfile` is added, run locally with:
|
| 169 |
+
|
| 170 |
+
```bash
|
| 171 |
+
docker build -t dvnc-ai .
|
| 172 |
+
docker run -p 7860:7860 dvnc-ai
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
## Deployment notes
|
| 176 |
+
|
| 177 |
+
### For Gradio Spaces
|
| 178 |
+
|
| 179 |
+
Keep these files at the repository root:
|
| 180 |
+
|
| 181 |
+
- `README.md`
|
| 182 |
+
- `app.py`
|
| 183 |
+
- `requirements.txt`
|
| 184 |
+
|
| 185 |
+
Hugging Face Spaces expects the root application entrypoint for Gradio deployments.
|
| 186 |
+
|
| 187 |
+
### For Docker Spaces
|
| 188 |
+
|
| 189 |
+
Add:
|
| 190 |
+
- `Dockerfile`
|
| 191 |
+
- any startup scripts or service config files
|
| 192 |
+
|
| 193 |
+
Then switch the README YAML to `sdk: docker`.
|
| 194 |
+
|
| 195 |
+
## Secrets and configuration
|
| 196 |
+
|
| 197 |
+
At minimum, set:
|
| 198 |
+
|
| 199 |
+
- `ANTHROPIC_API_KEY`
|
| 200 |
+
|
| 201 |
+
Depending on the selected architecture, also set:
|
| 202 |
+
|
| 203 |
+
- `GROBID_URL`
|
| 204 |
+
- `SEMANTIC_SCHOLAR_API_KEY`
|
| 205 |
+
- source-specific API credentials if needed
|
| 206 |
+
|
| 207 |
+
## Development note
|
| 208 |
+
|
| 209 |
+
At present, `dvnc_ai_v2_hf/` should be treated as the primary active application package. The `dvnc_ai_hf/` and `app_old.py` files appear to represent earlier iterations and should be retained only if they are still needed for rollback or reference.
|