LLM Mobility Agentο
Status: Operational. Provider-backed planners are implemented and tested (mocked provider β no live calls in CI). Runs in deterministic
echomode by default; set one environment variable to use a real LLM.
What it isο
A tool-using conversational layer over the decision platform. The agent does not make decisions β the platformβs policies do. The agent renders, explains, and answers operational questions by calling platform tools:
Tool |
What it runs |
Evaluation type |
|---|---|---|
|
Decision engine β |
simulation |
|
Historical-average demand estimate |
historical replay |
|
Finite-demand multi-agent simulator rollout |
simulation |
|
Stored benchmark / shadow-evaluation artifacts |
offline |
Designο
src/agents/llm_agent.pyβMobilityAgent+_EchoPlanner.src/agents/planners.pyβ provider-backed planners +planner_from_env.src/agents/__init__.pyβ public exports.tests/test_llm_agent.pyβ 11 tests, no network, no API key.tests/test_planners.pyβ 12 tests against a mocked provider (no live calls).
Every planner speaks the same seam: planner(prompt, tool_names) -> {"tool": str, "arguments": dict}. The tools stay untouched when swapping planners.
Honesty contractο
Every tool call returns a labeled evaluation_type (simulation,
historical_replay, offline). The agentβs answer cites tool output verbatim
and never fabricates metrics. Nothing produced here is production or A/B
evidence.
Providersο
Planner |
SDK / transport |
Model |
|---|---|---|
|
|
|
|
|
|
Provider SDKs are imported lazily, so echo mode stays dependency-free.
Planners never fall back silently: without a key they raise, and
planner_from_env() is the intended βflip by env varβ entry point.
Wire a providerο
Set one environment variable β no code change:
# Preferred: Anthropic
export ANTHROPIC_API_KEY=sk-...
python -c "from src.agents import MobilityAgent, planner_from_env; \
print(MobilityAgent(planner=planner_from_env(), model='claude-sonnet-5').handle('simulate two_step 20 drivers').answer)"
# Or any OpenAI-compatible endpoint (OpenAI, vLLM, Ollama...)
export OPENAI_API_KEY=sk-...
Without either key the agent runs in deterministic echo mode.
Runο
python -c "from src.agents import MobilityAgent; a = MobilityAgent(); print(a.handle('simulate two_step').answer)"