How 1062goodman/welfare works
This repository implements a Korean welfare-policy chatbot, with a React Native client, FastAPI/LangGraph chat backends, and a Neo4j-backed policy-data workflow. The principal flow is user message → chat API → intent/condition handling and policy search → generated response → mobile display. It also contains baseline and GraphRAG search variants, session cleanup, and voice transcription support in the client API. The README documents the ingestion stages; those links are shown as documented flows. Some backend route and ingestion details were not sampled.
Main entry points: nodes.py RAG model and graph · chat.tsx Chat screen · api.py Chat endpoints · chatApi.ts Chat API client
Components 22
Mobile client
- Chat screen
front/welfare-chat-app/app/(tabs)/chat/chat.tsx - Session manager
front/welfare-chat-app/utils/sessionManager.ts - Font preferences
front/welfare-chat-app/contexts/font-size-context.tsx - Chat API client
front/welfare-chat-app/api/chatApi.ts
Chat service
- FastAPI app
back/chat/main.py - Chat endpoints
back/chat/api.py - Chat workflow
back/chat/graph.py - Chat processing nodes
back/chat/nodes.py - Chat prompts and state
back/rag/prompts.py - Session cleanup
back/chat/tasks.py - Three-turn API
back/chat 3turn/api.py - Three-turn nodes
back/chat 3turn/nodes.py
Policy search
- GraphRAG search
back/GraphRAG/nodes.py - Baseline RAG
back/rag/baseline_nodes.py - RAG model and graph
back/rag/nodes.py - Neo4j policy store
back/data_ext/db.py
Data ingestion
- Data extraction
back/data_ext/dataExtraction.py - XML parsing
back/data_ext/parsing.py - Policy detail crawl
back/data_ext/parsing_crawl.py
Other components
- Chat user
- Public data API
- Upstage models
Connections 23
- Chat user → Chat screen: sends message
front/welfare-chat-app/app/(tabs)/chat/chat.tsx - Chat screen → Session manager: gets session
front/welfare-chat-app/app/(tabs)/chat/chat.tsx - Chat screen → Font preferences: uses preferences
front/welfare-chat-app/app/(tabs)/chat/chat.tsx - Chat screen → Chat API client: calls
front/welfare-chat-app/app/(tabs)/chat/chat.tsx - Chat API client → Chat endpoints: sends chat request
front/welfare-chat-app/api/chatApi.ts - Chat API client → Chat endpoints: fetches history
front/welfare-chat-app/api/chatApi.ts - FastAPI app → Chat endpoints: mounts routes
back/chat/main.py - FastAPI app → Session cleanup: runs cleanup
back/chat/main.py - Chat endpoints → Chat workflow: invokes workflow
back/chat/api.py - Chat workflow → Chat processing nodes: registers nodes
back/chat/graph.py - Chat processing nodes → Chat prompts and state: uses prompts
back/chat/nodes.py - Chat processing nodes → RAG model and graph: uses search resources
back/chat/nodes.py - Chat workflow → Session cleanup: shares session memory
- Three-turn API → Three-turn nodes: runs alternate flow
- GraphRAG search → RAG model and graph: queries graph and embeddings
back/GraphRAG/nodes.py - Baseline RAG → RAG model and graph: uses graph and embeddings
back/rag/baseline_nodes.py - RAG model and graph → Neo4j policy store: queries policies
- RAG model and graph → Upstage models: calls LLM and embeddings
- Public data API → Data extraction: provides records
- Data extraction → XML parsing: produces XML
- XML parsing → Policy detail crawl: produces JSON
- Policy detail crawl → Neo4j policy store: loads policy data
- Neo4j policy store → GraphRAG search: supplies policy search
back/GraphRAG/nodes.py