Spaces:
Configuration error
Download docs/USER_INTERFACE_GUIDE.md from Darshankumarr03/JanSahayak: direct link, hf CLI and curl.
- Browser
- Download file 5.59 kB
-
https://huggingface.co/spaces/Darshankumarr03/JanSahayak/resolve/main/docs/USER_INTERFACE_GUIDE.md
- Command line
-
hf download hf://spaces/Darshankumarr03/JanSahayak/docs/USER_INTERFACE_GUIDE.md
-
curl -L -o USER_INTERFACE_GUIDE.md https://huggingface.co/spaces/Darshankumarr03/JanSahayak/resolve/main/docs/USER_INTERFACE_GUIDE.md
User-Friendly Interface Guide
Overview
The new user interface provides a simplified, intuitive way to interact with the Zynd Civic Assistant system through 4 main options:
- π° Check Benefits - Discover all government benefits you qualify for
- β Verify Eligibility - Check if you qualify for a specific scheme
- π Explain Policy - Understand any government policy in simple terms
- π Help Fill Application - Get step-by-step guidance to apply
Running the Interface
Quick Start
# From the project root
streamlit run src/user_interface.py
The interface will open in your browser at http://localhost:8501
Using the Old Interface (CLI or Original Streamlit)
# Command-line interface
python src/main.py
# Original chat-based Streamlit
streamlit run src/streamlit_app.py
How It Works
1. Select an Option
On the home page, click one of the 4 main option buttons based on what you need.
2. Answer Questions
Each option will present relevant questions:
- Check Benefits asks about: age, income, location, employment, family size, education, category
- Verify Eligibility asks about: scheme name + your profile information
- Explain Policy asks: which policy and what aspect to explain
- Help Application asks: scheme name, documents available, application stage
All questions include:
- Clear labels and descriptions
- Help text explaining why the question matters
- Input validation with helpful error messages
- Required vs optional field indicators
3. Get Results
After submitting, the system:
- Validates your inputs
- Builds a comprehensive query from your answers
- Routes to the appropriate agent(s)
- Displays personalized, actionable results
4. Custom Queries
Don't fit into one of the 4 options? Use the free-form text box at the bottom of the home page to ask anything directly.
Features
Input Validation
- Age: Must be 0-120
- Income: Positive numbers, formatted correctly
- Location: Valid state/region names
- Scheme/Policy: Minimum 3 characters
- Family Size: At least 1 member
Context Sharing
The system maintains your profile across all agent interactions:
- Once you provide your age, income, etc., agents use this context
- No need to repeat information
- More accurate, personalized responses
Synchronous Operation
Each agent waits for previous processing to complete, ensuring:
- Coherent responses
- Proper context flow
- No race conditions
Progress Indicators
Visual feedback during processing:
- π§ Routing your request
- π Analyzing policy documents
- β Checking eligibility criteria
- π° Searching for benefits
- π’ Preparing guidance
Example Workflows
Check Benefits Workflow
- Click "π° Check Benefits"
- Enter: Age=35, Income=200000, Location=Maharashtra, Employment=Farmer, Family=4
- System discovers PM-KISAN, PMFBY, Ayushman Bharat, etc.
- View detailed results with eligibility reasoning
Verify Eligibility Workflow
- Click "β Verify Eligibility"
- Enter scheme: "Ayushman Bharat"
- Provide profile information
- Get clear YES/NO with reasoning and next steps
Explain Policy Workflow
- Click "π Explain Policy"
- Enter policy: "PM-KISAN"
- Select aspect: "Who is eligible?"
- Read simple explanation with examples
Help Application Workflow
- Click "π Help Fill Application"
- Enter scheme: "PM-SVANidhi"
- Select documents you have
- Choose stage: "Just starting"
- Get step-by-step guidance
Architecture
New Files Created
src/user_interface.py- Main Streamlit interfacesrc/question_config.py- Question definitions for each optionsrc/validators.py- Input validation utilities
Modified Files
src/state.py- Added user_profile, selected_option, collected_answerssrc/graph.py- Enhanced nodes to use user profile and support direct routing
State Flow
User selects option β Answers questions β Validation β
Build query from answers β Set user_profile in state β
Route to agent (bypass orchestrator if intent known) β
Agent uses profile for context β Generate response β Display
Troubleshooting
"Module not found" errors
Ensure you're in the project root and virtual environment is activated:
cd c:\Users\bhara\Desktop\Projects\zynd-protocals-application
.\venv\Scripts\activate
Port already in use
Streamlit default port 8501 is busy:
streamlit run src/user_interface.py --server.port 8502
Validation errors
- Check that inputs match the expected format
- Age and income must be numbers
- Required fields cannot be empty
No response generated
- Check logs in
logs/directory - Verify agents are functioning:
python src/main.py - Ensure LLM API keys are set in
.env
Next Steps
- Test all 4 options with different inputs
- Try edge cases (very high income, age=0, etc.)
- Test custom queries outside the 4 main options
- Verify agent responses are accurate and helpful
- Provide feedback on question clarity and UX
Benefits Over Old Interface
| Old Interface | New Interface |
|---|---|
| Free-form text only | Guided questions + free-form |
| No input validation | Comprehensive validation |
| User must know what to ask | Clear 4-option menu |
| No context preservation | User profile shared across agents |
| Text-based feedback | Visual progress indicators |
| Generic responses | Personalized based on profile |