## Inspiration
Every time I used ChatGPT to learn something — machine learning, algorithms, math concepts — I ran into the same frustration. When I didn't understand one part of the response, I had to copy that text, paste it into a new message, and ask again. The AI would regenerate everything from scratch. My chat history grew to 10–15 pages just to understand one topic. The problem wasn't the AI — it was the workflow.
What We Built
Refine-It is a chat interface that lets you select any part of an AI response and refine just that block — without regenerating the entire answer. Highlight a sentence, click refine, give feedback, and only that part updates. Everything else stays exactly as it was.
We also built:
- Block-level revisions — every AI response is parsed into blocks (paragraphs, code, headings). Each block is independently editable.
- Comparison Chat — run two AI models side by side simultaneously and compare token costs in real time.
- Token cost tracking — see exactly how much each revision costs vs full regeneration.
How We Built It
- Frontend: React 19 + Vite + Tailwind CSS
- AI Layer: OpenAI API (GPT-4o) via REST
- Block Parser: Custom TypeScript parser that splits AI responses into typed
blocks with UUIDs and revision metadata
- Revision Engine: Surgical API calls that send only the target block + adjacent
context, not the full conversation
The token efficiency of block revision vs full regeneration can be expressed as:
$$\text{Savings} = 1 - \frac{T_{block}}{T_{full}} \approx 60\text{–}80\%$$
where $T_{block}$ is tokens sent for a single block revision and $T_{full}$ is tokens for full response regeneration.
Challenges
- Parsing AI responses accurately — AI responses don't follow strict formatting. Building a parser that correctly identifies code blocks, headings, lists, and paragraphs across different response styles was harder than expected.
- Inline character offset editing — Replacing text at exact character positions without breaking markdown formatting required careful offset tracking.
- Keeping revision context coherent — When revising one block, the AI needs just enough surrounding context to maintain flow, but not so much that token costs spike.
What We Learned
That the real problem wasn't AI quality — it was AI workflow. People don't need better answers. They need better tools to interact with the answers they already have.
Built With
- gpt-4o
- javascript
- openai-api
- react-19
- rest
- tailwind-css
- typescript
- vite
Log in or sign up for Devpost to join the conversation.