No description
  • C# 94.4%
  • HTML 2.7%
  • CSS 1.9%
  • JavaScript 0.6%
  • Dockerfile 0.2%
  • Other 0.2%
Find a file
Jason Couture 7e5fc76284
All checks were successful
Build/Push Containers / prepare (push) Successful in 34s
Build/Push NuGet Packages / pack & push (push) Successful in 45s
Test & Report Coverage / build & test (push) Successful in 2m30s
Build/Push Containers / llamashears @ 1.0.603-pre (llamashears) (push) Successful in 2m36s
fix: Support overriding nuget host
2026-06-11 17:19:52 -04:00
.github fix: Support overriding nuget host 2026-06-11 17:19:52 -04:00
.husky chore(husky): replace test/docs hooks with echoes and add commit-msg linter 2026-05-09 14:59:50 -04:00
agents docs: rename remaining INDEX.md files to index.md 2026-05-06 15:13:37 -04:00
analyzers style: remove all of the extra bullshit claude decided to add for no good fucking reason 2026-05-18 18:36:27 -04:00
docs feat(agent): add IPromptedAgentSpawner shared transient sub-agent launcher 2026-05-24 21:52:01 -04:00
samples/HelloWorld.LlamaShears.Plugin chore: strip prose // comments from HelloWorldPlugin.cs 2026-05-08 18:08:48 -04:00
src refactor(mcp): consolidate filesystem tools into single FileTools class 2026-05-24 23:53:47 -04:00
tests test(agent): centralize agent start-wait helper across all five fixtures 2026-05-25 00:48:36 -04:00
tooling/LlamaShears.DocsBuild style: remove all of the extra bullshit claude decided to add for no good fucking reason 2026-05-18 18:36:27 -04:00
.dockerignore chore(docker): Add docker related files to .dockerignore 2026-05-08 12:17:42 -04:00
.editorconfig chore(editorconfig): disable IDE0090 target-typed new suggestion 2026-05-10 12:43:03 -04:00
.gitignore chore(gitignore): Added the new C# dev kit vscode per-project cache file 2026-05-16 13:07:06 -04:00
CLA.md docs(cla): drop the inapplicable nonprofit/bylaws covenant 2026-05-06 13:38:00 -04:00
CLAUDE.md chore: Update top level agent instructions with instructions redirecting to the agents file. 2026-05-06 13:38:00 -04:00
COMMERCIAL.md docs: add COMMERCIAL.md describing dual-licensing model and revenue intent 2026-05-06 13:38:00 -04:00
compose.yaml build(docker): drop redundant Paths__DataRoot from compose 2026-05-06 13:38:05 -04:00
CONTRIBUTING.md docs(contributing): document src/public/ scope, samples/, tooling/, and the integration-tests split 2026-05-07 09:58:35 -04:00
Directory.Build.props docs(adr): ADR-0025 disable CA1822 repo-wide 2026-05-09 11:45:08 -04:00
Directory.Build.targets feat(docsbuild): add MSBuild task that emits Markdown API docs from XML docs 2026-05-06 14:33:59 -04:00
docker-bake.hcl build(bake): add docker-bake.hcl with optional .override.hcl 2026-05-06 13:38:05 -04:00
Dockerfile build(docker): factor sdk-base out of prepare + build stages 2026-05-11 01:35:54 -04:00
dotnet-tools.json build(docker): use dotnet-subset to cache the restore layer 2026-05-08 11:12:57 -04:00
GEMINI.md chore: Update top level agent instructions with instructions redirecting to the agents file. 2026-05-06 13:38:00 -04:00
global.json feat: initial project scaffolding 2026-05-06 13:38:00 -04:00
LICENSE.md docs: add LICENSE.md (AGPL-3.0-or-later) 2026-05-06 13:38:00 -04:00
LlamaShears.slnx refactor(claudesucks): fix test references 2026-05-19 19:11:15 -04:00
mkdocs.yml ci(docs): publish docs/ to GitHub Pages with mkdocs-material 2026-05-06 14:47:35 -04:00
PRINCIPLES.md docs(principles): file ADR-0016..0021 under the existing principle categories 2026-05-07 09:58:35 -04:00
README.md docs: catch up README + design docs through the PR #36-#44 chain (#45) 2026-05-07 21:10:35 -04:00
TASKS.md docs(compaction): preserve trailing user-turn cluster up to 25% 2026-05-11 02:10:16 -04:00
version.json chore(nbgv): install nbgv required components/config 2026-05-06 15:53:45 -04:00

LlamaShears

CLA assistant License: AGPL v3

An agentic hosting application for running unattended, automated agent tasks. The goal is a self-driving runtime where agents tick on a schedule, accumulate memory, retrieve relevant context, call external tools, and act without human intervention beyond initial configuration.

This is early-stage work. The substrate (event bus, persistence, memory + sqlite-vec RAG, MCP, agent loop, Blazor chat UI, plugin SDK chassis) is real and exercised by tests. The autonomous side — heartbeat firing, multi-LLM-provider support, channel adapters beyond the bundled UI — is partially in place; the Status table is the source of truth on what runs end-to-end today.

Scope

LlamaShears is a host, not an agent. It runs agents you configure and provides the surrounding infrastructure they need to operate continuously:

  • Heartbeat-driven execution. Agents are scheduled by a heartbeat tick rather than invoked imperatively. The system tick is wired today; per-agent heartbeat firing from HEARTBEAT.md is not.
  • Persistent context — JSON-lines files on disk for conversation turns; archive on compaction is mv current.json <unix-ms>.json.
  • Self-healing RAG memory — agent-owned markdown under memory/, with a sqlite-vec-backed vector index (via Microsoft.Extensions.VectorData) that reconciles against the filesystem on a schedule.
  • Model Context Protocol (MCP) tools — the host exposes its own MCP server (filesystem and memory tools) and dispatches outbound calls to user-configured MCP servers; tool names are source-prefixed (server__tool) and standardized as <category>_<action> on the bundled set.
  • Provider-agnostic LLM access — Ollama and OpenAI-compatible (/v1/chat/completions — vLLM, llama-server, LM Studio, …) are the shipping chat providers; an in-process ONNX embeddings provider (all-MiniLM scope) ships alongside them. The abstraction lives in LlamaShears.Core.Abstractions.Provider and per-agent provider options layer over host defaults.
  • Plugin SDK + host loader. LlamaShears.Plugins is the contract a plugin compiles against; LlamaShears.Plugins.Host and the StrangeSoft.Plugins.* pair carry the assembly-load-context chassis, host-shared type unification, transactional DI snapshot, and deferred-logger plumbing. See samples/HelloWorld.LlamaShears.Plugin for the minimum viable plugin shape.
  • Per-agent JSON config — model, embedding model, MCP server allow-list, tool turn limit, heartbeat period, optional memory prefetch.
  • Server-rendered Blazor chat UI — interactive turns over the same event bus the rest of the system speaks; auto-reload on terminal Blazor circuit reconnect failure.

Status

Area State
System tick Implemented. SystemTickService publishes host:tick on the event bus every 30s; SystemTickOptions.Enabled controls it.
Heartbeat Config-only. AgentConfig.HeartbeatPeriod exists; nothing reads it yet — HEARTBEAT.md is not delivered to the agent on tick.
Agent loop Implemented. Channel-fed, single-threaded per agent, with batching, eager parallel tool dispatch during model streaming, per-batch memory enrichment, optional pre-prompt memory prefetch, and a configurable tool turn limit.
Persistence Implemented. JsonLineContextStore writes turns to <Context>/<agentId>/current.json; archives are renamed to <unix-ms>.json on compaction.
Context compaction Implemented. Auto-compacts when token estimate plus predict budget would exceed the model's context window; eager compactor force-compacts after 15 min of agent idle. Tool-call/result preservation is on the followup list (see TASKS.md).
LLM providers Ollama (chat) + OpenAI-compatible (chat) + ONNX (embeddings, in-process). The OpenAI provider speaks /v1/chat/completions and /v1/models, so it covers any OpenAI-compatible local server (vLLM, llama-server, LM Studio, TabbyAPI, …) with a free-form ExtraRequestParams blob for vendor knobs. Per-agent provider options layer over host defaults; IProviderFactory.Name and IEmbeddingProviderFactory.Name select between registered providers.
Slash commands Implemented. DI-discovered ISlashCommand/ISlashCommandRegistry from LlamaShears.Core.Abstractions.Commands. Bundled commands: /clear, /archive, /compact, /restart (graceful host re-spawn / non-zero exit for container supervisors), /interrupt (cancels the agent's in-flight turn while preserving persisted context).
Cron Stub. Tool surface (cron_schedule/list/edit/cancel/trigger) and JsonCronStore landed; CronExecutor subscribes to system:tick and fires due jobs, but FireSingleAsync only logs a stub today instead of driving the agent. Gated on the channel see/unsee model — see TASKS.md.
Memory & RAG Implemented. Markdown files under <workspace>/memory/YYYY-MM-DD/<unix-seconds>.md, SHA-256-keyed SQLite index at <workspace>/system/.memory.db via Microsoft.Extensions.VectorData + sqlite-vec. Index auto-rebuilds on vector-dimension mismatch; matched memories are injected as first-line summaries.
Memory reconciliation Implemented. MemoryIndexerBackgroundService walks every agent on a configured interval (default 30 min) and reconciles the index against disk.
MCP integration Implemented. Host MCP server mounted at /mcp with bearer auth; built-in tools cover filesystem and memory under <category>_<action> names; user-configured outbound servers are dispatched via LoopbackBearerHandler, with persistent McpClient connections pooled per server.
Plugin SDK Chassis implemented. IPlugin contract + locator surface (IPluginLocator<T> / PluginInformation / Plugin orchestrator), per-plugin AssemblyLoadContext with host-shared type unification, deferred logger that flushes after DI is built, sample HelloWorld plugin. NuGet-source loading is followup.
API host Implemented. ASP.NET Core 10 host (LlamaShears) with Razor Components + interactive server render mode, NerdBank.GitVersioning for build versioning, Dockerfile + compose for sandboxed runs.
Blazor chat UI Implemented. Server-rendered chat with streaming message/thought/tool fragments, scoped CSS, no inline JS where C# can do the job, auto-reload on terminal circuit-reconnect failure, server-side reject of reconnects during shutdown so Ctrl+C exits promptly.
Desktop / mobile / TUI Not implemented. Blazor server is the only UI today; followups tracked in TASKS.md.

Building and running

dotnet build
dotnet test

The project targets .NET 10. The shipping host is src/LlamaShears (dotnet run --project src/LlamaShears for a local Kestrel run); configuration lives in src/LlamaShears/appsettings.json. Default data root is ~/.llama-shears/ — override Paths:DataRoot (or any of WorkspaceRoot, AgentsRoot, TemplatesRoot, ContextRoot) in configuration to relocate it.

Agents are configured by dropping <agent-id>.json into <Data>/agents/. Minimum schema:

{
  "model": { "id": "OLLAMA/llama3.1:latest" },
  "mcpServers": ["llamashears"]
}

See docs/design/agent-config.md for the full schema.

Licensing

LlamaShears is licensed under AGPL-3.0-or-later. Individuals, hobbyists, freelancers, small operators, and anyone who can comply with AGPL terms are welcome to use it without a commercial license.

A separate commercial license is available for parties whose use case is incompatible with AGPL — see COMMERCIAL.md for the rationale, intent, and inquiry path. The dual-licensing setup is a defense against the well-documented pattern of large companies free-riding on open source. The intent is to stop predatory corporate behavior, not to extract money from individual users or contributors.

Contributing

Contributions are welcome. The first-time contribution flow:

  1. Read CONTRIBUTING.md for repository layout, code style, build/test expectations, and commit conventions.
  2. Sign the Contributor License Agreement when prompted by the CLA Assistant bot on your first PR.
  3. Open a PR.

The CLA exists so the project can offer commercial licenses to companies that need them. It does not change your rights to your own contributions or imply any compensation arrangement; the full reasoning is in COMMERCIAL.md.

Most style and policy is enforced as hard compile errors by the in-tree analyzers under analyzers/. The accepted decisions and rationale are documented as ADRs under docs/adr/.

Documentation