Core Concepts
Constellations splits into a common foundation (tools and types) and core orchestration (the agent loop).
Common vs core
| Layer | Module | What you get |
|---|---|---|
| Common | constellations-common | ToolDispatcher, Value / Struct / Schema, encoders/decoders, messages |
| Core | constellations-core | Executor, Memory, Invoker, Handling, Similarity |
Start with ToolDispatcher if you only need to expose Scala methods as LLM tools. Add core when you want a multi-step conversation loop with memory.
constellations-common
+--------------------------+
| ToolDispatcher + types |
+------------^-------------+
|
User -> Invoker -> Handling --+--> ToolDispatcher -> your F[_] methods
| |
v |
Executor <-- Memory ----+
|
v
continue chat...
Key abstractions
- ToolDispatcher — macro-generated tool routing (common)
- Values & schemas / Encoding — shared data model (common)
- Messages — chat + tool messages (common)
- Executor — orchestrates steps with memory (core)
- Memory — stores conversation history (core)
- Invoker — calls the LLM (core + providers)
- Handling — parses model responses into text / tool calls (core + providers)
Type safety
Effects are expressed with Cats Effect:
import cats.effect.IO
import cats.effect.std.Console
val program: IO[Unit] =
Console[IO].println("Hello from Constellations!")
Schema generation
Traits used with ToolDispatcher.generate get JSON schemas and declarations from method signatures and docstrings. Parameter type schemas are built through ToSchema.schemaWith(config) (same derivation path as standalone Schema.derived, with the dispatcher's Configuration applied to member names), so @llmHint, field docstrings, and custom given ToSchema[...] instances apply — see Values & schemas.
Learn more
- Common: ToolDispatcher, Encoding & decoding, Observability
- Core: Executor, Memory, Invoker, Handling
- Providers: OpenRouter, Google GenAI