state-policy-rag-ui is a cross-platform frontend for the state-policy-rag-starter backend.
It provides a ChatGPT-style UI for:
- asking policy-grounded questions
- viewing cited answers from the RAG service
- inspecting supporting source chunks from MCP policy search
- validating local backend health during development
The current implementation is built with:
- Expo
- React Native
- Expo Router
- React Native Web
This repo is currently an early starter UI.
What that means:
- the web path is the currently validated experience
- the UI is already wired to the live backend, not mock data
- iOS and Android are scaffolded through Expo, but have not yet been fully validated end to end
- the backend dependency is required; this repo does not run as a standalone AI product by itself
This repo is the UI layer.
The backend lives in:
That backend provides:
mcp_serverfor policy search and controlled data accessrag_servicefor prompt assembly and answer generation- Qdrant for vector search
- Ollama for local model inference
This UI assumes the backend is already running locally.
Default local API targets:
http://127.0.0.1:8080formcp_serverhttp://127.0.0.1:8081forrag_service
If you are non-technical or just getting started, think of this as a two-part setup:
- run the backend in
state-policy-rag-starter - run this UI repo and point it at that backend
This UI repo alone is not enough. It depends on the state starter backend being ready first.
For the UI alone, the hardware needs are modest.
Recommended local machine:
- modern Mac, Windows PC, or Linux workstation
8 GB RAMminimum16 GB RAMrecommended for a smoother overall experience because the backend stack uses Docker, Qdrant, and Ollama- at least
10 GBfree disk space for UI dependencies plus backend/tooling overhead
Important practical note:
- the UI is light
- the backend is the heavier part
- if you plan to run both repos on one machine, follow the hardware guidance in
state-policy-rag-starter
To run this UI locally, you need:
- Git
- Node.js
18+or newer - npm
- the
state-policy-rag-starterbackend running locally
Recommended:
- current LTS Node.js
- a modern browser like Chrome, Edge, or Safari
This UI repo uses open-source tooling, but you should still be aware of surrounding licenses and usage conditions.
You may need or want to review:
- the license of this repository once added at the repo level
- Expo and React Native open-source licenses
- Node.js and npm package licenses
- Docker Desktop licensing if this is used inside a larger company or government environment
- Ollama model and model-weight licenses through the backend stack
- any licenses or terms attached to models used in
state-policy-rag-starter
Practical guidance:
- for personal development, there is usually no additional paid UI-specific license required
- for enterprise or government use, check Docker Desktop terms, model usage terms, and your organization’s open-source review process
- live backend health checks
- editable API configuration in the UI
- live
/search_policiesintegration - live
/askintegration - source panel for retrieved policy chunks
- simple conversation reset flow
This is the simplest path for a beginner.
- Start the backend first in
state-policy-rag-starter
Recommended validation:
curl http://127.0.0.1:8080/ready
curl http://127.0.0.1:8081/ready- Start the UI
cd /Volumes/HappyFam/genai-projects/state-policy-rag-ui
npm install
npm run web- In the UI config panel, confirm:
RAG Service URL:http://127.0.0.1:8081MCP Service URL:http://127.0.0.1:8080User Header:test.user@state.gov
-
Click
Apply settings -
Ask a test question such as:
What does the policy require the State Agency to display on the website home page?
If the backend is healthy, you should see:
- an answer in the conversation pane
- supporting chunks in the sources panel
If you are less technical, use this simpler mental model:
state-policy-rag-starteris the enginestate-policy-rag-uiis the dashboard
Start the engine first. Then open the dashboard.
If the UI says the backend is unavailable, the problem is almost always in the backend or the configured URL, not in the chat screen itself.
- Web is the currently validated path
- iOS and Android are supported through Expo, but have not yet been fully validated end to end against the local backend
- on a physical mobile device,
127.0.0.1will not point to your Mac; use your computer’s LAN IP instead
- README.md: project overview and beginner run instructions
- docs/ARCHITECTURE.md: UI architecture and backend integration model
- docs/SETUP.md: setup steps and local backend integration details
- persistent conversation history
- richer source cards and citation drilldowns
- streaming answer UX
- settings persistence
- mobile validation and responsive polish
- admin and governance views on top of the starter backend