Skip to content

Sebstep/pathfinder-guard

Repository files navigation

GUARD

Generative Universal Assistant for Resourceful Development

GUARD is a scaffolded AI learning environment for educators. Instead of treating the chat model as the product, it treats the educator's thinking process as the product: each lab guides the user through reflection, prompt composition, generation, and critical evaluation inside a split-panel workspace.

What This App Does

GUARD helps educators practice using AI critically through structured labs:

  • Plan a Class Activity
  • Create a Learning Assessment
  • Design a Rubric

Each lab is broken into guided iterations. Users answer Socratic scaffolding questions, watch those answers assemble into a prompt template, send the prompt to a live model, and then evaluate the output for alignment, rigor, and common AI failure modes.

Core Features

  • Split-panel lab interface with scaffolding on the left and live chat on the right
  • Four-phase workflow per iteration: Reflect -> Compose -> Generate -> Evaluate
  • Three built-in educator labs with domain-specific prompts and evaluation checklists
  • Prompt assembly that turns reflection answers into an editable prompt template
  • Streaming chat responses via OpenRouter-compatible models
  • Optional BYOK flow on the Settings page for model choice
  • Additional context upload support for pdf, docx, txt, and md files
  • Session persistence in browser storage so users can resume work locally
  • Session history with autosave and side-by-side comparison during later iterations

Tech Stack

  • Next.js 16 App Router
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • Zustand for client state and persistence
  • OpenAI SDK pointed at the OpenRouter API
  • pdf-parse and mammoth for file ingestion

Local Development

Install dependencies:

npm install

Run the app:

npm run dev

Open http://localhost:3000.

Environment

Chat requests require an OpenRouter API key from one of these sources:

  1. OPENROUTER_API_KEY in your local environment
  2. A BYOK key entered in the app's Settings page

Example .env:

OPENROUTER_API_KEY=sk-or-v1-...

Without either of those, /api/chat will return an error.

Using the App

  1. Start from the landing page and choose one of the three labs.
  2. Answer the reflection questions in the left panel.
  3. Review or edit the assembled prompt in the compose phase.
  4. Send the prompt to the model and inspect the streamed response.
  5. Work through the evaluation checklist and reflection prompts.
  6. Continue into the next iteration or complete the lab.

The Settings page lets users store a BYOK OpenRouter key in sessionStorage and choose from curated model options or a custom OpenRouter model ID.

Storage Model

GUARD is intentionally browser-local for user state:

  • Chat messages, active lab session, selected model, and BYOK key are stored in sessionStorage
  • Session history is stored in localStorage
  • History keeps up to 20 sessions

This means saved work is tied to the same browser and device. Clearing browser data removes it.

File Uploads

The scaffolding panel supports optional context uploads to enrich prompts.

  • Supported types: pdf, docx, txt, md
  • Maximum file size: 20 MB
  • Uploaded files are parsed through /api/parse-file and normalized into plain text

Key Routes

  • / - landing page and lab selection
  • /lab/[labId] - guided lab workspace
  • /settings - BYOK and model selection
  • /history - resume or review saved sessions
  • /api/chat - streaming chat proxy to OpenRouter
  • /api/parse-file - text extraction for uploaded files

Project Structure

app/
  api/
  history/
  lab/[labId]/
  settings/
components/
  chat/
  landing/
  layout/
  scaffolding/
content/
  activity-planning.ts
  assessment-creation.ts
  rubric-design.ts
hooks/
stores/
lib/

Scripts

npm run dev
npm run build
npm run start
npm run lint

Notes

  • The default model constant is arcee-ai/trinity-large-preview:free.
  • On hosted deployments, a shared OpenRouter key can be supplied through environment configuration.
  • netlify.toml currently contains a redirect from the old Netlify domain to guard.ai-pathfinder.eu.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors