The Agent Loop

The "brain" of seekr is a sophisticated implementation of the ReAct (Reasoning and Acting) pattern. While natively optimized for DeepSeek's high-reasoning models, it fully supports multiple LLMs via OpenAPI structured integrations.

The Reasoning Loop

  1. Input: The agent receives a task and its current system prompt.
  2. Plan (NEW): Before executing any tools, the agent MUST output an explicit PLAN: block. This improves reliability by forcing the agent to reason through its next steps before acting.
  3. Reasoning: It analyzes the task, previous actions, and observations.
  4. Action: It selects one or more tools and provides the necessary arguments. seekr leverages multi-tool parallelism to execute independent actions concurrently.
  5. Observation: The results of the tool executions are fed back into the agent's context.

System Prompts

seekr uses carefully crafted system prompts that define its capabilities, limitations, and "personality". These prompts enforce explicit planning, parallel multi-tasking, and background execution for long-running commands.

Memory Management

As the conversation grows, seekr manages its token context using a sophisticated Sliding-Window Memory system. When the context threshold is reached (e.g., 40 messages), the agent automatically uses an internal Summarization Loop to condense the oldest parts of the conversation into a "working memory" block. This keeps the agent's context window lean while ensuring it never loses track of the overall goal or critical file paths discovered earlier in the session.

Back to Introduction