AI Agent Hub
Back to plugins
🧠

dsh-environment-context

Memory Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install liqiming-whu/dsh-environment-context

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install liqiming-whu/dsh-environment-context in a terminal to install the plugin; the full source is available at https://github.com/liqiming-whu/dsh-environment-context. After installation, restart the DSH Web Host and open the Environment Context page in the settings panel to configure it.

About this plugin

In a DeepSeek Harness conversation, the model knows nothing about the user's immediate surroundings: the time of day, the weather outside, which city they are in, or how much battery is left on their phone. These details matter a lot in role-playing or atmosphere-driven dialogues, yet DSH does not provide them out of the box. dsh-environment-context solves this by injecting time, weather, location, battery, and device information through DSH's native systemPrompt.section() mechanism. No chat messages are created and no per-turn context nodes accumulate, so the conversation timeline stays clean.

The plugin registers a dedicated Environment Context page inside the DSH settings panel where every field can be toggled independently: time and day-of-week, weather conditions, temperature, feels-like, humidity, wind speed, location via manual city entry or browser Geolocation, battery level and charging state, system device name and model, and a custom device label. Weather sources fall back in a strict order of Open-Meteo, MET Norway, then wttr.in; reverse geocoding follows Nominatim, BigDataCloud, then Photon. Cache keys include the provider and parameters to prevent cross-source mixing. On a failed refresh the plugin reuses the same-key stale cache and marks it as such, while a battery failure explicitly reports unavailability rather than serving an old value.

Language handling is fully automatic: if the browser preferred locale starts with zh the output is Chinese, otherwise it is English. Weather, wind direction, and location lookups are requested and cached separately per language to avoid mixing. Device information is gathered through the DSH host's Node os module and Windows CIM interfaces without relying on User-Agent strings. Battery and device summaries live only in the current host's memory and vanish on restart; nothing is written to persistent storage.

One important caveat: dynamic environment values change the system-prompt prefix on every refresh or settings update, which can reduce prompt-cache hit rates at the model provider, increase latency, and affect cache-billing discounts. The plugin is therefore best suited to role-playing scenarios that genuinely benefit from a real-time environmental atmosphere. For stability-first tasks such as coding, documentation, or long-form sessions, it is recommended to keep it disabled.

Use Cases

  • Inject real-time weather, location, and time into role-play for immersive atmosphere
  • Reflect current battery level, charging state, and device model dynamically in chat
  • Auto-switch between Chinese and English injection based on browser locale

Best For

  • Role-players seeking immersive conversational atmosphere
  • Creators building environmental awareness into RP scenarios
  • Developers exploring DSH dynamic system-prompt plugins