Spaces:
Sleeping
Sleeping
Jatin Mehra
commited on
Commit
·
ab5e975
1
Parent(s):
0fe16fd
Add system architecture diagram to README for enhanced clarity
Browse files
README.md
CHANGED
|
@@ -72,6 +72,138 @@ The application employs an agentic approach that can augment the document's info
|
|
| 72 |
|
| 73 |
The application follows a modular architecture with these main components:
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
### Backend Components
|
| 76 |
|
| 77 |
1. **PDF Processing Module** (`preprocessing.py`):
|
|
@@ -351,5 +483,4 @@ The Android app is implemented using Java and consists of:
|
|
| 351 |
|
| 352 |
## License
|
| 353 |
|
| 354 |
-
MIT
|
| 355 |
-
|
|
|
|
| 72 |
|
| 73 |
The application follows a modular architecture with these main components:
|
| 74 |
|
| 75 |
+
### System Architecture Diagram
|
| 76 |
+
|
| 77 |
+
```mermaid
|
| 78 |
+
---
|
| 79 |
+
config:
|
| 80 |
+
theme: forest
|
| 81 |
+
look: neo
|
| 82 |
+
layout: dagre
|
| 83 |
+
---
|
| 84 |
+
flowchart TD
|
| 85 |
+
subgraph subGraph0["Presentation Layer"]
|
| 86 |
+
direction TB
|
| 87 |
+
Browser["Web Browser UI"]
|
| 88 |
+
Android["Android WebView Client"]
|
| 89 |
+
end
|
| 90 |
+
subgraph subGraph1["API Layer"]
|
| 91 |
+
direction TB
|
| 92 |
+
APIGateway["FastAPI Entrypoints"]
|
| 93 |
+
ChatRoutes["chat_routes.py"]
|
| 94 |
+
SessionRoutes["session_routes.py"]
|
| 95 |
+
UploadRoutes["upload_routes.py"]
|
| 96 |
+
UtilityRoutes["utility_routes.py"]
|
| 97 |
+
AppMain["app.py"]
|
| 98 |
+
end
|
| 99 |
+
subgraph subGraph2["Config & Models"]
|
| 100 |
+
direction TB
|
| 101 |
+
ConfigLoader["config.py"]
|
| 102 |
+
DataModels["models.py"]
|
| 103 |
+
end
|
| 104 |
+
subgraph subGraph3["Service Layer"]
|
| 105 |
+
direction TB
|
| 106 |
+
RAGService["rag_service.py"]
|
| 107 |
+
LLMService["llm_service.py"]
|
| 108 |
+
SessionService["session_service.py"]
|
| 109 |
+
end
|
| 110 |
+
subgraph subGraph4["Utility Layer"]
|
| 111 |
+
direction TB
|
| 112 |
+
TextProc["text_processing.py"]
|
| 113 |
+
FaissUtil["faiss_utils.py"]
|
| 114 |
+
SessionUtil["session_utils.py"]
|
| 115 |
+
end
|
| 116 |
+
subgraph Storage["Storage"]
|
| 117 |
+
direction TB
|
| 118 |
+
UploadStore["/uploads (PDFs & sessions)"]
|
| 119 |
+
FAISSIndex["FAISS Index (ephemeral/disk)"]
|
| 120 |
+
end
|
| 121 |
+
subgraph subGraph6["Docker Container"]
|
| 122 |
+
direction TB
|
| 123 |
+
subGraph1
|
| 124 |
+
subGraph2
|
| 125 |
+
subGraph3
|
| 126 |
+
subGraph4
|
| 127 |
+
Storage
|
| 128 |
+
end
|
| 129 |
+
subgraph subGraph7["External & DevOps"]
|
| 130 |
+
direction TB
|
| 131 |
+
GroqAPI["Groq LLM API"]
|
| 132 |
+
TavilyAPI["Tavily Web Search API"]
|
| 133 |
+
CI["GitHub Actions CI/CD"]
|
| 134 |
+
HFS["HuggingFace Spaces"]
|
| 135 |
+
DockerfileNode["Dockerfile"]
|
| 136 |
+
end
|
| 137 |
+
subgraph subGraph8["Static Assets"]
|
| 138 |
+
direction TB
|
| 139 |
+
StaticApp["Static Web App"]
|
| 140 |
+
end
|
| 141 |
+
Browser -- HTTP JSON --> StaticApp
|
| 142 |
+
StaticApp -- HTTP JSON --> AppMain
|
| 143 |
+
Android -- HTTP JSON --> AppMain
|
| 144 |
+
AppMain -- routes --> ChatRoutes & SessionRoutes & UploadRoutes & UtilityRoutes
|
| 145 |
+
ChatRoutes -- calls --> RAGService
|
| 146 |
+
SessionRoutes -- calls --> SessionService
|
| 147 |
+
UploadRoutes -- calls --> TextProc
|
| 148 |
+
UtilityRoutes -- calls --> SessionUtil
|
| 149 |
+
RAGService -- uses --> LLMService & FaissUtil
|
| 150 |
+
RAGService -- calls --> GroqAPI & TavilyAPI
|
| 151 |
+
LLMService -- uses --> ConfigLoader
|
| 152 |
+
SessionService -- uses --> SessionUtil
|
| 153 |
+
TextProc -- writes/reads --> UploadStore
|
| 154 |
+
SessionUtil -- writes/reads --> UploadStore
|
| 155 |
+
FaissUtil -- reads/writes --> FAISSIndex
|
| 156 |
+
CI -- build & deploy --> DockerfileNode
|
| 157 |
+
DockerfileNode -- deploy --> HFS
|
| 158 |
+
Browser:::frontend
|
| 159 |
+
Android:::frontend
|
| 160 |
+
APIGateway:::api
|
| 161 |
+
ChatRoutes:::api
|
| 162 |
+
SessionRoutes:::api
|
| 163 |
+
UploadRoutes:::api
|
| 164 |
+
UtilityRoutes:::api
|
| 165 |
+
AppMain:::api
|
| 166 |
+
ConfigLoader:::service
|
| 167 |
+
DataModels:::service
|
| 168 |
+
RAGService:::service
|
| 169 |
+
LLMService:::service
|
| 170 |
+
SessionService:::service
|
| 171 |
+
TextProc:::util
|
| 172 |
+
FaissUtil:::util
|
| 173 |
+
SessionUtil:::util
|
| 174 |
+
UploadStore:::util
|
| 175 |
+
FAISSIndex:::util
|
| 176 |
+
GroqAPI:::external
|
| 177 |
+
TavilyAPI:::external
|
| 178 |
+
CI:::devops
|
| 179 |
+
HFS:::devops
|
| 180 |
+
DockerfileNode:::devops
|
| 181 |
+
StaticApp:::frontend
|
| 182 |
+
classDef frontend fill:#CCE5FF,stroke:#333,stroke-width:1px
|
| 183 |
+
classDef api fill:#DFFFD6,stroke:#333,stroke-width:1px
|
| 184 |
+
classDef service fill:#FFE5B4,stroke:#333,stroke-width:1px
|
| 185 |
+
classDef util fill:#E3E4FA,stroke:#333,stroke-width:1px
|
| 186 |
+
classDef external fill:#E0E0E0,stroke:#333,stroke-width:1px
|
| 187 |
+
classDef devops fill:#CCFFFF,stroke:#333,stroke-width:1px
|
| 188 |
+
click Android "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/Android%20App/app/src/main/res/layout/activity_splash.xml"
|
| 189 |
+
click ChatRoutes "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/api/chat_routes.py"
|
| 190 |
+
click SessionRoutes "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/api/session_routes.py"
|
| 191 |
+
click UploadRoutes "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/api/upload_routes.py"
|
| 192 |
+
click UtilityRoutes "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/api/utility_routes.py"
|
| 193 |
+
click AppMain "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/app.py"
|
| 194 |
+
click ConfigLoader "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/configs/config.py"
|
| 195 |
+
click DataModels "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/models/models.py"
|
| 196 |
+
click RAGService "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/services/rag_service.py"
|
| 197 |
+
click LLMService "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/services/llm_service.py"
|
| 198 |
+
click SessionService "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/services/session_service.py"
|
| 199 |
+
click TextProc "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/utils/text_processing.py"
|
| 200 |
+
click FaissUtil "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/utils/faiss_utils.py"
|
| 201 |
+
click SessionUtil "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/utils/session_utils.py"
|
| 202 |
+
click CI "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/.github/workflows/sync_to_hf.yml"
|
| 203 |
+
click DockerfileNode "https://github.com/jatin-mehra119/pdf-insight-beta/tree/main/Dockerfile"
|
| 204 |
+
click StaticApp "https://github.com/jatin-mehra119/pdf-insight-beta/blob/main/static/js/app.js"
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
### Backend Components
|
| 208 |
|
| 209 |
1. **PDF Processing Module** (`preprocessing.py`):
|
|
|
|
| 483 |
|
| 484 |
## License
|
| 485 |
|
| 486 |
+
MIT
|
|
|