Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2026-04-25 - LLM API Connection Pooling
**Learning:** Making repeated API calls to external LLM providers (e.g. OpenRouter, OpenAI) without HTTP Keep-Alive results in 100-200ms of unnecessary TCP/TLS handshake overhead per request. In an agentic loop, this accumulates significantly.
**Action:** When initializing HTTP clients (like Axios) for repeated internal/external services, configure them with an `https.Agent` setting `keepAlive: true` to pool connections.
## 2024-03-24 - [In-memory Query Caching for SearchTool]
**Learning:** [Repeated agentic queries in the deep search tool created an architectural bottleneck, wasting API calls/time.]
**Action:** [Implemented an in-memory Map cache in `SearchTool.deep` nested inside the `this.core.execute` wrapper. The wrapper ensures that cache hits return valid ExecutionResults and preserves standardized logging and retry logic without redundant search execution.]
12 changes: 11 additions & 1 deletion src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,31 @@ export class FileTool {
}

export class SearchTool {
// ⚑ Bolt: Cache search results to prevent redundant agentic queries and save time/resources
private cache = new Map<string, any>();

constructor(private core: CoreEngine) {}

async deep(query: string): Promise<ExecutionResult<any>> {
this.core.log(`Initiating deep search for: ${query}`);
// This is where real API calls to Google/X/Reddit would go
return this.core.execute(async () => {
if (this.cache.has(query)) {
this.core.log(`⚑ Bolt: Returning cached result for query: ${query}`);
return this.cache.get(query);
}

// Simulated results for the SDK base
return {
const result = {
query,
timestamp: new Date().toISOString(),
findings: [
"Best practices for " + query,
"Trending solutions in 2026"
]
};
this.cache.set(query, result);
return result;
});
}
}