# Building Browser Workflows with PKT & Kagi
## Wiring live search and summarization directly into client-side browser packets.

Once I had access to Kagi's developer endpoints, the natural next step was integrating them into my daily research workflow using **PKT**.

Instead of opening dozens of tabs and manually copying text back and forth, a browser packet can orchestrate research workflows seamlessly:

```javascript
// Quick helper to summarize the active tab using Kagi
async function summarizeCurrentPage(pageUrl, apiKey) {
  const response = await fetch('https://kagi.com/api/v0/summarize', {
    method: 'POST',
    headers: {
      'Authorization': `Bot ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: pageUrl,
      summary_type: 'takeaway',
      engine: 'cecil'
    })
  });
  
  const data = await response.json();
  return data.data.output;
}
```

### The Power of PKT Tab Groups + Kagi:
1. **Context Retention**: Group related documentation, source repos, and API explorers into a single named packet (`.pkt`).
2. **On-Demand Briefings**: Trigger summaries on any tab without leaving your workspace.
3. **Zero Bloat**: All state is retained in your browser extension, synchronized cleanly with no extra background overhead.

🔗 **Official Resources:**
- [Kagi API Key Portal](https://kagi.com/settings?p=api)
- [PKT Browser Extension Guide](https://wildcard.cx/pkt/integration.md)
