wangzerui commited on
Commit
7dce429
Β·
1 Parent(s): 10b617b
README.md CHANGED
@@ -198,43 +198,55 @@ residential-architecture-assistant/
198
 
199
  ## πŸš€ **Getting Started**
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  ### **System Requirements**
202
 
203
  ```bash
204
- # Core Dependencies
205
  Python >= 3.8
206
- OpenAI API Access
207
- LangGraph >= 0.0.40
208
- LangChain >= 0.1.0
209
  Gradio >= 4.0.0
210
 
211
  # Essential Dependencies
212
  python-dotenv >= 1.0.0 # Environment management
213
  ```
214
 
215
- ### **Installation & Setup**
216
 
217
  ```bash
218
  # 1. Clone the repository
219
  git clone https://github.com/ZeruiW/Home_Design_Agent.git
220
  cd Home_Design_Agent
221
 
222
- # 2. Create virtual environment or Conda (recommended)
223
  python -m venv venv
224
  source venv/bin/activate # On Windows: venv\Scripts\activate
225
 
226
  # 3. Install dependencies
227
  pip install -r requirements.txt
228
 
229
- # 4. Configure environment
230
- cp .env.example .env
231
- # Edit .env and add: OPENAI_API_KEY=your_openai_api_key_here
232
 
233
- # 5. Launch production interface
234
  python gradio_app.py
235
- # β†’ Opens http://localhost:7860 or 7861 or 7862 (auto port detection)
236
-
237
-
238
  ```
239
 
240
  ### **Alternative Launch Methods**
@@ -243,6 +255,8 @@ python gradio_app.py
243
  # Command Line Interface (for debugging)
244
  python main.py
245
 
 
 
246
  ```
247
 
248
  ---
@@ -411,13 +425,58 @@ routing_map = {
411
 
412
  ---
413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  ## πŸ“Š **Production Deployment**
415
 
416
  ### **Performance Metrics**
417
 
418
  - **Response Time**: < 3 seconds for routine consultations
419
  - **Agent Coordination**: < 5 seconds for multi-agent workflows
420
- - **State Persistence**: 100% conversation continuity across sessions
421
  - **Error Rate**: 0% (all NoneType issues resolved)
422
  - **Reliability**: 7/7 agents fully operational
423
 
@@ -425,7 +484,7 @@ routing_map = {
425
 
426
  - **Stateless Agents**: Support horizontal scaling
427
  - **JSON Storage**: Easily upgradeable to database systems
428
- - **Multi-User Support**: Complete data isolation between users
429
  - **API-Ready**: Agents exportable as REST/GraphQL endpoints
430
 
431
  πŸ“„ **License & System Information**
 
198
 
199
  ## πŸš€ **Getting Started**
200
 
201
+ ### **πŸ€— Hugging Face Spaces Deployment**
202
+
203
+ This application is ready for **one-click deployment** to Hugging Face Spaces:
204
+
205
+ #### **Option 1: Direct Hugging Face Spaces Deployment**
206
+ 1. **Fork/Clone** this repository to your GitHub account
207
+ 2. **Create a new Space** on [Hugging Face](https://huggingface.co/spaces)
208
+ 3. **Select Gradio** as the SDK
209
+ 4. **Connect your GitHub repository** to the Space
210
+ 5. **Deploy automatically** - Hugging Face will use `app.py` and `requirements.txt`
211
+
212
+ #### **Option 2: Quick Deploy Button**
213
+ [![Deploy to Hugging Face Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-md.svg)](https://huggingface.co/spaces/new?template=gradio&sdk=gradio&filename=app.py)
214
+
215
  ### **System Requirements**
216
 
217
  ```bash
218
+ # Core Dependencies (All included in requirements.txt)
219
  Python >= 3.8
220
+ OpenAI API Access (User provides their own key)
221
+ LangGraph >= 0.2.0
222
+ LangChain >= 0.3.0
223
  Gradio >= 4.0.0
224
 
225
  # Essential Dependencies
226
  python-dotenv >= 1.0.0 # Environment management
227
  ```
228
 
229
+ ### **Local Installation & Setup**
230
 
231
  ```bash
232
  # 1. Clone the repository
233
  git clone https://github.com/ZeruiW/Home_Design_Agent.git
234
  cd Home_Design_Agent
235
 
236
+ # 2. Create virtual environment (recommended)
237
  python -m venv venv
238
  source venv/bin/activate # On Windows: venv\Scripts\activate
239
 
240
  # 3. Install dependencies
241
  pip install -r requirements.txt
242
 
243
+ # 4. Launch for Hugging Face Spaces (main app)
244
+ python app.py
245
+ # β†’ Opens http://localhost:7860
246
 
247
+ # 5. Alternative: Launch full-featured local version
248
  python gradio_app.py
249
+ # β†’ Opens http://localhost:7862 (with user state management)
 
 
250
  ```
251
 
252
  ### **Alternative Launch Methods**
 
255
  # Command Line Interface (for debugging)
256
  python main.py
257
 
258
+ # Full multi-user interface (local development)
259
+ python gradio_app.py
260
  ```
261
 
262
  ---
 
425
 
426
  ---
427
 
428
+ ## πŸš€ **Hugging Face Spaces Configuration**
429
+
430
+ ### **Deployment Files**
431
+
432
+ This repository includes everything needed for Hugging Face Spaces deployment:
433
+
434
+ ```bash
435
+ πŸ“ Required Files for HF Spaces:
436
+ β”œβ”€β”€ app.py # Main Gradio app (HF Spaces entry point)
437
+ β”œβ”€β”€ requirements.txt # Python dependencies
438
+ β”œβ”€β”€ README.md # Space documentation (this file)
439
+ └── graph.py # Core LangGraph architecture
440
+ └── agents.py # Multi-agent system
441
+ └── state.py # State management
442
+ └── user_state_manager.py # User persistence
443
+ └── detailed_budget_agent.py # Specialized agents
444
+ ```
445
+
446
+ ### **Space Configuration**
447
+
448
+ **Recommended Hugging Face Space Settings:**
449
+ - **SDK**: Gradio
450
+ - **Python Version**: 3.9+
451
+ - **Hardware**: CPU (Basic) - sufficient for this application
452
+ - **Visibility**: Public (users provide their own OpenAI API keys)
453
+ - **License**: MIT
454
+
455
+ ### **Environment Variables (Optional)**
456
+
457
+ For enhanced functionality, you can set these in your Space settings:
458
+
459
+ ```bash
460
+ # Optional: Default values (users still need to provide their API key)
461
+ OPENAI_API_KEY="" # Users provide their own key via UI
462
+ ```
463
+
464
+ ### **Usage in Hugging Face Spaces**
465
+
466
+ 1. **Users visit your Space**
467
+ 2. **Enter their OpenAI API key** (securely handled, not stored)
468
+ 3. **Initialize the assistant** with one click
469
+ 4. **Start their architecture consultation**
470
+
471
+ ---
472
+
473
  ## πŸ“Š **Production Deployment**
474
 
475
  ### **Performance Metrics**
476
 
477
  - **Response Time**: < 3 seconds for routine consultations
478
  - **Agent Coordination**: < 5 seconds for multi-agent workflows
479
+ - **State Persistence**: Session-based (in HF Spaces) / Full persistence (local)
480
  - **Error Rate**: 0% (all NoneType issues resolved)
481
  - **Reliability**: 7/7 agents fully operational
482
 
 
484
 
485
  - **Stateless Agents**: Support horizontal scaling
486
  - **JSON Storage**: Easily upgradeable to database systems
487
+ - **Multi-User Support**: Session isolation in HF Spaces
488
  - **API-Ready**: Agents exportable as REST/GraphQL endpoints
489
 
490
  πŸ“„ **License & System Information**
__pycache__/agents.cpython-311.pyc ADDED
Binary file (53.1 kB). View file
 
__pycache__/app.cpython-311.pyc ADDED
Binary file (16.3 kB). View file
 
__pycache__/detailed_budget_agent.cpython-311.pyc ADDED
Binary file (15.1 kB). View file
 
__pycache__/graph.cpython-311.pyc ADDED
Binary file (10.4 kB). View file
 
__pycache__/state.cpython-311.pyc ADDED
Binary file (4.32 kB). View file
 
__pycache__/user_state_manager.cpython-311.pyc ADDED
Binary file (17.6 kB). View file