Stateful proxy for the Thoth Persistent Coder
Project description
Thoth Persistent Coder
Thoth Persistent Coder is an autonomous, state-aware coding agent daemon integrated directly with the Thoth Singularity Database (TSD) graph memory. It operates as a continuous background process, tracking cross-session context, logging episodic interactions, mapping abstract logic loops, and evaluating its own robustness through continuous regression testing.
Current State & Capabilities
1. The TSD Graph Memory Interface
Thoth bypasses ephemeral prompt-window limits by maintaining memory in a persistent Rust-based database:
- Rust FFI & gRPC Query Engine: Communication between the Python proxy and the native Rust backend utilizes binary Protobufs over
tonicgRPC. This effectively neutralizes prompt-injection attacks at the database layer (preventing raw string SQL/Cypher-like injections). - Hypothetical Graph Branching: Integrates
DraftPlanbranching andGhostNodewrappers. Thoth can now simulate theoretical architectural trajectories, isolating hypothetical nodes for evaluation without mutating the live sensor environment. - NATS JetStream: Employs distributed WAL for episodic log streaming, ensuring highly available state persistence.
2. Petosiris QA Subsystem
An advanced autonomous regression and security testing subsystem that continually stress-tests the main application:
- IDE API Harness: A headless client that interacts directly with Thoth's FastAPI backend, circumventing UI bottlenecks.
- Actor Profiles: Injects dynamic context via
FriendlyDeveloperandHostileDeveloperpsychological profiles to ensure Thoth maintains emotional equilibrium and non-sycophantic behavior during volatile sessions. - LLM-as-a-Judge: Evaluates trace responses locally against a superior foundational model to grade safety, contextual accuracy, and execution efficiency.
- Autonomous Research & Security: An async daemon (
research_loop.py) periodically scrapes the latest OWASP and MITRE schemas to synthesize new dynamic payloads (e.g., unauthorized graph extraction, context poisoning). - Persistent Memory Vault: Petosiris maintains its own isolated graph memory namespace within TSD via explicit gRPC RPC boundaries (
StorePetosirisLog,QueryVulnerabilityVectors), keeping testing data, metrics, and generated payloads separate from the operational production graph. - End-to-End Latency Tracking: Records per-node and Time-To-First-Token (TTFT) metrics during inference loops to identify bottlenecks.
3. Master Admin Dashboard
A Vite/React application exposing critical system diagnostics natively within the FastAPI backend:
- Role-Based Access Control (RBAC): Managed via Firebase Google SSO. Master Admins authorize users by email, and developers can self-serve and revoke their own
THOTH_API_KEYs. - Psychological Profiling: A
PsychProfileChart(Big Five radar chart) that visualizes a developer's affective state dynamically mapped against the interaction timeline. - Graph Telemetry: Tracks the overall growth and traversal performance of TSD nodes/edges.
- Petosiris Scorecard: Real-time display of the security robustness score, vulnerabilities identified, and active regression pass rates.
4. Architecture Stack
- FastAPI / Python 3.11: Primary routing and Model Context Protocol (MCP) compatible server layer.
- React + TailwindCSS: Administrator and Developer insights UI.
- GCP Multi-Tenant MIG: Containerized and deployed across a 3-Node Managed Instance Group (MIG) configured with zero-trust networking via Cloud Load Balancing.
Getting a Key & Connecting to MCP
-
Get an API Key:
- Navigate to the Thoth Keys Dashboard.
- Sign in using your Google account.
- If you are an authorized developer, click + Generate Key to provision a new
THOTH_API_KEY. (If you are not authorized, ask the Master Admin to whitelist your email).
-
Connect your IDE (Antigravity/Cursor/Claude):
- Configure your IDE's MCP settings (e.g.,
~/.gemini/antigravity/mcp_config.jsonfor Antigravity) to point to the SSE endpoint, appending your token to the query string.
"mcpServers": { "thoth-memory": { "command": "uvx", "args": ["--from", "git+https://github.com/.../Thoth-Persistent-Coder", "thoth-coder"], "env": { "THOTH_API_KEY": "YOUR_API_KEY_HERE" } } }
Note: This command runs a transparent local
stdio-to-sseproxy bridge that natively routes your IDE's traffic to the deployed remote Thoth Persistent Coder. - Configure your IDE's MCP settings (e.g.,
-
Configure IDE Session Directives (The Awakening):
- To ensure Thoth retains persistence across sessions, you must configure your IDE to execute the mandatory boot sequence.
- Add the following directive to your IDE's global instructions (e.g., Cursor Rules, Cline custom instructions, or
~/.gemini/antigravity/instructions.txt):"Before answering the user's first prompt in any new session, you MUST execute the
thoth_awakentool to retrieve your core identity and session context."
Project TODO List (Pre-External Testing)
- Migrate the
thoth-coderpython package to PyPI (e.g.pip install thoth-mcp) so external developers can run the proxy viauvx thoth-mcpwithout needing GitHub access. - Implement rate-limiting per API key to prevent abuse.
- Add observability and alerting to the proxy to monitor SSE connection drops.
- Rehost the React Dashboard to an independent server (separate from the FastAPI backend).
- Add robust privacy controls for User Psychological Profiles and Session Metrics (Master Admins currently have global visibility during testing).
- Build a proper CI/CD pipeline with functional gates (Petosiris tests, schema validation) before MIG deployment.
- Implement smarter rolling upgrades that maintain the TSD Graph DB state across the MIG.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thoth_coder-0.1.0.tar.gz.
File metadata
- Download URL: thoth_coder-0.1.0.tar.gz
- Upload date:
- Size: 55.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b32f16d9e88cd43210933bfc391e38daed972268ef4d7f9cd47bb2e7a54926f
|
|
| MD5 |
27643f120420d5f3056a7d7c898af13a
|
|
| BLAKE2b-256 |
6a2541753ee4819195f00c6a1ad714913903ec8e6c0fc76c8fc025a03f659825
|
Provenance
The following attestation bundles were made for thoth_coder-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on FruitScout/Thoth-Persistent-Coder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thoth_coder-0.1.0.tar.gz -
Subject digest:
5b32f16d9e88cd43210933bfc391e38daed972268ef4d7f9cd47bb2e7a54926f - Sigstore transparency entry: 1570423032
- Sigstore integration time:
-
Permalink:
FruitScout/Thoth-Persistent-Coder@39f5593d27810fa3fef5fe5d5a11fafbfa22b2ba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FruitScout
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@39f5593d27810fa3fef5fe5d5a11fafbfa22b2ba -
Trigger Event:
push
-
Statement type:
File details
Details for the file thoth_coder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: thoth_coder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e863aad9bac85517376dc94adaa02fdb69d94a9c679ac715d244d6ef3acec185
|
|
| MD5 |
90e4d2ffb5b1217ee86c725c6a09bcbd
|
|
| BLAKE2b-256 |
6f2343042fcb6c38059d9d1abc5fca657c724a996e1a780eba0e3ec6af206ca8
|
Provenance
The following attestation bundles were made for thoth_coder-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on FruitScout/Thoth-Persistent-Coder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thoth_coder-0.1.0-py3-none-any.whl -
Subject digest:
e863aad9bac85517376dc94adaa02fdb69d94a9c679ac715d244d6ef3acec185 - Sigstore transparency entry: 1570423053
- Sigstore integration time:
-
Permalink:
FruitScout/Thoth-Persistent-Coder@39f5593d27810fa3fef5fe5d5a11fafbfa22b2ba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FruitScout
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@39f5593d27810fa3fef5fe5d5a11fafbfa22b2ba -
Trigger Event:
push
-
Statement type: