Skip to content

rb-thompson/bear-streamlit

Repository files navigation

BEAR: Pizzeria Insights Chatbot License: MIT

Streamlit Python

BEAR is a modular, self-evolving RAG (Retrieval-Augmented Generation) chatbot for pizzeria kitchen staff, built with Streamlit, LangChain, and Hugging Face. It turns lore documents, user queries, journal entries, and feedback into personalized insights, blending game theory and social dynamics for shift management. Designed for mobile access, it logs interactions, trains on verified feedback, and syncs deltas for incremental growth.

Your "formidable beast" for kitchen wisdom.

Features

  • Query BEAR: Chat-based RAG for lore queries (e.g., "Rush hour tips?") with confidence scores, role-routing (e.g., CookAgent for shift dynamics), and response feedback (thumbs-up/down with corrections).

  • Journal Entry: Log shift stories with mood scoring (0-4, keyword-assisted) for vibe tracking. Flags for training.

  • Train BEAR: Incremental updates from verified feedback (Q&A pairs) and synced journals/news to vector store. Grows the KB without full rebuilds.

  • System Stats: Metrics for interactions, avg confidence, journal mood trends, and vector count. Tracks evolution.

  • Config Options: News snippet ingest, system clear (with confirmation), and chat history wipe. Audit logged.

  • Persistence: Cross-session chat history via JSON; SQLite for interactions/feedback; FAISS for vectors.

Quick Start

Prerequisites

  • Python 3.10+.
  • Git for cloning.

Setup

  1. Clone the repo:
    git clone https://github.com/yourusername/bear-streamlit.git
    cd bear-streamlit
  2. Create virtual env and install deps:
    python -m venv venv
    source venv/bin/activate  # Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Add lore data:
  • Place .txt files (e.g., game_theory_hut.txt, social_dynamics_hut.txt) in data/ for initial vectors.
  • Run locally:
    streamlit run app.py

Usage

  • Query: Chat with BEAR for lore (e.g., "Wingstreet rush dynamics?"). Thumbs-up/down responses for training.
  • Journal: Log shifts with mood slider (0-4: Terrible to Great). Syncs to vectors for role-specific recall.
  • Train: "Train on Verified" for feedback Q&A; "Sync Deltas" for journals/news—grows the beast.
  • Stats: View metrics (interactions, avg mood) and recent vibes.
  • Config: Clear system (nukes DB/vectors for reset); wipe chat history.

Mobile-friendly: Wide layout, touch-optimized buttons.

Architecture Overview

Data Flow: Lore → Preprocess → Vectors → RAG/Orchestrator → Response → Log Feedback → Train/Sync → Updated Vectors.

Standards: CPU-only (device=-1), incremental (no full rebuilds), traceable (logs, metrics), extensible (config-driven).

Contributing

  • Fork, clone, install deps.
  • Test locally (streamlit run app.py).
  • Add lore .txt to data/ for custom training.
  • Submit PRs for features.

Issues? Open one with traceback + steps.

License

MIT License—fork, modify, deploy freely. See LICENSE.

Built with ❤️ for kitchen workers! Questions? Ping the repo.

Packages

 
 
 

Contributors

Languages