# Reasoning

## ReasoningEngine

::: aifastdb.ReasoningEngine

LLM-based reasoning engine connecting to Ollama or OpenAI APIs.

!!! note
    Requires the `http-client` Cargo feature to be enabled at build time.

```python
from aifastdb import ReasoningEngine

# Ollama (local)
engine = ReasoningEngine.ollama("llama3.2")

# OpenAI
engine = ReasoningEngine.openai("sk-...", "gpt-4o-mini")

# Methods
result = engine.understand_intent("What's the weather?")
is_consistent = engine.check_logic("A implies B", "B is true")
summary = engine.summarize("Long text...", max_tokens=100)
response = engine.chat([{"role": "user", "content": "Hello"}])
```
