I've created an agentic framework to make working ...
# feed
j
I've created an agentic framework to make working with LLMs a breeze! Our company is rewriting our RAG chatbot & AI Agent tasks to use a network of smaller, more focused agents, which seems to be what the broader industry is moving towards. https://github.com/hudson155/osiris-ai Here's a trivial example, but there's more examples in the README!
Copy code
val modelFactory: ModelFactory =
  modelFactory {
    openAiApiKey = ProtectedString("...")
  }

val response = llm(
  model = modelFactory.openAi("gpt-4.1-nano"),
  messages = listOf(
    UserMessage("What's 2+2?"),
  ),
).get()

response.convert<String>()
// 2 + 2 equals 4.
K 2
👀 1
f
I assume this only supports remote LLMs?
j
It's built around Langchain4j, and should support anything and everything that Langchain4j supports! I've only used it with remote LLMs, but it looks like local Ollama & a few more are supported https://docs.langchain4j.dev/integrations/language-models/
The
ModelFactory
part in the example won't work without some adjustments, but in
Copy code
val response = llm(
  model = modelFactory.openAi("gpt-4.1-nano"),
  messages = listOf(
    UserMessage("What's 2+2?"),
  ),
).get()
model =
actually takes an instance of
dev.langchain4j.model.chat.ChatModel
, so you can instantiate that however you wish
h
Have you seen Jetbrains Koog, introduced on this years KotlinConf? It seems to be pretty much the same thing?
j
Oh wow, this looks very promising! I hadn't found this yet. Definitely going to take a good look at it
h
I just looked through your repo and found that you started before they published it. Maybe you inspired them? 🙂
😆 1
j
I'll take credit for that /s
h
Seriously, I think it's cool how similar your example above looks to their "getting started" one
j
yeah, and the agentic example with tools looks even more similar! (screenshot from my repo)
Although I think it's more likely that we were both inspired by https://github.com/openai/openai-agents-python
💡 1