altra's profile picture
altra

web-search-advanced

Public

969 Downloads

1 star

README

Web Search Advanced Plugin

A streamlined web search plugin designed for minimal context usage while delivering relevant, up-to-date answers.

๐ŸŽฏ Design Philosophy

This plugin was redesigned to solve the "context bloat" problem:

OriginalOptimized
21 tools7 tools
~10KB system prompt~500 bytes
Verbose outputsCompact JSON
Multiple similar toolsMerged tools

๐Ÿš€ Tools (7 total)

ToolPurposeParameters
searchGeneral search + read pagesq, n (1-6), time
deepMulti-angle parallel researchtopic, angles[]
verifyFact-check with verdictclaim
fetchRead specific URLurl, max
newsRecent news searchq, time, n
academicSearch papersq, source, year
citeGenerate citationurl, format

๐Ÿ“Š Context Savings

System Prompt

Before: ~10,000 characters (21 tool descriptions + rules)
After:  ~500 characters (concise rules + tool summary)

Tool Descriptions

Before: Each tool 200-500 chars description
After:  Each tool 50-100 chars description

Output Format

// Before (verbose)
{
  "query": "...",
  "total_results_found": 10,
  "pages_read": 3,
  "independent_publishers_read": 2,
  "pages_read_content": [...],
  "additional_snippets": [...],
  "instruction": "Synthesize across ALL angles..."
}

// After (compact)
{
  "q": "...",
  "found": 10,
  "read": 3,
  "publishers": 2,
  "results": [{ "t": "Title", "u": "url", "c": "high", "text": "..." }],
  "tip": "Cross-reference claims"
}

โš™๏ธ Configuration

SettingDefaultDescription
Max Results8Results per query
Fetch Timeout8000msPage load timeout
Time WindowyearDefault recency
Cache TTL30 minResults cache time
Cache Size50Max cached entries

๐Ÿ”„ Usage Examples

{ "q": "latest AI regulations 2024", "n": 3, "time": "month" }

Deep Research

{ "topic": "quantum computing applications", "angles": ["healthcare", "finance", "security"] }

Fact Check

{ "claim": "90% of startups fail in first year" }

Get Citation

{ "url": "https://arxiv.org/abs/2401.xxxxx", "format": "apa" }

๐ŸŽ“ Citation Formats

FormatOutput
APAAuthor (Year). Title. Domain. URL
MLA"Title." Domain, Year. URL
ChicagoAuthor. "Title." Year. URL
IEEE[Author, "Title," Domain, Year. [Online]. Available: URL

๐Ÿ“ Files

web-search-advanced-plugin/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts              # Entry point
โ”‚   โ”œโ”€โ”€ config.ts             # Configuration
โ”‚   โ”œโ”€โ”€ toolsProvider.ts      # All tools
โ”‚   โ”œโ”€โ”€ promptPreprocessor.ts # System prompt
โ”‚   โ””โ”€โ”€ donations.ts          # Supporter system
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ add-supporter.js      # Add supporters CLI
โ”œโ”€โ”€ manifest.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ DONATE.md                 # How to support

๐Ÿ”ง Installation

cd ~/.lmstudio/plugins/
git clone <repo> web-search-advanced-plugin
cd web-search-advanced-plugin
npm install && npm run build

๐Ÿ’ก Key Optimizations

  • Merged Tools: search_recent โ†’ search with time param
  • Compact Outputs: Short keys (t, u, c instead of title, url, credibility)
  • Minimal System Prompt: Rules in ~500 chars instead of ~10KB
  • Smart Caching: Avoids redundant searches
  • Inline Credibility: No separate credibility assessment tool

๐Ÿ“ˆ Performance

MetricBeforeAfterImprovement
System Prompt~10KB~0.5KB95% smaller
Tool Count21767% fewer
Avg Output~2KB~0.8KB60% smaller
Context Window UsageHighLowMuch more room for reasoning

๐Ÿ’š Support Development

This plugin is free and open source. If you find it useful, consider supporting development:

Ko-fi
TierAmountPerks
โ˜• Coffee$3Name in credits
๐Ÿ” Lunch$10+ Priority support
๐Ÿ• Pizza$25+ Name in README
๐Ÿ† Founding$50+ Lifetime support, consultation

Every coffee helps keep this project alive! โ˜•

๐Ÿงช Testing

npm test

๐Ÿ“ License

MIT