Skip to main content

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"

Open in GitHub Codespaces Open In Colab

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
  1. Linguistic gate — picks register leaning (plain Anglo-Saxon vs latinate, etc.) from your goal and pooled registry evidence
  2. Variation — generates prompt variants (8 strategies)
  3. Selection — scores candidates (clarity, utility, coherence, simplicity via Occam's razor)
  4. 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

recursive_intelligence-0.1.3.tar.gz (116.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recursive_intelligence-0.1.3-py3-none-any.whl (137.1 kB view details)

Uploaded Python 3

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

Hashes for recursive_intelligence-0.1.3.tar.gz
Algorithm Hash digest
SHA256 21d98f45148bae1722481d60e58ea8389c92713aa59fa03876b9e0fab999c038
MD5 525a5ba0841cf5cb22f081c26598cc6b
BLAKE2b-256 eab9ead5048c7c7d520b34648d1477fd92f012a49c3b17658ac8360aaebf3764

See more details on using hashes here.

Provenance

The following attestation bundles were made for recursive_intelligence-0.1.3.tar.gz:

Publisher: publish.yml on russfranky/recursive-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file recursive_intelligence-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for recursive_intelligence-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11e170de29fb322a7236f4378ae137ccab939402659c165ad64bd701794a047f
MD5 52c99d1c19f1f601d81e000dfdcf2337
BLAKE2b-256 739fbd64299e4aefc792cefeb13186ecee33b4d4bc4e033b8c5c64352d34355e

See more details on using hashes here.

Provenance

The following attestation bundles were made for recursive_intelligence-0.1.3-py3-none-any.whl:

Publisher: publish.yml on russfranky/recursive-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page