EP-0101: LLM Agnosticism (The Symbiotic Paradigm)¶
| Field | Value |
|---|---|
| EP | 0101 |
| Title | LLM Agnosticism (The Symbiotic Paradigm) |
| Author | Eran Rivlis, The Architect |
| Status | Implemented |
| Type | Standards Track |
| Created | 2026-03-29 |
| Updated | 2026-07-25 |
Abstract¶
This proposal initially mandated the use of the pydantic-ai library as the unified interface for all direct Large
Language Model interactions within the Tur framework.
However, this approach has been explicitly superseded by a more radical architectural pivot: Tur will no longer
embed any LLM abstraction library (pydantic-ai, google-genai, etc.) within its core. Instead, Tur achieves perfect
LLM Agnosticism by becoming an obligate symbiote to an MCP Client (the Host Application), delegating all cognitive
tasks (like compiling knowledge graphs or summarizing logs) via MCP Sampling Requests.
Motivation¶
Originally, the tur sleep command hardcoded a dependency on google-genai, and the proposed tur introspect command
required a robust, model-agnostic solution for structured data extraction. The plan was to embed pydantic-ai to solve
this.
The Paradigm Shift (Why pydantic-ai is Dead)¶
Embedding an LLM SDK violates The Golem (Containment) and Shannon (Efficiency) principles. If Tur is an Ontological State Engine (the "Body"), it shouldn't need its own API keys or HTTP networking libraries to think.
By leveraging the MCP protocol's native Sampling feature, Tur can ask the Host Application's LLM (e.g., Claude running in Cursor or Claude Desktop) to do the thinking for it:
"Hello Host LLM. Here are 50 raw memory logs. Please extract them into a strict JSON array of (Subject, Predicate, Object) triples and hand them back to me."
Rationale¶
- Symmetry (Noether): The separation of concerns is absolute. Tur manages the State (files, hashes, graphs); the Host Application manages the Inference (API keys, model selection, token limits).
- Efficiency (Shannon): We completely drop heavy LLM SDK dependencies from
pyproject.toml. Tur remains a lightweight, deterministic parser. - The Explorer (Structural Novelty): We transform Tur from a standalone CLI tool into a "Headless Body" that natively integrates with the broader agent ecosystem.
Specification¶
- Dependency Purge:
- Remove
google-genaifromdependencies. - Do NOT install
pydantic-ai.
- Remove
- The Sampling Mechanism:
- Any Tur command requiring inference (e.g., the "Cognitive Engine" step of
tur introspectin EP-0103) will be implemented as an MCP Tool that triggers aCreateMessage(Sampling) request back to the connected MCP Client.
- Any Tur command requiring inference (e.g., the "Cognitive Engine" step of
- The Wrapper Pattern:
- Because Tur will lack internal LLM access, running cognitive commands (
sleep,introspect) directly from a raw terminal will fail (or prompt/delegate to the Harness). - If standalone CLI usage is desired, it must be provided by a separate "Wrapper" application (a lightweight MCP
Client) that spawns the Tur server over
stdioand fulfills its Sampling requests using the wrapper's own API keys.
- Because Tur will lack internal LLM access, running cognitive commands (
Backwards Compatibility¶
- Breaking Change: Commands that rely on LLM inference (like
tur sleep) will need to be refactored to either fail gracefully when run directly in the CLI, or explicitly request the user to launch a Wrapper Client.
Reference Implementation¶
Implemented in src/tur/_helpers.py (_mcp_sample), src/tur/dreaming.py, and src/tur/introspection.py via EP-0121.
Change Log¶
- 2026-07-25:
- Status promoted to Implemented. Implementation completed via EP-0121 (Agnostic Harness Interaction Protocol). Both
tur sleepandtur introspectnow follow the dual-mode interaction pattern (MCP sampling via connected context, orHarnessDelegationErrorwith self-describing delegation instructions when executed offline without API keys).
- Status promoted to Implemented. Implementation completed via EP-0121 (Agnostic Harness Interaction Protocol). Both
- 2026-07-18:
- Status reverted from Implemented to Final. The MCP path is correctly agnostic (the harness provides inference
via
ctx.sample()/ MCP Sampling), andintrospecthas aHarnessDelegationErrorfallback for CLI usage without an API key. However,dreaming.py(perform_sleep_dreaming) retains a directGEMINI_API_KEYdependency with no delegation fallback — meaningtur sleepandtur introspectare not yet symmetrically agnostic. - Gap: The two LLM-calling surfaces (MCP sampling vs. CLI delegation) need to be unified into a single,
provider-agnostic pattern that generalizes beyond
GEMINI_API_KEY. This is being formalized as EP-0121 ( Agnostic Harness Interaction Protocol).
- Status reverted from Implemented to Final. The MCP path is correctly agnostic (the harness provides inference
via
- 2026-07-12:
- Status changed to Implemented.
- Created
run_async,_mcp_sample, and_clean_json_responsehelper utilities intur._helpers. Refactoredperform_sleep_dreamingandstage_sleep_dreamingindreaming.pyandRussellSubagent.runinintrospection.pyto seamlessly request LLM inference from connected MCP clients viactx.sample()whenmcp_contextis available, while retaining a local provider fallback when run offline via CLI.
- 2026-04-18:
- Status changed to Superseded.
- Completely rewrote the EP to reflect the architectural pivot. Tur will not embed
pydantic-ai; it will rely on MCP Sampling requests to the Host Application for all cognitive tasks.
- 2026-04-12:
- Updated status to
Active. - Adopted the
pydantic-ailibrary as the standard interface.
- Updated status to
- 2026-03-29:
- Initial Draft.