Conversational academic research assistant for the CSUSB library. Students search library resources in natural language via Streamlit; LangGraph manages multi-turn memory; a typed tool searches the CSUSB Primo API.
- UI: Streamlit
- Workflow / memory: LangGraph +
MemorySaver(thread ID) - Chat LLM: OpenRouter free model (default
nex-agi/nex-n2.5-pro:free, with fallbacks) - Routing decisions: OpenRouter Decisions API +
~typesafe/jev-latest(search vs clarify vs chitchat vs off-topic guardrail) - Library: CSUSB Primo public Explore REST client
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envEdit .env and set OPENROUTER_API_KEY from OpenRouter keys.
streamlit run app.pyOpen the URL Streamlit prints (usually http://localhost:8501).
Ensure .env has OPENROUTER_API_KEY, then:
docker compose up --build- "Find recent articles about machine learning" → search + results
- "Show only books from 2023" → same thread reuses the topic with new filters
- "Find dissertations by John Smith" → clarifying question for a topic