Inspiration
Honestly? My own chaotic workflow. I'm a filmmaker first, which means I am swamped by scattered notes, half-baked ideas, and random text files that vaguely resemble plot outlines. I needed a way to quickly make sense of the mess. Plus, I've been having fun working with LLMs and especially agentic frameworks like PocketFlow. AI agents' workflows are crazy fun to think up. My partner actually took part in an interaction design contest for some club despite not being in the program and I figured I should do the same. Seemed like a good excuse to build something.
What it does
Pocket Summarizer is my attempt to bring order to chaos, with a twist:
- File Summarizer: You can feed it a bunch of
.txtor.mdfiles (up to 5, max 1MB each), choose a summary detail level ("Short," "Medium," or "Comprehensive"), and let Perplexity AI (r1-1776model) do the heavy lifting. It reads them, summarizes each, and combines them into a final, hopefully coherent, summary. It provides live updates while processing, which is nice. You get the result as Markdown or raw text, ready to copy or download. - GitHub Storyteller: (This feature is described above in the inspiration section). Input a public GitHub repo URL, and it pulls the README and recent commits, then asks Perplexity to generate a short, fictional narrative based on that activity.
I also included a little something for the hackers who worked so hard. The bear button on the header holds secrets. I hope you enjoy it! 🐻
How we built it
As a solo operation against the clock, here's the stack:
- Backend: Flask. Python's pretty straightforward.
- Frontend: Vanilla JavaScript, HTML, CSS. Kept it simple. No framework overhead, just direct DOM manipulation for the UI, drag-and-drop, tabs, and the theme toggle.
- AI Magic: The Perplexity API, called via the
openaiPython library. A significant amount of time went intollm_caller.py, tweaking prompts to get summaries that stick to the source and stories that have some personality. Prompting is definitely its own skill. - Real-time Stuff: Flask-SSE with Redis for the live progress updates. Makes the waiting less ambiguous.
- Async: Basic Python
threadinghandles the background work for API calls (summarization, GitHub fetching). It functions, but for something more serious, Celery/RQ would be the way to go. - State/Sessions: Flask-Session (using the filesystem backend) for user sessions. Redis holds task results temporarily so the front end knows what's happening.
- GitHub API: Standard
requestslibrary for hitting the GitHub API v3 (READMEs, commits). Wrote some custom exceptions ingithub_utils.pyfor cleaner error handling (bad URLs, 404s, etc.). - The PocketFlow Situation: Okay, real talk. I really like agentic frameworks, so the codebase includes my PocketFlow library and node definitions (
pocketflow_logic/). The plan was a neat, orchestrated flow. The reality was a hackathon deadline. So,app.pycurrently calls the utility functions directly for speed. The PocketFlow code is there, though, waiting patiently. - Deployment: Packaged with Gunicorn and Gevent, configured via
Procfileandrender.yamlfor deploying on Render.
Challenges we ran into
Naturally, a few things came up:
- The Clock: The main antagonist of any hackathon. This directly led to the PocketFlow implementation being sidelined for a more direct approach. Shipping > perfect architecture under pressure.
- Async Complexity: Making Python threads, the Flask app context (for SSE/logging), and Redis play nice took some debugging cycles. Background tasks require attention.
- Prompt Engineering: Getting the AI to summarize faithfully is one challenge. Getting it to generate creative but relevant stories from commit logs is another. Lots of iteration. It's kind of like directing, but the actor is pure math.
- API Hurdles: GitHub rate limits are a thing. Making
github_utils.pyrobust against various API responses (missing READMEs, errors) was important. - Vanilla JS Management: Keeping the UI state consistent (loading indicators, results visibility, SSE updates) without a framework required conscious effort to avoid a tangle.
Accomplishments that we're proud of
- It Works: Shipping both the summarizer and the storyteller as a solo dev on a tight timeline feels productive.
- The Storyteller Concept: Turning commit logs into a narrative is a fun twist, leaning into the filmmaker side. Seems like a potentially interesting application.
- Real-Time Feedback: The SSE updates make the app feel more responsive and less like a black box.
- Usable UI: For a quick build, the interface handles the core tasks reasonably well (drag-and-drop, view toggles). The bear toggle adds a bit of character.
- Prompt Iteration: The final prompts in
llm_caller.pyare the result of focused effort and seem to guide the models effectively for their respective tasks.
What we learned
- Flask + SSE + Threading is workable for prototypes but needs careful context management. Redis is pretty much mandatory for Flask-SSE.
- LLMs are flexible, but require distinct prompting strategies for constrained tasks (summarization) versus creative ones (storytelling).
- Robust error handling is non-negotiable, especially with background processes and external APIs. Plan for failure.
- Vanilla JS can build dynamic UIs, but organization is key as complexity grows.
- Hackathons are exercises in pragmatism. Sometimes the "perfect" plan needs to adapt to the reality of the deadline.
- Prompting is an engaging way to leverage AI capabilities. Still really enjoying it.
What's next for Pocket Summarizer
This feels like a solid first cut. Potential future edits include:
- Integrate PocketFlow Properly: Refactor
app.pyto use the agentic framework already present in the code. That was the original intent. - Improve Async: Swap
threadingfor Celery or RQ for better scalability and task management. - Broader File Support: Look into libraries for handling PDFs or DOCX files to ingest more types of notes.
- Enhance Storyteller: Add options for story tone/length, maybe incorporate basic code analysis for more tech-focused humor.
- Better Persistence: Use Redis more strategically or a database for longer-term storage of task results, potentially user accounts.
- UI Refinements: Continue iterating on the user interface based on usage and feedback.
Additional Notes
I included a few samples of messy documents. As of right now the project only takes text or markdown files.
So that's Pocket Summarizer. It was an interesting build.
Log in or sign up for Devpost to join the conversation.