Minimal JamJet example — one agent, one question, one answer. Java equivalent of hello-agent/.
export OPENAI_API_KEY=sk-... # or any OpenAI-compatible endpointmvn compile exec:javaWith a custom query:
mvn compile exec:java -Dexec.args="How does event sourcing work?"- Builds an
Agentwith Claude Haiku and the react strategy - Compiles to canonical IR and validates it
- Runs the agent against your query via the OpenAI-compatible API
- Prints the answer
Agent.builder()— fluent agent constructionagent.compile()— IR generationIrValidator.validate()— client-side validationagent.run()— in-process execution (no runtime needed)
- Add tools with
@Tool— seejava-research-agent/ - Use workflows instead of agents — see
java-support-bot/ - Submit IR to the runtime — see
java-approval-workflow/