Module: Insika::DSL

Defined in:
lib/insika/dsl.rb,
lib/insika/dsl/system.rb,
lib/insika/dsl/runtime.rb,
lib/insika/dsl/definition.rb,
lib/insika/dsl/server_boot.rb,
lib/insika/dsl/workflow_adapter.rb

Overview

Public Ruby DSL — the OSS "business card":

agent = Insika.agent("assistant") do
model "deepseek-v4-flash"
instructions "You are a concise, friendly assistant."
end
puts agent.reply("hi, what can you do?")   # one turn, in-process
agent.serve                                # control UI + /v1 on :9292

It is THIN SUGAR that GENERATES the data (a Insika::Pack), never a bypass of config-over-code (COMPETITIVE-ANALYSIS). Insika.agent { … }.to_pack is the same portable artifact the PackImporter consumes at runtime — the DSL and a hand-written pack produce the SAME profile (the parity spec proves it), because BOTH go through the standard import → StoredProfileSource round-trip.

Nothing here loads ruby_llm or the HTTP server: require "insika" stays light. The runtime (chat/serve) is pulled in lazily by Definition (dsl/runtime.rb).

Defined Under Namespace

Classes: Builder, Definition, Runtime, ServerBoot, System, SystemBuilder, WorkflowAdapter

Class Method Summary collapse

Class Method Details

.agent(id, &block) ⇒ Object

Insika.agent("id") { … } → Definition (see #agent below on the module).



27
28
29
# File 'lib/insika/dsl.rb', line 27

def agent(id, &block)
  Builder.new(id).build(&block)
end

.embed(backend:, &block) ⇒ Object

Insika.embed(backend:) { … } → System (see #embed below on the module).



37
38
39
# File 'lib/insika/dsl.rb', line 37

def embed(backend:, &block)
  SystemBuilder.new.build(backend: backend, &block)
end

.system(&block) ⇒ Object

Insika.system { agent("a") { … }; agent("b") { … } } → System.



32
33
34
# File 'lib/insika/dsl.rb', line 32

def system(&block)
  SystemBuilder.new.build(&block)
end