# `LlmCore`
[🔗](https://github.com/fosferon/llm_core/blob/v0.3.0/lib/llm_core.ex#L1)

Public facade for LlmCore capabilities.

This is the primary entry point for most LlmCore usage. It delegates to
the routing pipeline, inference pipeline, and Hindsight memory client.

## Sending Prompts

    # Route by task type (configured in TOML [routing.tasks])
    {:ok, response} = LlmCore.send("Explain pattern matching", :reasoning)

    # Stream a response
    {:ok, stream} = LlmCore.stream("Write a GenServer example", :coding)
    Enum.each(stream, &IO.write/1)

    # Extract structured output
    {:ok, response} = LlmCore.send(prompt, :extraction,
      response_format: {:json_schema, %{type: "object", properties: %{...}}}
    )
    response.structured #=> %{"name" => "value"}

## Semantic Memory

    # Store (async, buffered)
    :ok = LlmCore.retain("Key architectural decision", %{context: "architecture"})

    # Recall by meaning
    {:ok, results} = LlmCore.recall("multi-tenancy patterns", bank_id: "my-bank")

    # Synthesize an insight
    {:ok, insight} = LlmCore.reflect("What patterns work best?", bank_id: "my-bank")

## Routing Introspection

    # View current routing table
    table = LlmCore.routing_table()

    # Force reload from config
    :ok = LlmCore.reload_routing()

    # Check Hindsight availability
    LlmCore.hindsight_available?()

# `hindsight_available?`

```elixir
@spec hindsight_available?() :: boolean()
```

Checks if Hindsight API is available and enabled.

# `recall`

```elixir
@spec recall(
  String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, term()}
```

Semantic search for similar content with caching.

# `reflect`

```elixir
@spec reflect(
  String.t() | atom(),
  keyword()
) :: {:ok, term()} | {:error, term()}
```

Natural language reflection/synthesis over a bank's memories.

# `reload_routing`

```elixir
@spec reload_routing() :: :ok
```

Forces the router to reload configuration from disk/store.

# `retain`

```elixir
@spec retain(String.t(), map()) :: :ok
```

Stores content in Hindsight for semantic indexing (async, buffered).

# `retain_sync`

```elixir
@spec retain_sync(String.t(), map()) :: {:ok, map()} | {:error, term()}
```

Stores content synchronously, bypassing the write buffer.

# `route`

```elixir
@spec route(String.t() | atom()) ::
  {:ok, LlmCore.Router.ResolvedRoute.t()} | {:error, term()}
```

Resolves a task type to a configured agent.

# `routing_table`

```elixir
@spec routing_table() :: LlmCore.Router.RoutingTable.t() | nil
```

Fetches the current routing table.

# `send`

```elixir
@spec send(String.t(), String.t() | atom(), keyword()) ::
  {:ok, LlmCore.LLM.Response.t()} | {:error, term()}
```

Sends a prompt through the router using the matching provider.

# `stream`

```elixir
@spec stream(String.t(), String.t() | atom(), keyword()) ::
  {:ok, Enumerable.t()} | {:error, term()}
```

Streams a prompt, returning the provider stream enumerable.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
