AI agent harness for small language models
Find a file
2026-03-02 13:17:36 +01:00
memory Auto-commit: 2026-02-17 23:48 - Heartbeat update 2026-02-17 23:48:30 +01:00
src Update server, filesystem tools, Docker config 2026-03-02 13:17:36 +01:00
.env.example Update server, filesystem tools, Docker config 2026-03-02 13:17:36 +01:00
.gitignore Add .gitignore, remove node_modules from tracking 2026-02-25 10:04:43 +01:00
config.json Fix tool call parsing, use minimax-m2:cloud model 2026-02-25 09:52:22 +01:00
docker-compose.yml Update server, filesystem tools, Docker config 2026-03-02 13:17:36 +01:00
Dockerfile Update server, filesystem tools, Docker config 2026-03-02 13:17:36 +01:00
package-lock.json Add API server for Open WebUI integration 2026-02-26 23:16:31 +01:00
package.json Add API server for Open WebUI integration 2026-02-26 23:16:31 +01:00
README.md Initial commit: agent harness for SLMs 2026-02-17 13:15:00 +01:00
soul.json Auto-commit: 2026-02-17 23:48 - Heartbeat update 2026-02-17 23:48:30 +01:00
tsconfig.json Initial commit: agent harness for SLMs 2026-02-17 13:15:00 +01:00
user.json Auto-commit: 2026-02-17 23:48 - Heartbeat update 2026-02-17 23:48:30 +01:00

Agent Harness

AI agent harness for small language models (SLMs) with a lightweight tool calling protocol.

Overview

A minimal, token-efficient agent loop designed for SLMs (3B-8B parameters). Built on Ollama for local inference.

Architecture

┌─────────────────────────────────────┐
│           Tool Registry             │
│  (definitions + execution engine)  │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│         Prompt Composer             │
│  (system + tools + history + query) │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│        Model Backend (Ollama)       │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│        Output Parser                │
│   (extract tool calls / responses)  │
└─────────────────────────────────────┘

Quick Start

npm install
npm run dev

Configuration

Edit config.json to set:

  • model: Ollama model to use
  • tools: Enabled tools
  • maxIterations: Max tool calls per turn
  • ollamaUrl: Ollama endpoint

Tool Protocol

Tools are defined as JSON schemas:

{
  "name": "filesystem_read",
  "description": "Read contents of a file",
  "parameters": {
    "type": "object",
    "properties": {
      "path": { "type": "string", "description": "File path to read" }
    },
    "required": ["path"]
  }
}

Model outputs tool calls in this format:

<tool_call>
{"name": "filesystem_read", "arguments": {"path": "/etc/hosts"}}
</tool_call>

Available Tools

  • filesystem_read - Read files
  • filesystem_write - Write files
  • bash - Execute shell commands
  • web_search - Search the web (Brave API)
  • memory_search - Query persistent memory

License

MIT