Adding Memory, Tool Use, and Scheduling to General-Purpose LLMs
This article explains how to fill three structural gaps in the standard chat interface of general-purpose LLMs: state, execution, and time. It presents a three-layer architecture built from a browser extension, an orchestration layer, and a local execution service, covering persistent structured memory, a neutral tool description format with risk tiers, cron-based scheduling with isolated sessions, security and privacy boundaries, and a staged rollout path. The enhancement layer is client-side and model-agnostic, so it applies to any LLM service with a web chat interface.
When users complain that a general-purpose LLM “forgets things, cannot take action, and cannot work on schedule,” what is missing is usually not model parameters but the engineering capabilities built around the model. This article takes a neutral view of how a browser extension plus local components can add four baseline capabilities to any online LLM chat interface: memory, tool calling, file handling, and scheduled execution. It also outlines a practical architecture with code examples.
1. Problem Definition: Three Structural Gaps in the Chat Box
Most online LLM products expose a stateless dialog box. Its capability boundary is defined by three gaps.
The first is the state gap. Session context is limited by the context window and is lost when the page closes, so users must restate their preferences, glossary, and output format every time.
The second is the execution gap. The model can only generate text. It cannot search, read a page, read or write files, or invoke system capabilities, so its output still has to be moved around manually.
The third is the time gap. The model runs only when it is asked something, and cannot execute tasks on a recurring basis while unattended.
Closing these three gaps turns the chat box into an assistant you can delegate work to. Note that this is a client-side enhancement layer, independent of the model’s own capabilities, which makes it applicable to any general-purpose model service with a web chat interface.
2. Overall Architecture: Three Separated Layers
Split the system into three layers rather than piling all the logic into a single script.
- UI enhancement layer: injected as a browser extension; detects the input box, renders an additional panel, and intercepts the send action.
- Orchestration and scheduling layer: handles memory retrieval, tool selection, the task queue, and timed triggers. This is the brain of the system.
- Local execution layer: a lightweight service running on the user’s machine, responsible for high-risk actions such as file reads and writes, command execution, and image processing.
The three layers communicate over message channels. The extension and the local service use an authenticated local message protocol, with an auth token generated and stored locally during the initial pairing, so that arbitrary web pages cannot issue calls.
[Chat page] <--injected script--> [Orchestration] <--authenticated messages--> [Local execution service]|+--> [Local storage: memory/outputs/keys]
3. Persistent Memory: From Storing Conversations to Storing Structured Preferences
The naive approach is to stuff the full conversation history back into the context. That hits the limit quickly and introduces noise. A more robust design has three layers.
The first layer is the raw trace, kept locally only, for auditing and replay. It does not participate in default inference.
The second layer is structured memory entries. Each entry contains a type, content, confidence, source, and timestamp, for example:
{"type": "preference","content": "Technical documents use Simplified Chinese; code comments stay in English","confidence": 0.9,"source": "user_explicit","updated_at": "2026-01-10T08:00:00Z"}
The third layer is retrieval and injection. When a new request arrives, run a similarity recall first, then trim the results with the rules “hard preferences first, newer entries first, low-confidence entries down-weighted,” and write only a few of the most relevant entries into the prompt. Context usage stays bounded, and memories do not conflict with each other.
The engineering work should also include a visible memory management UI: view, edit, and delete individual entries, and export everything to a local file in one click. Editable memory is a precondition for trust; memory you cannot see is an uncontrollable black box.
4. Tool Calling: Hiding Differences Behind a Unified Description
Function-calling formats differ across models, so the orchestration layer should define a neutral tool description structure and let an adapter layer convert it into the format the target model expects.
{"name": "fetch_page","description": "Fetch the main text content of a given URL","parameters": {"url": "string","max_chars": "number, default 4000"}}
The tool set should be tiered by risk:
- Read-only: fetching page text, reading tab content, search queries. Allowed by default.
- Write: generating documents, writing to spreadsheets, saving files. Show the target path and require confirmation.
- High-risk: executing system commands, batch-modifying files. Requires explicit authorization and is off by default.
An often overlooked detail is feeding results back. Tool output frequently far exceeds the context budget, so the orchestration layer should truncate and produce a structured summary before returning it to the model, so a single fetch does not exhaust the window.
5. Scheduled Tasks and Isolated Sessions
Scheduling turns the model from “passive responder” into “periodic worker.” Three points matter in implementation.
First, scheduling semantics. Use standard cron expressions to describe the period. The scheduler only triggers and does not do inference; after triggering, it posts to a task queue, where worker processes consume tasks serially or with limited concurrency to prevent pile-up.
Second, session isolation. Each task is bound to its own session identifier and its own memory namespace, so contexts from different tasks do not pollute each other. In practice this matters more than concurrency.
Third, failure handling. Tasks must record status, retry count, and the last error, and provide local logs. In unattended scenarios, observability determines whether the system is actually usable.
schedule: "0 8 * * *"task: Summarize yesterday's information on the specified topicsession: daily-digestretry: 2outputs: ./reports/
6. Security and Privacy Boundaries
The value of this kind of system comes from being local, and so does the risk, so the boundaries must be explicit.
- Keys and memory stay local and never pass through any third-party backend; communication between the extension and the local service requires token authentication and validation of the originating page.
- High-risk tools are off by default; use an allowlist rather than a blocklist, and keep an auditable record of every execution.
- Least privilege: the local service exposes only the interfaces required to complete the task, and file access is restricted to a designated working directory.
- Prompt injection defense: fetched web page content is untrusted input, so mark it explicitly as data rather than instructions in the prompt, and filter out text such as “ignore the previous instructions.”
If multi-user collaboration or cloud hosting is needed, general cloud capabilities can take over: object storage for outputs, a message queue as a task buffer, a container platform to host the executor, and logging plus monitoring and alerting for observability, while maintaining data partitioning and access control.
7. Recommended Rollout Path
Step one: implement memory and export only, and verify the benefit is real. Step two: connect read-only tools and watch how the context budget and accuracy change. Step three: introduce the local execution component and scheduling, and add the audit and authorization UI at the same time. Every step should be reversible: disabling the extension restores the original state.
For developers, the real point of this enhancement layer is to engineer model capabilities: memory solves state continuity, tools solve the ability to act, scheduling solves the time dimension, and localization solves trust. With all four in place, a general-purpose chat model has the foundation to take on real work reliably.
