flowscript-agents 0.2.5__tar.gz → 0.2.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/PKG-INFO +197 -22
  2. flowscript_agents-0.2.7/README.md +512 -0
  3. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/lifecycle.md +54 -1
  4. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/examples/CLAUDE.md.example +13 -7
  5. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/__init__.py +3 -1
  6. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/audit.py +39 -4
  7. flowscript_agents-0.2.7/flowscript_agents/explain.py +410 -0
  8. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/mcp.py +213 -17
  9. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/tool-integrity.json +3 -2
  10. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/pyproject.toml +1 -1
  11. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_audit.py +146 -0
  12. flowscript_agents-0.2.7/tests/test_explain.py +412 -0
  13. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_mcp.py +137 -4
  14. flowscript_agents-0.2.5/README.md +0 -337
  15. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/.github/workflows/test.yml +0 -0
  16. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/.gitignore +0 -0
  17. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/AUDIT_TRAIL_DESIGN.md +0 -0
  18. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/adapters.md +0 -0
  19. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/api-reference.md +0 -0
  20. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/audit-trail.md +0 -0
  21. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/brand/logo-512.png +0 -0
  22. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/brand/social-preview.png +0 -0
  23. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/docs/flowscript-demo.png +0 -0
  24. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/examples/langgraph_live_test.py +0 -0
  25. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/examples/temporal_e2e_test.py +0 -0
  26. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/camel_ai.py +0 -0
  27. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/crewai.py +0 -0
  28. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/__init__.py +0 -0
  29. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/_utils.py +0 -0
  30. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/consolidate.py +0 -0
  31. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/extract.py +0 -0
  32. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/index.py +0 -0
  33. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/providers.py +0 -0
  34. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/embeddings/search.py +0 -0
  35. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/google_adk.py +0 -0
  36. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/haystack.py +0 -0
  37. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/langgraph.py +0 -0
  38. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/llamaindex.py +0 -0
  39. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/memory.py +0 -0
  40. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/openai_agents.py +0 -0
  41. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/pydantic_ai.py +0 -0
  42. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/query.py +0 -0
  43. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/smolagents.py +0 -0
  44. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/types.py +0 -0
  45. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/flowscript_agents/unified.py +0 -0
  46. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/scripts/validate_dedup_threshold.py +0 -0
  47. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/conftest.py +0 -0
  48. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_camel_ai.py +0 -0
  49. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_consolidation.py +0 -0
  50. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_crewai.py +0 -0
  51. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_embeddings.py +0 -0
  52. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_google_adk.py +0 -0
  53. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_haystack.py +0 -0
  54. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_langgraph.py +0 -0
  55. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_llamaindex.py +0 -0
  56. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_memory.py +0 -0
  57. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_openai_agents.py +0 -0
  58. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_pydantic_ai.py +0 -0
  59. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_smolagents.py +0 -0
  60. {flowscript_agents-0.2.5 → flowscript_agents-0.2.7}/tests/test_temporal.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowscript-agents
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Complete agent memory: reasoning queries + vector search + auto-extraction. Decision intelligence for LangGraph, CrewAI, Google ADK, OpenAI Agents SDK, Pydantic AI, smolagents, LlamaIndex, Haystack, and CAMEL-AI.
5
5
  Project-URL: Homepage, https://flowscript.org
6
6
  Project-URL: Repository, https://github.com/phillipclapham/flowscript-agents
@@ -68,13 +68,13 @@ Description-Content-Type: text/markdown
68
68
 
69
69
  <h1 align="center">flowscript-agents</h1>
70
70
 
71
- <p align="center"><strong>Agent memory that tracks why you decided, what conflicts, and what's blocked. Not just what was said.</strong></p>
71
+ <p align="center"><strong>Your AI agents make decisions they can't explain. FlowScript makes those decisions queryable.</strong></p>
72
72
 
73
- [![Tests](https://img.shields.io/badge/tests-581%20passing-brightgreen)](https://github.com/phillipclapham/flowscript-agents) [![PyPI](https://img.shields.io/pypi/v/flowscript-agents)](https://pypi.org/project/flowscript-agents/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://pypi.org/project/flowscript-agents/)
73
+ <p align="center">Drop-in adapters for 9 agent frameworks. Plain text in, typed reasoning queries out.<br>Hash-chained audit trail. Structural compliance. MIT licensed.</p>
74
74
 
75
- ---
75
+ [![Tests](https://img.shields.io/badge/tests-584%20passing-brightgreen)](https://github.com/phillipclapham/flowscript-agents) [![PyPI](https://img.shields.io/pypi/v/flowscript-agents)](https://pypi.org/project/flowscript-agents/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://pypi.org/project/flowscript-agents/)
76
76
 
77
- Plain text in. Typed reasoning queries out:
77
+ ---
78
78
 
79
79
  ```python
80
80
  from openai import OpenAI
@@ -92,18 +92,19 @@ with UnifiedMemory("agent-memory.json", embedder=OpenAIEmbeddings(), llm=llm) as
92
92
  mem.add("PostgreSQL gives us rich queries at $15/month but read latency is 10-50ms")
93
93
 
94
94
  tensions = mem.memory.query.tensions()
95
- # → TensionsResult(1 tension, axes=['cost vs budget'])
96
- # The LLM detected the $200/month vs $50/month contradiction
97
- # and preserved both sides as a queryable tension
95
+ # → The LLM detected the $200/month vs $50/month contradiction
96
+ # and preserved both sides as a queryable tension — not a deletion
98
97
 
99
- blocked = mem.memory.query.blocked()
100
- # BlockedResult(0 blockers)
98
+ # Pick any node to trace its reasoning:
99
+ first_node = mem.memory.nodes[0]
100
+ why = mem.memory.query.why(first_node.id)
101
+ # → Full causal chain backward from any decision
101
102
 
102
- why = mem.memory.query.why(node_id)
103
- # → CausalAncestry: full chain backward from any node
103
+ blocked = mem.memory.query.blocked()
104
+ # → What's stuck + downstream impact
104
105
  ```
105
106
 
106
- Five queries that no vector store can answer — `why()`, `tensions()`, `blocked()`, `alternatives()`, `whatIf()` — over a typed semantic graph. Drop-in adapters for [9 agent frameworks](#works-with-your-stack). Hash-chained audit trail. And when memories contradict, we don't delete the old one — we create a queryable *tension*.
107
+ Five queries that no vector store can answer — `why()`, `tensions()`, `blocked()`, `alternatives()`, `whatIf()` — over a typed reasoning graph. Drop-in adapters for [9 agent frameworks](#works-with-your-stack). Hash-chained audit trail. And when memories contradict, we don't delete — we create a queryable *tension*.
107
108
 
108
109
  <p align="center">
109
110
  <img src="docs/flowscript-demo.png" alt="FlowScript — editor with .fs syntax, D3 reasoning graph, and tensions query results" width="800">
@@ -113,11 +114,11 @@ Five queries that no vector store can answer — `why()`, `tensions()`, `blocked
113
114
 
114
115
  ## Why FlowScript
115
116
 
116
- Agent memory stores what happened. FlowScript stores why.
117
+ Every agent framework gives AI agents memory. None of them make that memory queryable.
117
118
 
118
- Most agent infrastructure is converging on authorization identity, access control, audit trails for *who did what*. That's necessary. But it leaves a gap: your agent can prove it was *allowed* to make a decision, but not *why* it made it. Researchers call this "[strategic blindness](https://arxiv.org/abs/2603.18718)" memory that tracks content without tracking reasoning.
119
+ Vector stores retrieve content that looks similar. That's useful, but it's not reasoning. When an auditor asks "why did your agent deny that claim?" or a developer asks "what breaks if we change this decision?" similarity search returns a guess. FlowScript returns the actual typed reasoning chain.
119
120
 
120
- FlowScript sits above your memory store, not instead of it. Google Memory Bank, LangGraph checkpointers, Mem0 — they remember what your agent stored. FlowScript remembers why it decided, what it traded off, and what breaks if you change your mind.
121
+ This is the gap researchers call "[strategic blindness](https://arxiv.org/abs/2603.18718)" — memory that tracks content without tracking reasoning. FlowScript sits above your memory store, not instead of it. Mem0, LangGraph checkpointers, Google Memory Bank — they remember what your agent stored. FlowScript remembers *why it decided*, what it traded off, and what breaks if you change your mind.
121
122
 
122
123
  ---
123
124
 
@@ -337,15 +338,58 @@ result = Memory.verify_audit("agent.audit.jsonl")
337
338
  # → AuditVerifyResult(valid=True, total_entries=42, files_verified=1)
338
339
  ```
339
340
 
340
- Framework attribution is automatic — every audit entry records which adapter triggered it. Query by time range, event type, adapter, or session. Rotation with gzip compression. `on_event` callback for SIEM integration. [Full audit trail docs →](docs/audit-trail.md)
341
+ Framework attribution is automatic — every audit entry records which adapter triggered it. Query by time range, event type, adapter, or session. Rotation with gzip compression.
342
+
343
+ **SIEM integration:** `on_event` callback fires for every audit entry. Use `on_event_async=True` for non-blocking dispatch — slow webhooks won't block agent operations:
344
+
345
+ ```python
346
+ from flowscript_agents import Memory, MemoryOptions, AuditConfig
347
+
348
+ def send_to_siem(entry):
349
+ requests.post("https://siem.example.com/ingest", json=entry)
350
+
351
+ mem = Memory.load_or_create("agent.json", options=MemoryOptions(
352
+ audit=AuditConfig(on_event=send_to_siem, on_event_async=True)
353
+ ))
354
+ ```
355
+
356
+ Events are dispatched in order (single worker thread). Callback failures log to stderr but never block audit writes. Call `writer.close()` for graceful shutdown of in-flight callbacks.
341
357
 
342
358
  ---
343
359
 
344
- ## Memory That Evolves
360
+ ## Session Lifecycle — How Memory Gets Smarter
361
+
362
+ Just like a mind needs sleep to consolidate memories, your agent's reasoning graph needs regular session wraps to develop intelligence over time. Without consolidation cycles, knowledge accumulates as noise instead of maturing.
363
+
364
+ **Temporal tiers** — nodes graduate based on actual use:
365
+
366
+ | Tier | Meaning | Behavior |
367
+ |:-----|:--------|:---------|
368
+ | `current` | Recent observations | May be pruned if not reinforced |
369
+ | `developing` | Emerging patterns (2+ touches) | Building confidence |
370
+ | `proven` | Validated through use (3+ touches) | Protected from pruning |
371
+ | `foundation` | Core truths | Always preserved |
345
372
 
346
- Nodes graduate through four temporal tiers based on actual use — `current` → `developing` → `proven` → `foundation`. Every query touches returned nodes, so knowledge that keeps getting queried earns its place. One-off observations fade naturally. Dormant nodes are pruned to the audit trail — archived with full provenance, never destroyed.
373
+ Every query touches returned nodes knowledge that keeps getting queried earns its place. One-off observations fade naturally. Dormant nodes are pruned to the audit trail — archived with full provenance, never destroyed.
347
374
 
348
- After 20 sessions, your memory is a curated knowledge base, not a pile of notes. [Session lifecycle details →](docs/lifecycle.md)
375
+ **Three ways session wraps happen:**
376
+
377
+ 1. **Explicit** — the LLM calls the `session_wrap` tool when you say "let's wrap up" (best results)
378
+ 2. **Auto-wrap** — after 5 minutes of inactivity, the MCP server auto-consolidates (safety net, configurable via `FLOWSCRIPT_AUTO_WRAP_MINUTES`, set to `0` to disable)
379
+ 3. **Process exit** — when the MCP server shuts down, a final consolidation runs automatically
380
+
381
+ **For SDK users** — adapters support context managers that auto-wrap:
382
+
383
+ ```python
384
+ from flowscript_agents.langgraph import FlowScriptStore
385
+
386
+ with FlowScriptStore("agent-memory.json") as store:
387
+ # work happens — all mutations auto-save
388
+ store.put(("agents",), "key", {"value": "data"})
389
+ # close() fires automatically → session_wrap() + save
390
+ ```
391
+
392
+ After 20 sessions, your memory is a curated knowledge base, not a pile of notes. [Full lifecycle details →](docs/lifecycle.md)
349
393
 
350
394
  ---
351
395
 
@@ -363,6 +407,8 @@ Both the Python and [TypeScript](https://www.npmjs.com/package/flowscript-core)
363
407
 
364
408
  ## Comparison
365
409
 
410
+ Every agent framework gives AI agents memory. None make that memory auditable, typed, or queryable at the reasoning level. That's the layer FlowScript occupies.
411
+
366
412
  | | FlowScript | Mem0 | Vector stores |
367
413
  |:---|:---|:---|:---|
368
414
  | Find similar content | Vector search | Vector search | Vector search |
@@ -375,7 +421,128 @@ Both the Python and [TypeScript](https://www.npmjs.com/package/flowscript-core)
375
421
  | Temporal graduation | Automatic 4-tier | — | — |
376
422
  | Token budgeting | 4 strategies | — | — |
377
423
 
378
- Under the hood: a local semantic graph with typed nodes, typed relationships, and typed states. Queries traverse structure — no embeddings required, no LLM calls, no network. Sub-ms on project-scale graphs. Vector search and reasoning queries are orthogonal — use both.
424
+ Under the hood: a local semantic graph with typed nodes, typed relationships, and typed states. Queries traverse structure — no embeddings required, no LLM calls, no network. Sub-ms on project-scale graphs.
425
+
426
+ Vector search and reasoning queries are orthogonal — use both. Mem0 for retrieval, FlowScript for reasoning. They're different architectural layers.
427
+
428
+ ---
429
+
430
+ ## Enterprise & Compliance
431
+
432
+ FlowScript's typed reasoning chains are also compliance-ready audit infrastructure. This isn't a separate product — it's a structural property of how FlowScript works.
433
+
434
+ **EU AI Act coverage:**
435
+
436
+ | Requirement | Article | How FlowScript satisfies it |
437
+ |:---|:---|:---|
438
+ | Record-keeping | Art. 12 | Hash-chained audit trail, append-only, tamper-evident, 7yr default retention |
439
+ | Transparency | Art. 13 | `why()` queries return typed causal chains — not reconstructions, actual reasoning records |
440
+ | Right to explanation | Art. 86 | `explain()` generates deterministic, reproducible compliance documents from `why()` results |
441
+ | Monitoring | Art. 72 | `on_event` / `on_event_async` callbacks stream audit events to SIEM/monitoring systems |
442
+
443
+ **Article 86 — Right to Explanation:**
444
+
445
+ ```python
446
+ from flowscript_agents import Memory, explain
447
+
448
+ mem = Memory.load_or_create("agent.json")
449
+ # ... agent builds reasoning graph during normal work ...
450
+
451
+ result = mem.query.why(decision_node.id)
452
+ print(explain(result, subject="Applicant ID #4821", audience="legal"))
453
+ ```
454
+
455
+ ```
456
+ AUTOMATED DECISION EXPLANATION
457
+ Issued under EU AI Act Article 86 (Right to Explanation)
458
+
459
+ Subject: Applicant ID #4821
460
+ Decision: loan application denied
461
+ Causal chain depth: 3 steps
462
+
463
+ CAUSAL SEQUENCE
464
+ Step 1 (foundational factor): applicant income below minimum requirement
465
+ Step 2 (derives from): debt-to-income ratio exceeds policy limit
466
+ Step 3 (derives from): risk assessment: HIGH
467
+ Outcome: loan application denied
468
+
469
+ CERTIFICATION
470
+ Generated: 2026-03-27T19:46:46Z
471
+ This explanation is generated from a deterministic causal reasoning graph
472
+ maintained by FlowScript. The complete hash-chained audit trail is available
473
+ upon request and can be verified against the original reasoning record.
474
+ ```
475
+
476
+ Three audience modes: `"general"` (plain English for affected individuals), `"legal"` (formal compliance language with Article 86 citation and hash-chain reference), `"technical"` (structured debug output). No LLM in the loop — the explanation is deterministic and reproducible.
477
+
478
+ **Via MCP:** call the `explain_decision` tool with a node ID or content search. Same deterministic output, accessible from Claude Code, Cursor, or any MCP client.
479
+
480
+ **Via framework adapters:** access the underlying Memory through `adapter.memory`:
481
+
482
+ ```python
483
+ from flowscript_agents import explain
484
+ result = adapter.memory.query.why(node_id)
485
+ text = explain(result, audience="legal")
486
+ ```
487
+
488
+ **Enforcement begins August 2026.** Audit trails can't be backdated. Organizations using FlowScript today have unbroken reasoning records from day one. You can turn on logging tomorrow — you can't manufacture the last 18 months of decision provenance.
489
+
490
+ **Architecture:**
491
+
492
+ ```
493
+ ┌─────────────────────────────────────────────────────┐
494
+ │ Your Agent Framework (LangGraph, CrewAI, ADK, ...) │
495
+ ├─────────────────────────────────────────────────────┤
496
+ │ FlowScript SDK — Typed Reasoning Layer │
497
+ │ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
498
+ │ │ Memory │ │ Queries │ │ Audit Trail │ │
499
+ │ │ (graph) │ │ (5 ops) │ │ (SHA-256 hash chain) │ │
500
+ │ │ explain() │ │ on_event_async │ │
501
+ │ └──────────┘ └──────────┘ └──────────────────────┘ │
502
+ ├─────────────────────────────────────────────────────┤
503
+ │ Your Storage (files, database, cloud) │
504
+ └─────────────────────────────────────────────────────┘
505
+ ```
506
+
507
+ FlowScript doesn't replace your stack. It sits between your agent framework and your storage, adding typed reasoning and audit to whatever you already use.
508
+
509
+ ---
510
+
511
+ ## Security
512
+
513
+ Three independent CVE clusters dropped in the same week — MCPwned (SSRF via MCP trust boundaries), ClawHub (1,100+ malicious skills in agent marketplaces), and ClawJacked (CVE-2026-25253, CVSS 8.8, 15,200 affected instances). All share the same structural root cause: **unvalidated content flowing through agent invocation paths.**
514
+
515
+ You can't patch this at the application layer. The invocation path itself is untyped.
516
+
517
+ FlowScript's typed intermediate representation doesn't prevent every attack class — SSRF and transport-layer poisoning need different tools. What it makes structurally impossible is the deeper problem: **reasoning corruption.** Untraceable decisions, silent contradictions, unaudited state changes — these can't exist in a well-typed FlowScript graph. The type system makes them unrepresentable.
518
+
519
+ This is the same architectural insight behind [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/): Cambridge proved that making unsafe states hardware-inexpressible eliminates 70% of memory-safety CVEs — structural prevention beats behavioral detection. FlowScript applies this insight at the cognitive layer. The enforcement boundary is different (SDK type system vs. hardware capabilities), but the principle is identical: make the violation unrepresentable rather than hoping to catch it after the fact.
520
+
521
+ ---
522
+
523
+ ## What FlowScript Actually Is
524
+
525
+ If you've read this far, you're ready for the deeper structure.
526
+
527
+ The five queries and the audit trail are what FlowScript *does*. Here's what it *is*, and why it matters beyond any single application.
528
+
529
+ **Musical notation didn't record what musicians were already playing.** Before staff notation, European music was monophonic — single melodies, loosely coordinated. Notation made polyphony possible. Bach's fugues are literally unthinkable without it — not "hard to remember," but impossible to *compose*, because the simultaneous interaction of independent voices requires a representational system precise enough to reason about counterpoint.
530
+
531
+ Notation expanded the space of possible musical thought.
532
+
533
+ **FlowScript does the same thing for AI cognition.** It doesn't record what agents are already thinking. It makes a new category of AI reasoning possible — the kind where you can have multiple reasoning chains interacting, where you can query across causal paths, where contradictions become structured tensions instead of silent overwrites. This category of reasoning is impossible in the vector-search paradigm because vector search has no representation for *why*.
534
+
535
+ **FlowScript's type system makes malformed reasoning unrepresentable.** Every decision traces to a question through alternatives. Every contradiction becomes a typed tension with a named axis. Every state change gets an audited reason. These constraints give FlowScript a property familiar from [type theory](https://en.wikipedia.org/wiki/Type_theory): well-typedness implies safety. A well-formed FlowScript graph can always be queried — no stuck states, no silent contradictions, no untraceable decisions. The type structure doesn't constitute formal proofs in the Curry-Howard sense, but it does what good type systems do: make certain classes of malformed state structurally unrepresentable.
536
+
537
+ **Compression reveals structure that verbosity hides.** When you force AI reasoning through typed encoding, you force the extraction of structure that would otherwise remain implicit in natural language. This maps to a deep result in information theory: the minimum description of a dataset *is* its structure. Optimal compression and genuine understanding are the same operation. FlowScript's temporal tiers — where knowledge graduates from observation to principle through use — implement this: each compression cycle distills signal from noise, and the resulting structure is *more useful* than the verbose original.
538
+
539
+ **The metacognitive loop.** When an AI agent writes FlowScript, queries its own reasoning graph, discovers tensions or gaps, and generates new reasoning informed by that structure — it's not just remembering. It's *reasoning about its own reasoning* through a typed, queryable substrate. This is metacognition, and it's the category of thought that FlowScript makes possible that no vector store can touch.
540
+
541
+ **This isn't just good engineering — there's math behind it.** [Recent work in formal epistemology](https://arxiv.org/abs/2603.17244) applied AGM belief revision postulates — the mathematical framework for rational belief change — and proved that deletion violates core rationality requirements. When you delete a contradicted memory, you destroy information that the formal framework says a rational agent must preserve. FlowScript's RELATE > DELETE approach satisfies these postulates: preserve contradictions as tensions, maintain provenance chains, never destroy reasoning history. The formal result says deletion is irrational. FlowScript is the implementation that takes that seriously.
542
+
543
+ **FlowScript is infrastructure.** Not a tool. Not a framework. Not a compliance product. Infrastructure — like SQL gave us queryable data, TCP/IP gave us addressable communication, and Git gave us trackable changes. FlowScript gives AI agents queryable reasoning. Everything else — compliance, security, memory, observability — is an application of that infrastructure.
544
+
545
+ The applications are what you install FlowScript for. The infrastructure is why it matters.
379
546
 
380
547
  ---
381
548
 
@@ -387,7 +554,7 @@ Under the hood: a local semantic graph with typed nodes, typed relationships, an
387
554
  | [flowscript-core](https://www.npmjs.com/package/flowscript-core) | TypeScript SDK — Memory class, 15 tools, token budgeting, audit trail | `npm install flowscript-core` |
388
555
  | [flowscript.org](https://flowscript.org) | Web editor, D3 visualization, live query panel | Browser |
389
556
 
390
- **1,312 tests** across Python (581) and TypeScript (731). Same audit trail format and canonical JSON serialization across both languages.
557
+ **1,315 tests** across Python (584) and TypeScript (731). Same audit trail format and canonical JSON serialization across both languages.
391
558
 
392
559
  ### Docs
393
560
 
@@ -398,4 +565,12 @@ Under the hood: a local semantic graph with typed nodes, typed relationships, an
398
565
 
399
566
  ---
400
567
 
568
+ ## Known Limitations
569
+
570
+ - **Single-writer audit**: Two processes writing the same audit file will corrupt the hash chain. One writer per memory file.
571
+ - **File-based persistence**: JSON file storage via `save()`. For shared or multi-agent setups, use separate memory files per agent.
572
+ - **Extraction quality varies by model**: gpt-4o-mini handles most content well. Complex contradictory content may produce fallback ADDs instead of RELATE operations. Results improve with larger models.
573
+
574
+ ---
575
+
401
576
  MIT. Built by [Phillip Clapham](https://phillipclapham.com).