The Problem with Trusting an Agent to Derive
A physics student asks an LLM to derive the Navier-Stokes equation from first principles. The agent produces eight steps, each plausible, each accompanied by confident prose. The final answer matches the textbook. The student moves on.
Then someone checks step four. The intermediate expression contains a sign error that cancels out three steps later. The derivation is wrong, but the conclusion happens to be right.
This is the friction SymKit MCP was built to address: instead of asking an agent to perform symbolic algebra, delegate the computation to SymPy and verify every step by re-deriving it and checking that the residual reduces to zero. The agent becomes a reasoning layer that decides *what* to derive, while the symbolic engine ensures *correctness*.
SymKit operates as a local MCP server—44 tools covering simplification, solving, differentiation, integration, series expansion, and limits. It maintains a YAML formula library so the agent can retrieve known results rather than guessing, tracks assumptions across global, domain, session, and step scopes, and persists every derivation with full provenance: target, notes, risk flags, and suggested next steps. If a derivation goes off track, `session_rollback(to_step)` truncates the chain and lets you branch from an earlier point.
But MCP is a transport, not a deployment boundary. If you want this capability available to an agent that doesn't run on your desktop—or you want to embed it in a tool, a backend service, or a hosted workflow—you need to rebuild the core logic as a service.
What You Can Build with VicroCode
VicroCode supports run Python online execution, hosted APIs, file management, SQLite databases, and LanceDB vector stores. That's enough to implement a symbolic derivation service without the MCP layer.
Core: A SymPy Engine with Residual Verification
The Python runtime gives you SymPy directly. Write a `/derive` endpoint that accepts a step—source expression, operation (simplify, solve, differentiate, integrate, expand, etc.), and target expression. The engine performs the operation, compares the result to the target, and computes the residual. If the residual simplifies to zero (symbolically or within numerical tolerance for definite integrals), the step is valid. If not, the response flags the mismatch.
Each derivation is a sequence of validated steps. Store them in a SQLite editor-backed session table: session ID, step index, source, operation, target, residual, timestamp, and optional notes. When the agent requests the next step, it sees the full chain so far, not just the last output.
This isn't about stopping the agent from doing algebra—it's about making algebraic claims verifiable. The agent still decides the derivation strategy; the service ensures that each step is mathematically sound.
Formula Library: Searchable Known Results
SymKit's YAML library prevents agents from reinventing the wheel. You can replicate this with a LanceDB knowledge base. Store each formula as a document: name, LaTeX representation, symbolic form, domain (physics, engineering, chemistry, economics), tags, and embedding.
When the agent needs a starting point—say, deriving the heat equation—it queries the library with a description. The vector search returns ranked candidates. The agent picks one, and the derivation begins from a known, correct expression rather than a hallucinated approximation.
You can seed the library with standard results (Maxwell's equations, thermodynamic identities, kinematic formulas) or let users add their own. Each formula becomes a reusable anchor.
Session Management and Rollback
Store each session's state in SQLite: the target (what you're trying to derive), the current step, accumulated assumptions (e.g., "x > 0", "f is continuous"), and a risk score if intermediate steps involve approximations or unverified substitutions.
Rollback is straightforward: delete all steps after a given index and reset the session pointer. The agent can then try a different operation or explore an alternative branch. This turns derivation into an iterative, exploratory process rather than a one-shot gamble.
If a derivation session is valuable, export it: LaTeX for a paper appendix, SymPy code for reproducibility, or JSON for further analysis.
What VicroCode Cannot Own
VicroCode does not provide MCP transport, arbitrary desktop runtime integration, or bidirectional streaming to a Claude Desktop instance. If you need the agent to call your service, the agent must support HTTP tool calls or you must integrate the service into a platform that does (an API gateway, a custom agent framework, or a chat interface that proxies tool invocations).
VicroCode also does not execute languages other than Python. If your derivation logic depends on Mathematica, Maple, or compiled symbolic libraries, you're outside the boundary. SymPy is capable—differential equations, linear algebra, discrete math, special functions—but it is not a replacement for every symbolic system.
Why This Matters
Derivations are not creative writing. A single algebraic error can invalidate an entire proof, and agents are unreliable at multi-step symbolic reasoning. The alternative is not to avoid using agents—it's to use them for what they're good at (deciding strategy, interpreting intent, choosing operations) and delegate correctness to a deterministic system.
This pattern applies beyond math. Agents are strong at selecting tools, weak at executing them perfectly. A hosted symbolic service gives you:
- **Correctness:** Every step is re-derived and verified.
- **Traceability:** Sessions are recorded with full provenance.
- **Recoverability:** Rollback lets you correct mistakes without starting over.
- **Reusability:** A searchable library avoids redundant derivations.
The market evidence shows demand for systems that don't blindly trust LLM output—context management with rollback, memory systems that separate facts from guesses, structured workflows where the agent orchestrates but doesn't execute. SymKit MCP demonstrates the need. A hosted Python service makes it portable.
You're not building a chatbot that does algebra. You're building a service where the algebra is always correct, and the agent decides which algebra to do.