BasicIntentAnalyzer — Intent analysis (with deception indicators)
BasicIntentAnalyzer is a structured intent-analysis component built on AbstractCore. It can analyze:
Table of Contents
Install Quick start (Python) CLI usage (intent) Interactive chat integration (/intent) Events (optional) Notes- a single text input (
analyze_intent) - a multi-participant conversation (
analyze_conversation_intents)
Deception indicators are always included in the structured output schema.
Install
# Light: every remote provider, plus PDF / Office inputs in the CLI
pip install abstractcore
# Or, for in-process local engines (MLX / vLLM, HuggingFace/GGUF):
pip install "abstractcore[apple]" # Apple silicon
pip install "abstractcore[gpu]" # NVIDIA / AMD
Quick start (Python)
from abstractcore import create_llm
from abstractcore.processing import BasicIntentAnalyzer, IntentContext, IntentDepth
llm = create_llm("openai", model="gpt-4o-mini") # light install
analyzer = BasicIntentAnalyzer(llm)
result = analyzer.analyze_intent(
"I'm struggling to understand this concept and need help.",
context_type=IntentContext.STANDALONE,
depth=IntentDepth.UNDERLYING,
)
print(result.primary_intent.intent_type.value)
print(result.primary_intent.underlying_goal)
print(result.primary_intent.deception_analysis.deception_likelihood)
CLI usage (intent)
The intent CLI analyzes either direct text or a file path:
# Direct text
intent "I need help with this problem" --depth underlying
# File input
intent ./email.txt --context document --depth comprehensive --format plain
# Conversation log input (expects lines like `USER: ...` / `ASSISTANT: ...`)
intent ./chat.txt --conversation-mode --focus-participant user --format plain
# Session archive JSON created via `BasicSession.save(...)` (auto-enables conversation mode)
intent ./saved_session.json --focus-participant user --depth comprehensive --format plain
Key flags
--context:standalone,conversational,document,interactive--depth:surface,underlying,comprehensive--conversation-mode: parse multi-message inputs; use--focus-participantto target a role--provider+--model: override the default app model (must be provided together)--format:json,yaml,plain--timeout: HTTP timeout in seconds (0= unlimited)
Tip: to see every option, run intent --help.
Interactive chat integration (/intent)
The interactive chat CLI (abstractcore-chat) supports /intent to analyze the current conversation state:
abstractcore-chat --provider ollama --model gemma3:1b-it-qat
# In the REPL:
/intent
/intent user
/intent assistant
Events (optional)
You can monitor generations via the global event bus:
from abstractcore.events import EventType, on_global
def monitor(event):
if event.type == EventType.GENERATION_COMPLETED:
duration_ms = event.data.get("duration_ms")
print("generation_completed", duration_ms)
on_global(EventType.GENERATION_COMPLETED, monitor)
Notes
- Long inputs are chunked and combined (map-reduce). Use
--chunk-sizein the CLI (ormax_chunk_sizein Python) to control chunk size. - Output schemas live in
abstractcore/processing/basic_intent.py(IntentAnalysisOutput,IntentType,DeceptionIndicators).