Summarizer
Summarizer is a tool that lets you turn long pieces of text into short, clear summaries. It can produce a quick recap, a detailed overview, bullet‑point highlights, an executive summary, or a custom summary that you define.
How it Works
When you feed text into Summarizer, it first splits the text into manageable chunks (you can set how big each chunk is and how much they overlap). Each chunk is sent to an AI language model that you choose. The model reads the chunk and writes a short summary of it. After all chunks are summarized, the component stitches those mini‑summaries together into one final summary. If you pick the Custom strategy, you can supply your own prompts that tell the AI exactly how to summarize each chunk and how to combine the results.
The component uses the DocAnalyzer helper from Nappai to handle the chunking and summarization logic, so everything runs locally on the server that hosts your Nappai dashboard. No external API calls are made beyond the language model you provide.
Inputs
- Input Data: The text you want summarized. It can be plain text, a Data object, or a Message object.
- Model: The language model that will do the summarizing (e.g., GPT‑4, Claude, etc.).
- Chunk Overlap: How many characters two consecutive chunks should share. A small overlap helps the AI keep context between chunks.
- Chunk Size: The maximum number of characters in each chunk. Larger chunks mean fewer calls to the model but can be slower.
- Custom Chunk Prompt: If you choose the Custom strategy, this prompt tells the model how to summarize each chunk. The default prompt is:
Summarize the following text section clearly and concisely:{text}Summary:
- Custom Final Prompt: Still for the Custom strategy, this prompt tells the model how to combine the chunk summaries into the final summary. The default prompt is:
Combine the following summaries into a comprehensive final summary:{text}Final Summary:
- Summarization Strategy: Pick one of five styles:
- 📄 Concise – a short, to‑the‑point summary.
- 📝 Detailed – an in‑depth recap with extra context.
- 🔹 Bullet Points – key facts listed as bullet points.
- 📊 Executive – a high‑level overview for leaders.
- ⚙️ Custom – use your own prompts for both chunk and final summarization.
Outputs
- Summary: A single Data object that contains the final summary text, the strategy used, how many input items were processed, and the length of the summary.
- Data: A list of Data objects, each holding a summary for one input item. Useful when you want separate summaries for multiple documents.
- Tool: A LangChain Tool that can be reused in other parts of your workflow. It lets you call the summarizer from scripts or other components.
Usage Example
- Drag the Summarizer component onto your dashboard.
- Connect a Text component (or any component that outputs Data) to the Input Data field.
- Choose a language model in the Model field.
- Pick a Summarization Strategy (e.g., Concise).
- (Optional) Adjust Chunk Size and Chunk Overlap if your text is very long.
- Connect the Summary output to a Display component to show the result, or to a Save component to store it.
The component will automatically split the text, ask the model to summarize each part, and then combine the parts into one final summary that appears in the Summary output.
Related Components
- Text Splitter – Manually split text into chunks before summarizing.
- Document Analyzer – Advanced analysis tools that can also summarize.
- Display – Show text or Data objects in the dashboard.
- Save – Store the summary in a database or file.
Tips and Best Practices
- Use Concise for quick overviews and Detailed when you need more context.
- If your text is very long, increase Chunk Size to reduce the number of model calls, but keep it within the model’s token limit.
- For legal or compliance documents, consider using Bullet Points to highlight key clauses.
- When using Custom strategy, keep prompts short and clear; the
{text}
placeholder will be replaced automatically. - Monitor the Tool output if you plan to reuse the summarizer in other workflows; it can be shared across components.
Security Considerations
- All text is processed on the server that hosts your Nappai instance; no data leaves your environment unless you explicitly send it elsewhere.
- If you’re summarizing sensitive documents, ensure the language model you choose complies with your organization’s data‑handling policies.
- The component does not store any intermediate results permanently—only the final summary is kept unless you route it to a storage component.