TanGentleman / Sahaya

Interface with Textbooks with Ease
https://textbook-ai.vercel.app/
Apache License 2.0
0 stars 1 forks source link

Organize Full Technology Stack #3

Open TanGentleman opened 1 month ago

TanGentleman commented 1 month ago

Orchestration Concerns:

TanGentleman commented 1 month ago

The flow will look a little something like this:

  1. User visits textbook-ai website, signs in, and is directed to app page
  2. User uploads a PDF (Like Intro to Physics) into memory
  3. A TextbookSchema is generated and assured to be valid (Uses LLM component)
  4. Chunk the textbook with appropriate metadata (page number, other relevant fields) - Note that a function getMetadataByPage would still need information that should be collected @ step 3. Something like mapping the page ranges to the chapter/sections (Should be in table of contents)
  5. Add these chunks and their metadata to a Convex table
  6. Create embeddings for each chunk

At this point, indexing is done!

TanGentleman commented 1 month ago

After indexing a textbook, here's an abstracted version of what flows should look like: INPUT: The active settings, the current state, and the user input (button press or string input) OUTPUT: GOAL (Retrieved content, Content + Text, or just Text (covers fail case)

The flow:

  1. Collect inputs
  2. Identify GOAL, or fail (if input can't be resolved to a valid goal)
  3. Begin appropriate LangGraph workflow!
  4. Stream steps to completion or fail (Ensures deterministic failure behavior with handled side effects)
  5. Serve GOAL (e.g. Excerpts of the textbook content, with the appropriate pages/sections provided, + add a summary cuz why not, AI is gimmicky but it can be helpful)

The reason to make this a touch more complicated with LangGraph (at least for now) is because of the side effects when handling eval functions or other substeps that may fail, but can be soundly reasoned through.