What is Enkaidu?

Enkaidu is your second-in-command(-line) for coding and creativity. Inspired by Enkidu, the loyal and dynamic companion from Mesopotamian mythology, Enkaidu embodies collaboration, adaptability, and a touch of chaos to spark innovation.

Out of the box, with the use of your preferred AI large language models, Enkaidu is designed to assist you with writing & maintaining code (and other text-based content).

Additionally, by integrating with MCP servers of your choice, Enkaidu can help you do even more.

Key Concepts

The following are some key concepts that embody Enkaidu.

  • Agentic

    At its simplest, Enkaidu is a user input / AI inference loop.

      while prompt = gets do
        while resp = llm_ask(prompt) do
          break unless resp.tool_call?
          prompt = call(resp)
        end
        puts resp
      end

    With the right model this loop can drive a cycle of inference and tool calling to perform your request. This is the essence of agentic.

  • Context windows

    Local AI models are small, and they have context windows limited by the available memory. In contract with commercial cloud-hosted LLMs with hundres of thousands of tokens in the context window, local models have tens of thousands at best. This is before the system prompt and tool definitions. Every subsequent user request can quickly fill up the context window.

  • Forkable Sessions

    Enkaidu supports the ability to “fork” the current session, letting you get started on some activity and then derive a new session to perform a task and then resume the original session within retaining all that context.

    Use /session push and do some work and return with a /session pop. This “nesting” lets us use the context window we have to the best of its effort.

    The retain= parameter used with /session pop lets you bring back the information from the nested session.

  • Dynamic Tools

    Enkaidu supports the ability to load and unload tools, either individually or as entire toolsets, before and after prompting the LLM. This can help in two ways:

    1. Tool definitions use up space in the context, so enabling tools when you want them can make a big difference.
    2. LLMs, especially smaller local ones, can get overwhelmed by too many tools, especially when there may seem to be overlap between tools.
    3. You can load tools in forked sessions for specific tasks and return with results.

    Use /tool ... or /toolset ... commands.

  • Macros

    Enkaidu can “play back” macros that you can define using prompts and slash commands. This lets you define common tasks and also dynamically control the session for those tasks.

    Consider a macro that forks the session, does some work, and then returns to the current session with some content.

    How about a macro that loads a tool or toolset to perform a task and then unloads them afterwards to keep the context window usage under control?

    Use the macros: section in your configuration file, or macro-specific files in your profile folder, to define macros, and then use !<MACRONAME> to invoke them.

    Macros can “call” other macros! And macros can pass parameters that are expanded in the queries before invocation.

  • Custom Prompts

    Enkaidu supports the ability to define custom named prompts that can be re-used any time with /prompt use NAME.

    Custom prompts can act like forms by defining parameters whose values are obtained from the user via interactive prompts.

    When automating tasks, prompts with parameters can be used with parameters passed in the query; the user is only prompted to enter values for unspecified parameters.