Inspiration
In order to protect personal privacy, we want to build a local-first ai based web extension and everything is running in browser only.
What it does
A simple web extension for daily surfing internet. The features:
- chatting with page
- page summariser
- language detector and translator
- system prompt management
- quick action management
- all created system prompts and quick actions can be used in future interaction.
How we built it
We built it with the following tools
- plasmo
- gemini nano
- langchain textsplitter
- ai code editors: cursor and zed
- react
- tailwind
Challenges we ran into
- how to summarise a long page.
we solved this with two actions:
- cleaning all unnecessary tags such as the
imgorcodebefore passing to the summariser. - when the cleaned data is still too long, it will be split with langchain text splitter as chunks. then summarising each chunk and joining all results as the final summary.
- how to chat with a long page.
we solved this with two actions:
- keeping no chatting history because we found it is not so necessary in most of the cases.
- instead of using the raw page text, we used the summary of this page as the context for the chatting.
Accomplishments that we're proud of
- supporting the long context for nano.
- providing an extensible tool which supports managing the system prompts and creating the simple tools based on nano api.
- we are satisfied with the UI we built.
What we learned
- preprocessing the data before passing it to the AI model.
- writing an efficient prompt for nano.
What's next for tsw-nano
- evolving with nano together
- integrating with gemini api service.
Built With
- gemini
- langchain
- react
- typescript
Log in or sign up for Devpost to join the conversation.