Self-Hosted Agents That Grow: Architecture and Implementation Practice

    This article explains what a self-hosted, growing agent is and how to build one: an agent that runs in your own environment, keeps working across sessions, and turns successful runs into reusable skills. It covers the limits of chatbots and editor assistants, a capability model built on layered memory, a skill loop, scheduling, multi-channel access, and model abstraction, followed by a six-layer reference architecture, a staged rollout path, security and governance requirements, and the metrics that show whether the agent is actually improving.

    A growing agent is a software system deployed in your own environment that keeps working across sessions and turns successful experience into reusable skills. It is not a single-turn Q&A window on a web page, and it is not a completion assistant bound to an editor. The goal is a digital role that can be scheduled, audited, and handed over — not a disposable chat window.

    Where the problem comes from

    Most enterprise work is not “ask once, answer once.” Daily report rollups, backup verification, environment inspections, ticket triage, and post-release observation all run on a fixed rhythm, yet they are tangled up in project context: directory conventions, approvers, terminology, past incidents. A conventional chat system starts from a blank slate every time, so users have to re-explain the background repeatedly. Coding assistants, in turn, are usually confined to a single-machine editor session and lose continuity the moment you leave the current window.

    A growing agent addresses three things. First, tasks can leave the chat box and execute on servers, in containers, or on remote hosts according to policy. Second, complex reasoning that has already been done should not evaporate; it should become a skill that can be invoked directly next time. Third, people express intent through the messaging tools they already use daily, instead of being forced to open a dedicated console.

    Boundaries with two common kinds of assistants

    Chatbots are good at explanation and generation, but they hold little state, have few tools, and cannot be accountable for external systems. Editor assistants are good at changing code, but their workflow is tied to the interface and the local machine, which makes scheduled inspections and cross-system notifications hard.

    A growing agent sits above both: it has an identity and permissions, tools and sandboxes, memory and a skill library, and it is online by default over the long term. The evaluation criterion is not “is the answer fluent,” but “does this class of task take fewer steps over time, are failures traceable, and can a colleague take over and still follow the same process.”

    Capability model

    1. Long-term memory

    Memory is not dumping every chat log into the context. The practical approach is layering:

    • Working memory: the current task’s goal, constraints, tools already called, and intermediate conclusions. It can be archived when the task ends.
    • Project memory: relatively stable facts such as repository structure, environment differences, release windows, and contact roles. It must be revisable and able to expire.
    • Preference memory: collaboration habits such as output format, risk tolerance, and whether to present a plan before executing.

    Writes need a threshold. Only content confirmed by the user or judged by rules to be a stable fact enters the long-term layers, so a single mistake is not recorded as a “convention.” Retrieval uses “task type + project identifier + time decay” rather than indiscriminate concatenation of history. Sensitive fields (keys, personal data) do not enter memory by default; only their location and the permission requirements are stored.

    2. The skill loop

    A skill compresses one successful piece of reasoning into reusable steps: trigger conditions, inputs and outputs, permitted tools, failure fallback, and acceptance criteria. The flow is: execute a complex task → reflect against the result → extract a reusable pattern → write it into the skill library → on the next similar task, match the skill first, then fine-tune based on feedback.

    Skills should use an open, versionable description rather than being locked inside one interface. When a team shares them, skills go through review just like code: who created it, its applicable boundaries, when it was last verified, and known side effects. “Experience” without acceptance criteria should not be automatically promoted to a skill, otherwise errors get replicated at scale.

    Illustrative structure (independent of any specific product):

    1. name: daily-health-check
    2. when: scheduled, or on user request for an inspection
    3. inputs: [service_list, time_window]
    4. tools: [metrics_query, log_search, notify]
    5. steps:
    6. - pull error rate and latency
    7. - expand logs only when a threshold is exceeded
    8. - output conclusion, evidence, and recommended action
    9. accept: the conclusion can be cross-checked against monitoring data

    3. Scheduling

    Periodic tasks are described in natural language, but underneath they should still compile into explicit schedule records: time zone, frequency, retries, concurrency limits, and a compensation policy for missed triggers. Daily reports, backup checks, certificate expiry reminders, and queue-backlog alerts all belong to this category. The scheduler is separated from the chat runtime, so scheduled jobs do not disappear when the process is restarted by a chat session.

    4. Multi-channel access

    A message gateway connects the same agent to the communication tools the team already uses, instead of building another chat page that only opens in a browser. The gateway does exactly three things: identity mapping, message normalization, and delivery with receipts. Business logic, memory, and skills stay in the core runtime, so changing the entry point does not require rewriting the agent.

    The channel side must handle: who is allowed to issue commands, whether the agent responds by default in group chats, how long-running tasks report progress, and where failure notifications go. “Anyone can make it run commands” without identity binding is not a production design.

    5. Model abstraction

    The reasoning model must be replaceable: cloud APIs or local inference, from different vendors, all exposing capabilities such as “chat, tool calling, embeddings” through a unified adapter layer. Routing can be split by task: high-capability models for summarization, low-cost models for classification and extraction, local models for offline environments. Do not write vendor-specific parameters into the body of a skill, or every skill breaks when the model changes.

    Research- and training-friendly means run traces, tool calls, and skill versions can be exported for evaluation, replaying failures, and offline comparison. Export must be de-identified first.

    Reference architecture

    Bottom-up, it splits into six layers.

    • Runtime environment: physical machines, virtual machines, containers, or remote hosts behind a jump host, responsible for keeping processes resident and isolating resources.
    • Tool layer: file system, terminal, browser, read-only database queries, object storage, message queues, logs, and monitoring. Each tool declares least privilege.
    • Policy layer: permitted directories, an allowlist of executable commands, outbound domains, and caps on spend and call counts.
    • Cognition layer: model routing, planning, reflection.
    • Growth layer: the memory store and skill library, with versioning and audit.
    • Access layer: the scheduler and the message gateway.

    State lives in external storage, not only in process memory, so memory and skills survive container rebuilds and machine migrations. Logs, metrics, and alerts use common observability components: record a summary of the input to each tool call, the result code, the duration, and the associated skill version.

    Rollout order

    Step one: pick a task with clear boundaries that can be verified, for example “summarize yesterday’s error logs on weekday mornings and state whether human intervention is needed.” Get the tool permissions working manually first, then hand it to the agent.

    Step two: fix the memory write rules. Only project facts confirmed by the user go into the store; keys never do.

    Step three: only after three consecutive successes, solidify the steps into a skill and write down the cases where it does not apply.

    Step four: connect one messaging entry point and one scheduled trigger, and observe for a week: how many false triggers, missed reports, and privilege-escalation attempts occurred.

    Step five: only then consider team sharing. Review skills before sharing, and name an owner.

    It is not advisable to open arbitrary terminals, arbitrary outbound internet access, and arbitrary group-chat commands from the start. The growth capability amplifies early permission mistakes.

    Security and governance

    • Identity: separate people, groups, and service accounts; require a second confirmation for high-risk actions.
    • Least privilege: prefer read-only; limit writes to specific directories and change windows.
    • Isolation: treat untrusted input as data, not instructions; do not let tool output enter a privileged context without filtering.
    • Audit: keep a traceable record of who approved which external action and when.
    • Exit: memory can be deleted, skills can be rolled back, and a channel can be disabled with one action.

    The point of self-hosting is that data and the execution environment are under your control; it does not mean “secure by default.” Containers, network policies, and key management still have to be done as ordinary engineering work.

    How to tell whether it is growing

    Look at four kinds of metrics, not just conversation satisfaction. Whether the number of manual follow-up turns for the same class of task is decreasing; whether the first-pass success rate after a skill hit is higher than planning from scratch; whether scheduled-task failures can be localized to a tool, the model, or permissions; and whether a new team member can reproduce the work independently from the skill description, without depending on someone’s chat history.

    If the metrics do not improve, stop automatic skill writes and fix memory pollution and permission noise first. Growth is gated accumulation, not recording all history.

    Summary

    What matters about a growing agent is not a particular model name but whether the loop closes: tasks run long-term in your own environment, facts and preferences are held in layered memory, successful paths settle into reviewable skills, scheduling and messaging entry points put human-agent collaboration back into everyday tools, and the model is replaceable through an adapter layer. Proceed along “single-task validation → memory rules → skill review → channel and scheduling → team sharing,” with permissions, audit, and observability underneath, and “gets better with context over time” turns from a slogan into an engineering capability that can be handed over. When deploying on the cloud, reuse common capabilities such as container platforms, object storage, and logging, monitoring, and alerting to carry the runtime and audit data, and avoid binding the growth mechanism to any single interaction interface.