Skip to content
Back to skills

Logic Adapters

ASecurity

"Configure ChatterBot logic adapters, response selection,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentspythongosqldjangoapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill logic-adapters --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Logic Adapters?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Logic Adapters
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-logic-adapters/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-logic-adapters)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: logic-adapters
description: "Configure ChatterBot logic adapters, response selection,
  comparison methods, custom adapters, MCP tool adapters, and experimental
  Ollama/OpenAI LLM adapters."
disable-model-invocation: true
metadata:
  disco-role: operating
license: BSD 3-Clause
---

# Logic Adapters

Use this sub-skill when a task asks how ChatterBot chooses a response, how to configure built-in logic adapters, how to add a custom adapter, why confidence values behave a certain way, or how experimental Ollama/OpenAI adapters expose deterministic adapters as tools.

## Quick route

1. Read [references/logic-api.md](references/logic-api.md) for verified adapter signatures, parameters, and response-selection surfaces.
2. Read [references/workflows.md](references/workflows.md) for concrete BestMatch, default response, math/time/unit conversion, specific response, custom adapter, and LLM-tool recipes.
3. Read [references/troubleshooting.md](references/troubleshooting.md) for optional dependencies, missing `model`, provider/service failures, invalid adapter dicts, and confidence surprises.
4. Run [scripts/logic_adapter_demo.py](scripts/logic_adapter_demo.py) for deterministic math/time/specific/default/unit adapter smoke checks.

## Built-in adapters

| Adapter | Use for | Notes |
| --- | --- | --- |
| `BestMatch` | find learned responses from storage | default adapter; uses search + response selection |
| `SpecificResponseAdapter` | exact or matcher-triggered canned response | requires `input_text` and `output_text` |
| `MathematicalEvaluation` | natural-language or symbolic math | uses `mathparse`; also exposes `calculate` as a tool |
| `TimeLogicAdapter` | current time questions | uses spaCy phrase matching; also exposes current time as a tool |
| `UnitConversion` | natural-language unit conversion | requires `pint`; exposes `convert_units` as a tool |
| `OllamaLogicAdapter` | experimental local/remote Ollama responses | requires `model`, client package, and an Ollama service |
| `OpenAILogicAdapter` | experimental OpenAI-compatible responses | requires `model`, client package, and credentials/base URL |

## Adapter configuration pattern

Use import paths or config dictionaries:

```python
from chatterbot import ChatBot

bot = ChatBot(
    "Logic Bot",
    logic_adapters=[
        {
            "import_path": "chatterbot.logic.BestMatch",
            "default_response": "I am sorry, but I do not understand.",
            "maximum_similarity_threshold": 0.90,
        },
        {
            "import_path": "chatterbot.logic.SpecificResponseAdapter",
            "input_text": "Help me!",
            "output_text": "Read the support guide.",
        },
    ],
)
```

If multiple adapters can process a statement, ChatterBot returns the response with the highest confidence, with special handling when multiple adapters agree on the same statement.

## Boundaries

- For `ChatBot` lifecycle, `Statement`, taggers, and search classes, use [core-chatbot](../core-chatbot/SKILL.md).
- For training data that powers `BestMatch`, use [training](../training/SKILL.md).
- For SQL/Mongo/Redis storage behavior used by search, use [storage-adapters](../storage-adapters/SKILL.md).
- For Django-specific adapter usage, use [django-integration](../django-integration/SKILL.md).

Files in this skill

  • SKILL.md3.2 KB
  • references/logic-api.md4.1 KB
  • references/troubleshooting.md3.3 KB
  • references/workflows.md5 KB
  • scripts/logic_adapter_demo.py3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.