Skip to content

Sophia NLU Engine - Define and Query Selectors

Sophia's selector system empowers you to effortlessly define and match custom phrases for any topic or question, using a simple directory structure and advanced interpretation—no coding skills required.

How It Works

Sophia’s selector system offers powerful, flexible phrase matching and response categorization with these key capabilities:

  • Easily create and import selectors using a simple directory structure—place phrases in plain text files, no technical expertise needed
  • Advanced phrase interpreter and algorithm for highly accurate matching with confidence scoring
  • Optional LLM fallback using either a local Ollama install or one of 8 integrated API providers (e.g., OpenAI, Mistral)
  • Benefit from automatic response caching and progressive self-improvement of matching accuracy

Example Use Case

LLM Fallback Integration

Enhance selector performance with optional LLM integration, tailored to your setup:

  • Connect to a local Ollama installation with any model
  • Integrate with one of 8 supported API providers (e.g., OpenAI, Mistral)
  • Leverage LLMs for automated selector phrase creation, expanding your phrase library effortlessly
  • Automatic caching of LLM responses for faster future queries

Implementation

Get started quickly with Sophia’s intuitive selector import and query process:

  1. Create selectors using a directory structure with plain text files (one phrase per line)
  2. Import via shared library: import_selectors(dirname)
  3. Query using: assess(input, selector_alias)