Anyone worked with the LangChain4J SDK, or other LangChain/Clojure work, and want to compare notes? I am using it fairly intensively these days
How come you are using LangChain4J instead of just pure clojure? I feel like langchain makes sense as a DSL/Interface in less elegant languages - but clojure is really fluid for creating prompts and executing multi step agents in. e.g. prompt template and call can be done like this.
(-> "You are a . My Question is: "
(str/replace #"" "What is the capital of france?")
(str/replace #"" "Helppful AI")
(call-llm llm-credentials))
You can call LLMs with just REST (e.g. using Clojure HTTP or Martian Libraries) or a dedicated wrapper like https://github.com/wkok/openai-clojure/tree/main. There's also https://github.com/zmedelis/bosquet which provides tools for building Clojure AI agents.My prototype was in langchain python and I was trying to reduce the amount of work :) I think I just increased it tho
If it's not a huge codebase - I'd be tempted to refactor/rewrite.
worth discussing at #clojurellm probably
Ah that's probably the right one, thanks 🙂