Fix Streamlit Cloud deployment and related short lacks
Browse files- README.md +153 -228
- demo/app.py +6 -6
- demo/rag_config.py +12 -0
- requirements-streamlit.txt +58 -0
- requirements.txt +37 -43
README.md
CHANGED
|
@@ -1,254 +1,185 @@
|
|
| 1 |
-
<<<<<<< HEAD
|
| 2 |
---
|
| 3 |
title: SPARKNET
|
|
|
|
|
|
|
|
|
|
| 4 |
sdk: streamlit
|
|
|
|
| 5 |
app_file: demo/app.py
|
| 6 |
python_version: "3.10"
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
|
| 10 |
-
=======
|
| 11 |
-
# SPARKNET: Agentic AI Workflow System
|
| 12 |
|
| 13 |
-
Multi-agent
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
- **Multi-Agent Orchestration**: Specialized agents for planning, execution, and validation
|
| 19 |
-
- **Local LLM Integration**: Uses Ollama for privacy-preserving AI inference
|
| 20 |
-
- **Multi-GPU Support**: Efficiently utilizes 4x NVIDIA RTX 2080 Ti GPUs
|
| 21 |
-
- **Tool-Augmented Agents**: Agents can use tools for file I/O, code execution, and system monitoring
|
| 22 |
-
- **Memory Management**: Vector-based episodic and semantic memory
|
| 23 |
-
- **Learning & Adaptation**: Feedback loops for continuous improvement
|
| 24 |
|
| 25 |
-
##
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- NVIDIA GPUs with CUDA support (tested on 4x RTX 2080 Ti, 11GB VRAM each)
|
| 29 |
-
- Minimum 16GB RAM
|
| 30 |
-
- 50GB+ free disk space
|
| 31 |
|
| 32 |
-
###
|
| 33 |
-
- Python 3.10+
|
| 34 |
-
- CUDA 12.0+
|
| 35 |
-
- Ollama installed and running
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
###
|
| 40 |
-
```bash
|
| 41 |
-
# Install Ollama (if not already installed)
|
| 42 |
-
curl -fsSL https://ollama.com/install.sh | sh
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
-
```bash
|
| 50 |
-
cd /home/mhamdan/SPARKNET
|
| 51 |
|
| 52 |
-
|
| 53 |
-
pip install -r requirements.txt
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
###
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
-
ollama pull nomic-embed-text:latest
|
| 74 |
-
ollama pull mxbai-embed-large:latest
|
| 75 |
-
```
|
| 76 |
|
| 77 |
## Quick Start
|
| 78 |
|
| 79 |
-
###
|
| 80 |
-
|
| 81 |
-
```python
|
| 82 |
-
from src.llm.ollama_client import OllamaClient
|
| 83 |
-
from src.agents.executor_agent import ExecutorAgent
|
| 84 |
-
from src.agents.base_agent import Task
|
| 85 |
-
from src.tools import register_default_tools
|
| 86 |
-
import asyncio
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
# Create agent
|
| 93 |
-
agent = ExecutorAgent(llm_client=ollama_client)
|
| 94 |
-
agent.set_tool_registry(tool_registry)
|
| 95 |
-
|
| 96 |
-
# Create and execute task
|
| 97 |
-
task = Task(
|
| 98 |
-
id="task_1",
|
| 99 |
-
description="List all Python files in the current directory",
|
| 100 |
-
)
|
| 101 |
-
|
| 102 |
-
async def run():
|
| 103 |
-
result = await agent.process_task(task)
|
| 104 |
-
print(f"Status: {result.status}")
|
| 105 |
-
print(f"Result: {result.result}")
|
| 106 |
-
|
| 107 |
-
asyncio.run(run())
|
| 108 |
```
|
| 109 |
|
| 110 |
-
###
|
| 111 |
|
| 112 |
```bash
|
| 113 |
-
#
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
# Multi-agent collaboration
|
| 117 |
-
python examples/multi_agent_collab.py
|
| 118 |
|
| 119 |
-
#
|
| 120 |
-
|
| 121 |
|
| 122 |
-
#
|
| 123 |
-
|
| 124 |
```
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
### Quick Start
|
| 131 |
|
| 132 |
```bash
|
| 133 |
-
#
|
| 134 |
-
ollama
|
| 135 |
-
ollama pull mistral:latest
|
| 136 |
-
ollama pull qwen2.5:14b
|
| 137 |
-
|
| 138 |
-
# 2. Run the Patent Wake-Up workflow
|
| 139 |
-
python test_patent_wakeup.py
|
| 140 |
-
```
|
| 141 |
-
|
| 142 |
-
### Workflow Steps
|
| 143 |
-
|
| 144 |
-
The Patent Wake-Up pipeline executes four specialized agents sequentially:
|
| 145 |
-
|
| 146 |
-
1. **DocumentAnalysisAgent** - Analyzes patent structure and assesses Technology Readiness Level (TRL)
|
| 147 |
-
2. **MarketAnalysisAgent** - Identifies market opportunities with size/growth data
|
| 148 |
-
3. **MatchmakingAgent** - Matches with potential partners using semantic search
|
| 149 |
-
4. **OutreachAgent** - Generates professional valorization briefs (PDF format)
|
| 150 |
|
| 151 |
-
|
|
|
|
|
|
|
| 152 |
|
|
|
|
|
|
|
| 153 |
```
|
| 154 |
-
Patent: AI-Powered Drug Discovery Platform
|
| 155 |
-
TRL Level: 7/9
|
| 156 |
-
Market Opportunities: 4 identified ($150B+ addressable market)
|
| 157 |
-
Stakeholder Matches: 10 partners (investors, companies, universities)
|
| 158 |
-
Output: outputs/valorization_brief_[patent_id]_[date].pdf
|
| 159 |
-
```
|
| 160 |
-
|
| 161 |
-
### Specialized Agents
|
| 162 |
|
| 163 |
-
|
| 164 |
-
|-------|---------|-------|--------|
|
| 165 |
-
| DocumentAnalysisAgent | Patent extraction & TRL assessment | llama3.1:8b | PatentAnalysis object |
|
| 166 |
-
| MarketAnalysisAgent | Market opportunity identification | mistral:latest | MarketAnalysis object |
|
| 167 |
-
| MatchmakingAgent | Stakeholder matching with scoring | qwen2.5:14b | List of StakeholderMatch |
|
| 168 |
-
| OutreachAgent | Valorization brief generation | llama3.1:8b | ValorizationBrief + PDF |
|
| 169 |
|
| 170 |
-
|
| 171 |
|
| 172 |
-
|
| 173 |
|
| 174 |
-
|
| 175 |
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
- `PlannerAgent`: Task decomposition (coming soon)
|
| 180 |
-
- `CriticAgent`: Output validation (coming soon)
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
-
- File operations: read, write, search
|
| 188 |
-
- Code execution: Python, bash
|
| 189 |
-
- GPU monitoring and selection
|
| 190 |
|
| 191 |
-
|
| 192 |
-
- GPU manager for resource allocation
|
| 193 |
-
- Logging and configuration
|
| 194 |
-
- Memory management
|
| 195 |
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
-
|
| 199 |
-
- `system.yaml`: System-wide settings
|
| 200 |
-
- `models.yaml`: Model routing rules
|
| 201 |
-
- `agents.yaml`: Agent configurations
|
| 202 |
|
| 203 |
-
##
|
| 204 |
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
| 215 |
-
|
| 216 |
|
| 217 |
-
|
| 218 |
|
| 219 |
-
|
| 220 |
-
from src.utils.gpu_manager import get_gpu_manager
|
| 221 |
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
-
|
| 225 |
-
print(gpu_manager.monitor())
|
| 226 |
|
| 227 |
-
|
| 228 |
-
with gpu_manager.gpu_context(min_memory_gb=8.0) as gpu_id:
|
| 229 |
-
# Your model code here
|
| 230 |
-
print(f"Using GPU {gpu_id}")
|
| 231 |
-
```
|
| 232 |
|
| 233 |
## Development
|
| 234 |
|
| 235 |
-
### Project Structure
|
| 236 |
-
```
|
| 237 |
-
SPARKNET/
|
| 238 |
-
├── src/
|
| 239 |
-
│ ├── agents/ # Agent implementations
|
| 240 |
-
│ ├── llm/ # LLM client and routing
|
| 241 |
-
│ ├── workflow/ # Task orchestration (coming soon)
|
| 242 |
-
│ ├── memory/ # Memory systems (coming soon)
|
| 243 |
-
│ ├── tools/ # Agent tools
|
| 244 |
-
│ └── utils/ # Utilities
|
| 245 |
-
├── configs/ # Configuration files
|
| 246 |
-
├── examples/ # Example scripts
|
| 247 |
-
├── tests/ # Unit tests
|
| 248 |
-
└── Dataset/ # Data directory
|
| 249 |
-
|
| 250 |
-
```
|
| 251 |
-
|
| 252 |
### Running Tests
|
| 253 |
```bash
|
| 254 |
pytest tests/
|
|
@@ -260,36 +191,20 @@ black src/
|
|
| 260 |
flake8 src/
|
| 261 |
```
|
| 262 |
|
|
|
|
|
|
|
| 263 |
## Roadmap
|
| 264 |
|
| 265 |
-
|
| 266 |
-
- [x]
|
| 267 |
-
- [x]
|
| 268 |
-
- [x]
|
| 269 |
-
- [
|
| 270 |
-
- [
|
| 271 |
-
- [
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
- [ ] PlannerAgent
|
| 276 |
-
- [ ] CriticAgent
|
| 277 |
-
- [ ] MemoryAgent
|
| 278 |
-
- [ ] CoordinatorAgent
|
| 279 |
-
- [ ] Agent communication protocol
|
| 280 |
-
|
| 281 |
-
### Phase 3: Advanced Features
|
| 282 |
-
- [ ] Vector-based memory (ChromaDB)
|
| 283 |
-
- [ ] Learning and feedback mechanisms
|
| 284 |
-
- [ ] Model router
|
| 285 |
-
- [ ] Workflow engine
|
| 286 |
-
- [ ] Monitoring dashboard
|
| 287 |
-
|
| 288 |
-
### Phase 4: Optimization
|
| 289 |
-
- [ ] Multi-GPU parallelization
|
| 290 |
-
- [ ] Performance optimization
|
| 291 |
-
- [ ] Comprehensive testing
|
| 292 |
-
- [ ] Documentation
|
| 293 |
|
| 294 |
## Contributing
|
| 295 |
|
|
@@ -300,23 +215,33 @@ Contributions are welcome! Please:
|
|
| 300 |
4. Run tests
|
| 301 |
5. Submit a pull request
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
MIT License - see LICENSE file for details
|
| 306 |
|
| 307 |
## Acknowledgments
|
| 308 |
|
| 309 |
-
- Ollama for local LLM inference
|
| 310 |
-
- NVIDIA for CUDA and GPU support
|
| 311 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
|
| 313 |
## Support
|
| 314 |
|
| 315 |
-
|
| 316 |
-
-
|
| 317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
|
| 319 |
---
|
| 320 |
|
| 321 |
-
|
| 322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: SPARKNET
|
| 3 |
+
emoji: 🔥
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.0
|
| 8 |
app_file: demo/app.py
|
| 9 |
python_version: "3.10"
|
| 10 |
+
pinned: false
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# 🔥 SPARKNET: AI-Powered Technology Transfer Office Automation
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
**Multi-agent AI platform for research valorization and IP management**
|
| 16 |
|
| 17 |
+
[](https://sparknet.streamlit.app)
|
| 18 |
+
[](https://vista-project.eu)
|
| 19 |
+
[](https://opensource.org/licenses/MIT)
|
| 20 |
|
| 21 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
## Overview
|
| 24 |
|
| 25 |
+
SPARKNET is an enterprise-grade **Technology Transfer Office (TTO) Automation Platform** that combines multi-agent AI orchestration with document intelligence to automate key TTO workflows. Built for the VISTA/Horizon EU project.
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
### 🎯 Core TTO Scenarios
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
| Scenario | Status | Description |
|
| 30 |
+
|----------|--------|-------------|
|
| 31 |
+
| 💡 **Patent Wake-Up** | ✅ Live | Transform dormant patents into commercialization opportunities |
|
| 32 |
+
| ⚖️ **Agreement Safety** | ✅ Live | AI-assisted legal document review with risk detection |
|
| 33 |
+
| 🤝 **Partner Matching** | ✅ Live | Intelligent stakeholder matching for technology transfer |
|
| 34 |
+
| 📋 **License Compliance** | 🔨 Dev | Payment tracking, milestone verification, revenue alerts |
|
| 35 |
+
| 🏆 **Award Identification** | 🔨 Dev | Funding opportunity scanning and nomination assistance |
|
| 36 |
|
| 37 |
+
### 📊 Coverage Dashboard
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
- **3 Fully Covered** - Production-ready scenarios
|
| 40 |
+
- **5 Partially Covered** - In development
|
| 41 |
+
- **2 Not Covered** - Planned for future
|
| 42 |
|
| 43 |
+
---
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
## Features
|
|
|
|
| 46 |
|
| 47 |
+
### 🛡️ AI Quality Assurance
|
| 48 |
+
- **CriticAgent Validation**: Every AI output validated against VISTA quality standards
|
| 49 |
+
- **Confidence Scoring**: Automatic abstention for low-confidence results
|
| 50 |
+
- **Source Verification**: Hallucination mitigation with evidence grounding
|
| 51 |
+
- **Human-in-the-Loop**: Critical decisions require human approval
|
| 52 |
|
| 53 |
+
### 🤖 Multi-Agent Architecture
|
| 54 |
+
- **PlannerAgent**: Task decomposition and workflow planning
|
| 55 |
+
- **ExecutorAgent**: Task execution with tool usage
|
| 56 |
+
- **CriticAgent**: Output validation and refinement
|
| 57 |
+
- **MemoryAgent**: Context management and retrieval
|
| 58 |
|
| 59 |
+
### 📄 Document Intelligence
|
| 60 |
+
- OCR with PaddleOCR/Tesseract
|
| 61 |
+
- Layout detection and semantic chunking
|
| 62 |
+
- Schema-driven field extraction
|
| 63 |
+
- Visual evidence grounding (bbox, page, confidence)
|
| 64 |
|
| 65 |
+
### 💬 RAG Q&A
|
| 66 |
+
- Vector search with ChromaDB
|
| 67 |
+
- Grounded retrieval with citations
|
| 68 |
+
- Multi-document querying
|
| 69 |
+
- Citation generation
|
| 70 |
|
| 71 |
+
---
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
## Quick Start
|
| 74 |
|
| 75 |
+
### Streamlit Cloud (Recommended)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
The app is deployed on Streamlit Cloud. Visit:
|
| 78 |
+
```
|
| 79 |
+
https://sparknet.streamlit.app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
+
### Local Installation
|
| 83 |
|
| 84 |
```bash
|
| 85 |
+
# Clone repository
|
| 86 |
+
git clone https://github.com/MHHamdan/SPARKNET.git
|
| 87 |
+
cd SPARKNET
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
# Install dependencies
|
| 90 |
+
pip install -r requirements.txt
|
| 91 |
|
| 92 |
+
# Run Streamlit app
|
| 93 |
+
streamlit run demo/app.py
|
| 94 |
```
|
| 95 |
|
| 96 |
+
### With Local LLM (Ollama)
|
| 97 |
|
| 98 |
+
For privacy-preserving local inference:
|
|
|
|
|
|
|
| 99 |
|
| 100 |
```bash
|
| 101 |
+
# Install Ollama
|
| 102 |
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
+
# Pull models
|
| 105 |
+
ollama pull llama3.2:latest
|
| 106 |
+
ollama pull nomic-embed-text
|
| 107 |
|
| 108 |
+
# Run SPARKNET
|
| 109 |
+
streamlit run demo/app.py
|
| 110 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
+
## Configuration
|
| 115 |
|
| 116 |
+
### API Keys
|
| 117 |
|
| 118 |
+
Configure in `.streamlit/secrets.toml` or environment variables:
|
| 119 |
|
| 120 |
+
```toml
|
| 121 |
+
[auth]
|
| 122 |
+
password = "your-password"
|
|
|
|
|
|
|
| 123 |
|
| 124 |
+
GROQ_API_KEY = "your-groq-key"
|
| 125 |
+
GOOGLE_API_KEY = "your-google-key"
|
| 126 |
+
OPENROUTER_API_KEY = "your-openrouter-key"
|
| 127 |
+
```
|
| 128 |
|
| 129 |
+
See `.env.example` for all available configuration options.
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
+
### Supported LLM Providers
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
+
| Provider | Free Tier | Notes |
|
| 134 |
+
|----------|-----------|-------|
|
| 135 |
+
| Groq | 14,400 req/day | Fastest inference |
|
| 136 |
+
| Google Gemini | 15 req/min | Good for general use |
|
| 137 |
+
| OpenRouter | Many free models | Multi-model access |
|
| 138 |
+
| GitHub Models | Free GPT-4o | Requires GitHub token |
|
| 139 |
+
| HuggingFace | Thousands of models | Good for embeddings |
|
| 140 |
+
| Ollama | Unlimited (local) | Maximum privacy |
|
| 141 |
|
| 142 |
+
---
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
+
## Project Structure
|
| 145 |
|
| 146 |
+
```
|
| 147 |
+
SPARKNET/
|
| 148 |
+
├── demo/ # Streamlit application
|
| 149 |
+
│ ├── app.py # Main app
|
| 150 |
+
│ ├── auth.py # Authentication
|
| 151 |
+
│ ├── llm_providers.py # LLM provider management
|
| 152 |
+
│ └── pages/ # Multi-page app
|
| 153 |
+
├── src/
|
| 154 |
+
│ ├── agents/ # Agent implementations
|
| 155 |
+
│ │ ├── scenario1/ # Patent Wake-Up
|
| 156 |
+
│ │ ├── scenario3/ # License Compliance
|
| 157 |
+
│ │ └── scenario4/ # Award Identification
|
| 158 |
+
│ ├── rag/ # RAG subsystem
|
| 159 |
+
│ ├── workflow/ # LangGraph workflows
|
| 160 |
+
│ └── document_intelligence/ # Document processing
|
| 161 |
+
├── configs/ # Configuration files
|
| 162 |
+
├── .streamlit/ # Streamlit config
|
| 163 |
+
└── SECURITY.md # Security documentation
|
| 164 |
+
```
|
| 165 |
|
| 166 |
+
---
|
| 167 |
|
| 168 |
+
## Security & GDPR
|
| 169 |
|
| 170 |
+
SPARKNET supports GDPR-compliant deployments:
|
|
|
|
| 171 |
|
| 172 |
+
- **Local Inference**: Use Ollama for 100% on-premise processing
|
| 173 |
+
- **Data Isolation**: Configure data retention policies
|
| 174 |
+
- **Audit Logging**: Track all AI interactions
|
| 175 |
+
- **Private Deployment**: Enterprise deployment options
|
| 176 |
|
| 177 |
+
See [SECURITY.md](SECURITY.md) for detailed security documentation.
|
|
|
|
| 178 |
|
| 179 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
## Development
|
| 182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
### Running Tests
|
| 184 |
```bash
|
| 185 |
pytest tests/
|
|
|
|
| 191 |
flake8 src/
|
| 192 |
```
|
| 193 |
|
| 194 |
+
---
|
| 195 |
+
|
| 196 |
## Roadmap
|
| 197 |
|
| 198 |
+
- [x] Patent Wake-Up workflow
|
| 199 |
+
- [x] Agreement Safety review
|
| 200 |
+
- [x] Partner Matching
|
| 201 |
+
- [x] CriticAgent validation
|
| 202 |
+
- [ ] License Compliance Monitoring (in progress)
|
| 203 |
+
- [ ] Award Identification (in progress)
|
| 204 |
+
- [ ] Grant Writing Assistant
|
| 205 |
+
- [ ] Negotiation Support
|
| 206 |
+
|
| 207 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
## Contributing
|
| 210 |
|
|
|
|
| 215 |
4. Run tests
|
| 216 |
5. Submit a pull request
|
| 217 |
|
| 218 |
+
---
|
|
|
|
|
|
|
| 219 |
|
| 220 |
## Acknowledgments
|
| 221 |
|
| 222 |
+
- **Ollama** for local LLM inference
|
| 223 |
+
- **NVIDIA** for CUDA and GPU support
|
| 224 |
+
- **LangChain** for LLM orchestration
|
| 225 |
+
- **Streamlit** for the web framework
|
| 226 |
+
- **The open-source AI community**
|
| 227 |
+
|
| 228 |
+
---
|
| 229 |
|
| 230 |
## Support
|
| 231 |
|
| 232 |
+
- **GitHub Issues**: [github.com/MHHamdan/SPARKNET/issues](https://github.com/MHHamdan/SPARKNET/issues)
|
| 233 |
+
- **Documentation**: See `/docs` folder
|
| 234 |
+
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
+
## License
|
| 238 |
+
|
| 239 |
+
MIT License - see [LICENSE](LICENSE) file for details.
|
| 240 |
|
| 241 |
---
|
| 242 |
|
| 243 |
+
<p align="center">
|
| 244 |
+
<strong>🔥 SPARKNET</strong><br>
|
| 245 |
+
AI-Powered Technology Transfer Office Automation<br>
|
| 246 |
+
<em>VISTA/Horizon EU Project</em>
|
| 247 |
+
</p>
|
demo/app.py
CHANGED
|
@@ -660,24 +660,24 @@ def render_home_page():
|
|
| 660 |
with col1:
|
| 661 |
st.markdown("""
|
| 662 |
<div style="background: #f0f9ff; border-radius: 8px; padding: 1rem; border: 1px solid #bae6fd;">
|
| 663 |
-
<h4 style="margin: 0 0 0.5rem 0;">🔍 CriticAgent Validation</h4>
|
| 664 |
-
<p style="font-size: 0.9rem; margin: 0;">Every AI output is validated against VISTA quality standards with dimension-based scoring.</p>
|
| 665 |
</div>
|
| 666 |
""", unsafe_allow_html=True)
|
| 667 |
|
| 668 |
with col2:
|
| 669 |
st.markdown("""
|
| 670 |
<div style="background: #f0fdf4; border-radius: 8px; padding: 1rem; border: 1px solid #bbf7d0;">
|
| 671 |
-
<h4 style="margin: 0 0 0.5rem 0;">📊 Confidence Scoring</h4>
|
| 672 |
-
<p style="font-size: 0.9rem; margin: 0;">All extractions include confidence scores with automatic abstention for low-confidence results.</p>
|
| 673 |
</div>
|
| 674 |
""", unsafe_allow_html=True)
|
| 675 |
|
| 676 |
with col3:
|
| 677 |
st.markdown("""
|
| 678 |
<div style="background: #fefce8; border-radius: 8px; padding: 1rem; border: 1px solid #fef08a;">
|
| 679 |
-
<h4 style="margin: 0 0 0.5rem 0;">👤 Human-in-the-Loop</h4>
|
| 680 |
-
<p style="font-size: 0.9rem; margin: 0;">Critical decisions require human approval with clear decision points throughout workflows.</p>
|
| 681 |
</div>
|
| 682 |
""", unsafe_allow_html=True)
|
| 683 |
|
|
|
|
| 660 |
with col1:
|
| 661 |
st.markdown("""
|
| 662 |
<div style="background: #f0f9ff; border-radius: 8px; padding: 1rem; border: 1px solid #bae6fd;">
|
| 663 |
+
<h4 style="margin: 0 0 0.5rem 0; color: #1e3a5f;">🔍 CriticAgent Validation</h4>
|
| 664 |
+
<p style="font-size: 0.9rem; margin: 0; color: #334155;">Every AI output is validated against VISTA quality standards with dimension-based scoring.</p>
|
| 665 |
</div>
|
| 666 |
""", unsafe_allow_html=True)
|
| 667 |
|
| 668 |
with col2:
|
| 669 |
st.markdown("""
|
| 670 |
<div style="background: #f0fdf4; border-radius: 8px; padding: 1rem; border: 1px solid #bbf7d0;">
|
| 671 |
+
<h4 style="margin: 0 0 0.5rem 0; color: #14532d;">📊 Confidence Scoring</h4>
|
| 672 |
+
<p style="font-size: 0.9rem; margin: 0; color: #334155;">All extractions include confidence scores with automatic abstention for low-confidence results.</p>
|
| 673 |
</div>
|
| 674 |
""", unsafe_allow_html=True)
|
| 675 |
|
| 676 |
with col3:
|
| 677 |
st.markdown("""
|
| 678 |
<div style="background: #fefce8; border-radius: 8px; padding: 1rem; border: 1px solid #fef08a;">
|
| 679 |
+
<h4 style="margin: 0 0 0.5rem 0; color: #713f12;">👤 Human-in-the-Loop</h4>
|
| 680 |
+
<p style="font-size: 0.9rem; margin: 0; color: #334155;">Critical decisions require human approval with clear decision points throughout workflows.</p>
|
| 681 |
</div>
|
| 682 |
""", unsafe_allow_html=True)
|
| 683 |
|
demo/rag_config.py
CHANGED
|
@@ -53,6 +53,18 @@ def get_unified_rag_system():
|
|
| 53 |
This is cached at the Streamlit level so all pages share the same instance.
|
| 54 |
"""
|
| 55 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
from src.rag.agentic import AgenticRAG, RAGConfig
|
| 57 |
from src.rag.store import get_vector_store, VectorStoreConfig, reset_vector_store
|
| 58 |
from src.rag.embeddings import get_embedding_adapter, EmbeddingConfig, reset_embedding_adapter
|
|
|
|
| 53 |
This is cached at the Streamlit level so all pages share the same instance.
|
| 54 |
"""
|
| 55 |
try:
|
| 56 |
+
# Check for required dependencies first
|
| 57 |
+
try:
|
| 58 |
+
import pydantic
|
| 59 |
+
except ImportError:
|
| 60 |
+
return {
|
| 61 |
+
"status": "error",
|
| 62 |
+
"error": "Required dependency 'pydantic' is not installed. Please check requirements.txt.",
|
| 63 |
+
"rag": None,
|
| 64 |
+
"store": None,
|
| 65 |
+
"embedder": None,
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
from src.rag.agentic import AgenticRAG, RAGConfig
|
| 69 |
from src.rag.store import get_vector_store, VectorStoreConfig, reset_vector_store
|
| 70 |
from src.rag.embeddings import get_embedding_adapter, EmbeddingConfig, reset_embedding_adapter
|
requirements-streamlit.txt
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPARKNET Requirements for Streamlit Cloud
|
| 2 |
+
# Lighter version without heavy ML dependencies
|
| 3 |
+
|
| 4 |
+
# ==============================================================================
|
| 5 |
+
# Streamlit Web Framework
|
| 6 |
+
# ==============================================================================
|
| 7 |
+
streamlit>=1.28.0
|
| 8 |
+
|
| 9 |
+
# ==============================================================================
|
| 10 |
+
# LLM Orchestration (LangChain Ecosystem)
|
| 11 |
+
# ==============================================================================
|
| 12 |
+
langchain>=0.1.0
|
| 13 |
+
langchain-community>=0.0.20
|
| 14 |
+
ollama>=0.1.0
|
| 15 |
+
|
| 16 |
+
# ==============================================================================
|
| 17 |
+
# Vector Stores & Embeddings
|
| 18 |
+
# ==============================================================================
|
| 19 |
+
chromadb>=0.4.0
|
| 20 |
+
sentence-transformers>=2.2.0
|
| 21 |
+
|
| 22 |
+
# ==============================================================================
|
| 23 |
+
# Data Validation & Configuration
|
| 24 |
+
# ==============================================================================
|
| 25 |
+
pydantic>=2.0.0
|
| 26 |
+
pydantic-settings>=2.0.0
|
| 27 |
+
pyyaml>=6.0
|
| 28 |
+
python-dotenv>=1.0.0
|
| 29 |
+
typing-extensions>=4.0.0
|
| 30 |
+
|
| 31 |
+
# ==============================================================================
|
| 32 |
+
# Observability & Logging
|
| 33 |
+
# ==============================================================================
|
| 34 |
+
loguru>=0.7.0
|
| 35 |
+
rich>=13.0.0
|
| 36 |
+
|
| 37 |
+
# ==============================================================================
|
| 38 |
+
# System Monitoring
|
| 39 |
+
# ==============================================================================
|
| 40 |
+
psutil>=5.9.0
|
| 41 |
+
|
| 42 |
+
# ==============================================================================
|
| 43 |
+
# Web & HTTP
|
| 44 |
+
# ==============================================================================
|
| 45 |
+
requests>=2.31.0
|
| 46 |
+
httpx>=0.25.0
|
| 47 |
+
|
| 48 |
+
# ==============================================================================
|
| 49 |
+
# PDF & Document Processing
|
| 50 |
+
# ==============================================================================
|
| 51 |
+
reportlab>=4.0.0
|
| 52 |
+
pymupdf>=1.23.0
|
| 53 |
+
|
| 54 |
+
# ==============================================================================
|
| 55 |
+
# Caching & Performance
|
| 56 |
+
# ==============================================================================
|
| 57 |
+
cachetools>=5.3.0
|
| 58 |
+
tenacity>=8.2.0
|
requirements.txt
CHANGED
|
@@ -1,92 +1,86 @@
|
|
| 1 |
# SPARKNET Requirements
|
| 2 |
-
#
|
| 3 |
|
| 4 |
# ==============================================================================
|
| 5 |
-
#
|
| 6 |
# ==============================================================================
|
| 7 |
-
|
| 8 |
-
transformers>=4.35.0,<5.0.0
|
| 9 |
|
| 10 |
# ==============================================================================
|
| 11 |
# LLM Orchestration (LangChain Ecosystem)
|
| 12 |
# ==============================================================================
|
| 13 |
-
langchain>=0.1.0
|
| 14 |
-
langchain-community>=0.0.20
|
| 15 |
langchain-ollama>=0.0.1
|
| 16 |
-
langgraph>=0.0.20
|
| 17 |
-
ollama>=0.1.0
|
| 18 |
|
| 19 |
# ==============================================================================
|
| 20 |
# Vector Stores & Embeddings
|
| 21 |
# ==============================================================================
|
| 22 |
-
chromadb>=0.4.0
|
| 23 |
-
faiss-cpu>=1.7.4
|
| 24 |
-
sentence-transformers>=2.2.0
|
| 25 |
-
|
| 26 |
-
# ==============================================================================
|
| 27 |
-
# Workflow & Task Management
|
| 28 |
-
# ==============================================================================
|
| 29 |
-
networkx>=3.0,<4.0
|
| 30 |
-
redis>=5.0.0,<6.0.0
|
| 31 |
|
| 32 |
# ==============================================================================
|
| 33 |
# Data Validation & Configuration
|
| 34 |
# ==============================================================================
|
| 35 |
-
pydantic>=2.0.0
|
| 36 |
pydantic-settings>=2.0.0
|
| 37 |
-
pyyaml>=6.0
|
| 38 |
python-dotenv>=1.0.0
|
|
|
|
| 39 |
|
| 40 |
# ==============================================================================
|
| 41 |
# Observability & Logging
|
| 42 |
# ==============================================================================
|
| 43 |
-
loguru>=0.7.0
|
| 44 |
-
rich>=13.0.0
|
| 45 |
|
| 46 |
# ==============================================================================
|
| 47 |
-
#
|
| 48 |
# ==============================================================================
|
| 49 |
-
|
| 50 |
-
psutil>=5.9.0,<6.0.0
|
| 51 |
|
| 52 |
# ==============================================================================
|
| 53 |
# Web & HTTP
|
| 54 |
# ==============================================================================
|
| 55 |
-
requests>=2.31.0
|
| 56 |
-
beautifulsoup4>=4.12.0
|
| 57 |
-
httpx>=0.25.0
|
| 58 |
|
| 59 |
# ==============================================================================
|
| 60 |
# PDF & Document Processing
|
| 61 |
# ==============================================================================
|
| 62 |
-
reportlab>=4.0.0
|
| 63 |
pymupdf>=1.23.0
|
| 64 |
|
| 65 |
# ==============================================================================
|
| 66 |
-
# API Framework
|
| 67 |
# ==============================================================================
|
| 68 |
-
fastapi>=0.104.0
|
| 69 |
-
uvicorn
|
| 70 |
python-multipart>=0.0.6
|
| 71 |
|
| 72 |
# ==============================================================================
|
| 73 |
# Caching & Performance
|
| 74 |
# ==============================================================================
|
| 75 |
-
cachetools>=5.3.0
|
| 76 |
-
tenacity>=8.2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
# ==============================================================================
|
| 79 |
-
#
|
| 80 |
# ==============================================================================
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
pytest-cov>=4.1.0
|
| 84 |
|
| 85 |
# ==============================================================================
|
| 86 |
-
#
|
| 87 |
# ==============================================================================
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
mypy>=1.0.0
|
| 91 |
-
isort>=5.12.0
|
| 92 |
-
pre-commit>=3.5.0
|
|
|
|
| 1 |
# SPARKNET Requirements
|
| 2 |
+
# Compatible with Streamlit Cloud deployment
|
| 3 |
|
| 4 |
# ==============================================================================
|
| 5 |
+
# Streamlit Web Framework
|
| 6 |
# ==============================================================================
|
| 7 |
+
streamlit>=1.28.0
|
|
|
|
| 8 |
|
| 9 |
# ==============================================================================
|
| 10 |
# LLM Orchestration (LangChain Ecosystem)
|
| 11 |
# ==============================================================================
|
| 12 |
+
langchain>=0.1.0
|
| 13 |
+
langchain-community>=0.0.20
|
| 14 |
langchain-ollama>=0.0.1
|
| 15 |
+
langgraph>=0.0.20
|
| 16 |
+
ollama>=0.1.0
|
| 17 |
|
| 18 |
# ==============================================================================
|
| 19 |
# Vector Stores & Embeddings
|
| 20 |
# ==============================================================================
|
| 21 |
+
chromadb>=0.4.0
|
| 22 |
+
faiss-cpu>=1.7.4
|
| 23 |
+
sentence-transformers>=2.2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# ==============================================================================
|
| 26 |
# Data Validation & Configuration
|
| 27 |
# ==============================================================================
|
| 28 |
+
pydantic>=2.0.0
|
| 29 |
pydantic-settings>=2.0.0
|
| 30 |
+
pyyaml>=6.0
|
| 31 |
python-dotenv>=1.0.0
|
| 32 |
+
typing-extensions>=4.0.0
|
| 33 |
|
| 34 |
# ==============================================================================
|
| 35 |
# Observability & Logging
|
| 36 |
# ==============================================================================
|
| 37 |
+
loguru>=0.7.0
|
| 38 |
+
rich>=13.0.0
|
| 39 |
|
| 40 |
# ==============================================================================
|
| 41 |
+
# System Monitoring
|
| 42 |
# ==============================================================================
|
| 43 |
+
psutil>=5.9.0
|
|
|
|
| 44 |
|
| 45 |
# ==============================================================================
|
| 46 |
# Web & HTTP
|
| 47 |
# ==============================================================================
|
| 48 |
+
requests>=2.31.0
|
| 49 |
+
beautifulsoup4>=4.12.0
|
| 50 |
+
httpx>=0.25.0
|
| 51 |
|
| 52 |
# ==============================================================================
|
| 53 |
# PDF & Document Processing
|
| 54 |
# ==============================================================================
|
| 55 |
+
reportlab>=4.0.0
|
| 56 |
pymupdf>=1.23.0
|
| 57 |
|
| 58 |
# ==============================================================================
|
| 59 |
+
# API Framework (optional, for backend)
|
| 60 |
# ==============================================================================
|
| 61 |
+
fastapi>=0.104.0
|
| 62 |
+
uvicorn>=0.24.0
|
| 63 |
python-multipart>=0.0.6
|
| 64 |
|
| 65 |
# ==============================================================================
|
| 66 |
# Caching & Performance
|
| 67 |
# ==============================================================================
|
| 68 |
+
cachetools>=5.3.0
|
| 69 |
+
tenacity>=8.2.0
|
| 70 |
+
|
| 71 |
+
# ==============================================================================
|
| 72 |
+
# Workflow & Task Management
|
| 73 |
+
# ==============================================================================
|
| 74 |
+
networkx>=3.0
|
| 75 |
|
| 76 |
# ==============================================================================
|
| 77 |
+
# ML/AI (Optional - uncomment for full functionality)
|
| 78 |
# ==============================================================================
|
| 79 |
+
# torch>=2.0.0
|
| 80 |
+
# transformers>=4.35.0
|
|
|
|
| 81 |
|
| 82 |
# ==============================================================================
|
| 83 |
+
# Testing (development only)
|
| 84 |
# ==============================================================================
|
| 85 |
+
# pytest>=7.4.0
|
| 86 |
+
# pytest-asyncio>=0.21.0
|
|
|
|
|
|
|
|
|