Recursive prompt improvement — VSR loop with linguistic gate (ri-engine CLI)
Project description
Prompt Improvement Studio
Recursive prompt improvement — Variation → Selection → Retention, with a linguistic gate.
Give it a seed prompt and a goal. It runs the VSR loop offline (no API key by default), resolves language/register leanings (plain, latinate, mixed, …), and returns an improved prompt.
pip install recursive-intelligence
ri-engine improve --seed "You are a helper." --goal "When this works, the AI will resolve the task in one pass"
License: MIT · Changelog: CHANGELOG.md · Architecture: docs/technical_reference.md
Install
pip install recursive-intelligence
# optional real LLM backends:
pip install "recursive-intelligence[all]"
From source: git clone … && pip install -e ".[all]"
Usage
Primary path (any prompt, any goal)
ri-engine improve \
--seed "You are a helper." \
--goal "When this works, the AI will produce a structured answer with measurable success criteria"
Python API
from ri_engine import improve
result = improve(
seed_prompt="You are a helper.",
objective="When this works, the AI will produce a structured answer.",
)
print(result.improved_prompt)
print(result.fitness) # VSR fitness score
Optional: template fixtures
Templates are pre-filled seed/objective pairs used for benchmarks and linguistic-registry pooling — not required for normal use.
ri-engine templates
ri-engine improve --template code-review
Proof / benchmark
ri-engine demo
Runs six fixture scenarios; scores are from the internal structural rubric (prompt_rubric.py), not live task metrics.
Expert / research commands
ri-engine expert benchmark
ri-engine expert pool-linguistic-registry
ri-engine expert macro-registry
ri-engine improve --seed … --goal … --expert
How it works
Linguistic Gate → Macro Priors → [Membrane] → Variation → Selection → Retention → repeat
- Linguistic gate — picks register leaning (plain Anglo-Saxon vs latinate, etc.) from your goal and pooled registry evidence
- Variation — generates prompt variants (8 strategies)
- Selection — scores candidates (clarity, utility, coherence, simplicity via Occam's razor)
- Retention — carries winning traits forward; detects convergence
Default provider is mock (offline, deterministic). Optional: --provider openai or --provider anthropic.
Optional providers
export OPENAI_API_KEY=sk-...
ri-engine improve --seed prompt.txt --goal "…" --provider openai
Docs
| Doc | Contents |
|---|---|
| technical_reference.md | Architecture, VSR, macro registry, Occam's razor |
| publication.md | API contract, limitations, red-team notes |
| getting_started.md | Step-by-step CLI walkthrough |
| cloud_development.md | Codespaces + Colab |
General-purpose prompt improvement. You bring the seed and goal; the engine handles language alignment and recursive refinement.
Project details
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 recursive_intelligence-0.1.3.tar.gz.
File metadata
- Download URL: recursive_intelligence-0.1.3.tar.gz
- Upload date:
- Size: 116.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d98f45148bae1722481d60e58ea8389c92713aa59fa03876b9e0fab999c038
|
|
| MD5 |
525a5ba0841cf5cb22f081c26598cc6b
|
|
| BLAKE2b-256 |
eab9ead5048c7c7d520b34648d1477fd92f012a49c3b17658ac8360aaebf3764
|
Provenance
The following attestation bundles were made for recursive_intelligence-0.1.3.tar.gz:
Publisher:
publish.yml on russfranky/recursive-intelligence
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
recursive_intelligence-0.1.3.tar.gz -
Subject digest:
21d98f45148bae1722481d60e58ea8389c92713aa59fa03876b9e0fab999c038 - Sigstore transparency entry: 1825989919
- Sigstore integration time:
-
Permalink:
russfranky/recursive-intelligence@001bd9e474ba63e272b6bccca4e96f4eaee1e684 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/russfranky
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@001bd9e474ba63e272b6bccca4e96f4eaee1e684 -
Trigger Event:
push
-
Statement type:
File details
Details for the file recursive_intelligence-0.1.3-py3-none-any.whl.
File metadata
- Download URL: recursive_intelligence-0.1.3-py3-none-any.whl
- Upload date:
- Size: 137.1 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 |
11e170de29fb322a7236f4378ae137ccab939402659c165ad64bd701794a047f
|
|
| MD5 |
52c99d1c19f1f601d81e000dfdcf2337
|
|
| BLAKE2b-256 |
739fbd64299e4aefc792cefeb13186ecee33b4d4bc4e033b8c5c64352d34355e
|
Provenance
The following attestation bundles were made for recursive_intelligence-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on russfranky/recursive-intelligence
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
recursive_intelligence-0.1.3-py3-none-any.whl -
Subject digest:
11e170de29fb322a7236f4378ae137ccab939402659c165ad64bd701794a047f - Sigstore transparency entry: 1825989990
- Sigstore integration time:
-
Permalink:
russfranky/recursive-intelligence@001bd9e474ba63e272b6bccca4e96f4eaee1e684 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/russfranky
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@001bd9e474ba63e272b6bccca4e96f4eaee1e684 -
Trigger Event:
push
-
Statement type: