Built with SvelteKit and Ollama, Documentation Summarizer is a side project I’ve built to explore new technologies and create a tool that’s genuinely useful for developers. It takes a URL, fetches the relevant page, strips out certain parts of the HTML to reduce token count, and provides a concise summary focusing on the most important details. This has been a great opportunity to dive into Retrieval Augmented Generation (RAG) and refine my understanding of system prompting with LLaMA models. I'm sharing this project in the hopes that it might be helpful to others or spark some discussions.
Prerequisites To run Documentation Summarizer, you’ll need the following:
Clone the repository and install the necessary dependencies:
git clone https://github.com/BradyDouthit/documentation-summarizer.git
cd documentation-summarizer
npm install
Ensure that you have Ollama installed and set up, as it’s used to power the LLaMA model for generating the summaries.
To start the app, simply run:
npm run dev
It will launch a local development server at http://localhost:5173, where you can interact with the Documentation Summarizer.
Documentation Summarizer is designed to provide quick, relevant summaries of developer documentation based on user input. Here’s a brief overview of the user experience:
The app implements Retrieval Augmented Generation (RAG) to ensure that the summaries and information it provides are grounded in the actual document fetched from the URL. Instead of relying solely on pre-trained knowledge, the model is fed with data based on what the user deems relevant for the question, which allows it to give more accurate, context-specific responses.
Note: The purpose of this project isn’t to create the best or most beautiful UI out there. While it’s (mostly) functional, it could definitely use some polish from a design perspective. The focus has primarily been on making the backend work well and improving the experience of fetching and summarizing technical content. It also is a project I only work on a little in between work, life, and other passion projects.
The interaction with LLMs is directed by a specialized system prompt that is meant controls the model’s behavior. Here’s a breakdown of the prompt:
The model is instructed to respond only to technical questions related to developer documentation, programming languages, and tools. If provided with references (via XML tags), the model sources information strictly from those references and cites them without improvisation. If the reference data is missing, the model does its best to answer but indicates that the response would be more accurate with additional documentation. The model avoids any mention of the internal reference tags, keeping the process seamless and focused for the user. This strict guidance helps ensure that the model’s responses remain relevant and grounded in the provided documentation. It won’t answer off-topic questions, and it will always refer to the specific documentation when available.
You can view the full system prompt at system-prompt.txt
Documentation Summarizer began as a way for me to challenge myself in experiment with LLM's, system prompts, RAG, and learning a new frontend framework (Svelte). It's not perfect, but it’s been a great learning experience.