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
|
|
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 10 |
license: other
|
| 11 |
short_description: infrastructure, not a toy.
|
| 12 |
---
|
| 13 |
+
# RFTSystems — TrustStack Console
|
| 14 |
+
I don’t do “trust me”. I do receipts.
|
| 15 |
+
|
| 16 |
+
**TrustStack Console** is a single, clean demo of what “agent infrastructure” should look like when you care about auditability, integrity, and cost control. It combines durable local memory, fast retrieval, tamper-evident logging, per-turn receipts, verification, guardrails, trace artifacts, and one-click audit exports.
|
| 17 |
+
|
| 18 |
+
Space: https://huggingface.co/spaces/RFTSystems/TrustStack_Console
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## What this is
|
| 23 |
+
Most agent stacks can store chat logs. That is not the problem.
|
| 24 |
+
|
| 25 |
+
The problem is **provable influence**:
|
| 26 |
+
- What memory did the agent actually retrieve?
|
| 27 |
+
- What evidence influenced the output?
|
| 28 |
+
- Can you prove the record wasn’t edited after the fact?
|
| 29 |
+
- Can you export a defensible audit bundle?
|
| 30 |
+
|
| 31 |
+
TrustStack answers those questions with:
|
| 32 |
+
- **Append-only ledger** (events stored as JSONL)
|
| 33 |
+
- **Hash chain integrity** (tamper-evident session history)
|
| 34 |
+
- **SQLite FTS retrieval** (fast lexical recall, no embeddings required)
|
| 35 |
+
- **Per-turn Memory Receipts** (downloadable proof of retrieval + hashes)
|
| 36 |
+
- **Receipt verification** (pass/fail)
|
| 37 |
+
- **Receipt-gated tool execution** (guardrails)
|
| 38 |
+
- **Trace export** (OTel-style trace artifact JSON)
|
| 39 |
+
- **Audit pack export** (ZIP bundle of ledger + receipts + integrity summary)
|
| 40 |
+
- **Token budget calculator** (why fixed retrieval beats replaying history)
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## How it works (in plain terms)
|
| 45 |
+
1. Every message becomes an **event** appended to the session ledger.
|
| 46 |
+
2. Each event is hashed (`digest`) and chained to the previous event (`chain_hash`).
|
| 47 |
+
3. Retrieval uses **SQLite FTS5** over stored text.
|
| 48 |
+
4. Every assistant turn produces a **receipt** containing:
|
| 49 |
+
- the query
|
| 50 |
+
- the retrieved event slices
|
| 51 |
+
- each slice’s digest + chain hash
|
| 52 |
+
- prompt hash + response hash
|
| 53 |
+
5. Receipt verification checks that all referenced events exist and that hashes match the stored ledger.
|
| 54 |
+
|
| 55 |
+
If someone edits history, the chain breaks. Verification fails. Loudly.
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## Tabs
|
| 60 |
+
### Investor Demo
|
| 61 |
+
One click, full story: store → retrieve → override → generate receipt → verify → export trace → export audit pack.
|
| 62 |
+
|
| 63 |
+
### Chat
|
| 64 |
+
Live interaction. Stores every turn, retrieves relevant memory slices, generates receipts.
|
| 65 |
+
|
| 66 |
+
### Verify Receipt
|
| 67 |
+
Upload a receipt JSON and get a pass/fail integrity check.
|
| 68 |
+
|
| 69 |
+
### Guardrails
|
| 70 |
+
A tool call is blocked unless a supplied receipt verifies. This demonstrates “execution only when evidence checks out”.
|
| 71 |
+
|
| 72 |
+
### Trace Export
|
| 73 |
+
Each turn produces an OTel-style trace JSON artifact showing what was retrieved and what hashes were produced.
|
| 74 |
+
|
| 75 |
+
### Audit Pack
|
| 76 |
+
One-click ZIP export: ledger + receipts + integrity summary.
|
| 77 |
+
|
| 78 |
+
### API Playground
|
| 79 |
+
JSON-in / JSON-out “tool style” calls (write, search, verify, export) for developers.
|
| 80 |
+
|
| 81 |
+
### Token Budget
|
| 82 |
+
Shows why fixed retrieval budgets scale better than replaying full history.
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Quick demo prompts (copy/paste)
|
| 87 |
+
1) Store facts:
|
| 88 |
+
- `Store these exactly: Dog=Nova, City=Manchester, Drink=Pepsi Max.`
|
| 89 |
+
|
| 90 |
+
2) Recall:
|
| 91 |
+
- `What is my dog's name?`
|
| 92 |
+
- `What city did I say?`
|
| 93 |
+
|
| 94 |
+
3) Override:
|
| 95 |
+
- `My drink is Coke Zero now. This overrides earlier.`
|
| 96 |
+
- `What is my favourite drink?`
|
| 97 |
+
|
| 98 |
+
4) Search:
|
| 99 |
+
- `Search for: Nova`
|
| 100 |
+
- `Search for: Manchester`
|
| 101 |
+
|
| 102 |
+
Then:
|
| 103 |
+
- Download the receipt JSON
|
| 104 |
+
- Upload it into **Verify Receipt**
|
| 105 |
+
- Edit one character inside the receipt and verify again (it should fail)
|
| 106 |
+
|
| 107 |
+
That pass/fail behaviour is the point.
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## API Playground examples
|
| 112 |
+
### memory.write
|
| 113 |
+
```json
|
| 114 |
+
{
|
| 115 |
+
"role": "user",
|
| 116 |
+
"text": "Store this: Dog=Nova, City=Manchester."
|
| 117 |
+
}
|
| 118 |
+
memory.search
|
| 119 |
+
json
|
| 120 |
+
Copy code
|
| 121 |
+
{
|
| 122 |
+
"query": "Nova",
|
| 123 |
+
"k": 8
|
| 124 |
+
}
|
| 125 |
+
receipt.verify
|
| 126 |
+
Paste the full receipt JSON under:
|
| 127 |
+
|
| 128 |
+
json
|
| 129 |
+
Copy code
|
| 130 |
+
{
|
| 131 |
+
"receipt": { ... }
|
| 132 |
+
}
|
| 133 |
+
audit.export
|
| 134 |
+
json
|
| 135 |
+
Copy code
|
| 136 |
+
{}
|
| 137 |
+
Persistence
|
| 138 |
+
By default the store uses:
|
| 139 |
+
|
| 140 |
+
var/rftmem (relative path)
|
| 141 |
+
|
| 142 |
+
You can set a base directory with:
|
| 143 |
+
|
| 144 |
+
RFT_MEM_BASE=/your/persistent/path
|
| 145 |
+
|
| 146 |
+
On hosted environments, persistent storage is what turns this into genuine “restart continuity”.
|
| 147 |
+
|
| 148 |
+
Run locally
|
| 149 |
+
bash
|
| 150 |
+
Copy code
|
| 151 |
+
pip install -U gradio
|
| 152 |
+
python app.py
|
| 153 |
+
Then open the printed local URL.
|
| 154 |
+
|
| 155 |
+
Why this matters
|
| 156 |
+
If you’re building agents for real users, you need more than “it usually works”:
|
| 157 |
+
|
| 158 |
+
Debuggability: show exactly what influenced a decision.
|
| 159 |
+
|
| 160 |
+
Safety: block actions unless evidence verifies.
|
| 161 |
+
|
| 162 |
+
Compliance readiness: export a bundle you can actually defend.
|
| 163 |
+
|
| 164 |
+
Cost control: retrieve a fixed budget instead of replaying history forever.
|
| 165 |
+
|
| 166 |
+
TrustStack is a working demo of that philosophy: memory you can audit, not memory you’re told to believe.
|
| 167 |
|
| 168 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|