Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Reflex-AI

reflex-ai is a package to bring AI agent capabilities to your local development environment.

It also includes blocks for higher level components.

1. Install the Package

Install the package with pip:

pip install reflex-ai

NOTE: reflex-ai requires reflex 0.6.0 or later. Before this is out, make sure to run the following:

pip install git+https://github.com/reflex-dev/reflex.git@main
pip uninstall watchfiles

2. Create a Reflex Project

reflex-ai works with both new and existing Reflex projects. To create a new project, create a directory for your app and run:

reflex init

See the reflex docs for more information on creating Reflex projects.

3. Enable AI

To enable AI in your project, add the following to your main app file.

# Import the reflex-ai package (you MUST import it exactly like this)
from reflex_ai import enable

app = rx.App()
# Enable AI BEFORE you call any `add_page`.
enable(app)

# Add your pages as usual.
app.add_page(index)

4. Run the App

Run your app as usual:

While we're in beta, you need to take the following steps:

Export the backend URL for the AI agent:

export FLEXGEN_BACKEND_URL=https://rxh-prod-flexgen-agent.fly.dev/

Install `

Then run your app as usual:

reflex run

NOTE: You must be logged in to Reflex to use reflex-ai.

5. Access the AI Editor at /edit

Every page in your app will have an additional route by adding /edit to the end of the URL. For example, if your index page is at localhost:3000, you can access the AI editor at localhost:3000/edit. Similarly, if your about page is at localhost:3000/about, you can access the AI editor at localhost:3000/about/edit.

When reflex-ai is enabled, a scratch copy of your app will be created in the .web/reflex-ai-tmp directory for the AI to make changes without affecting your main app.

6. Select and Edit Elements

On an edit page, you can select elements by clicking on them. The selected element will be highlighted in the editor and the toolbar will show the selected code.

You can enter prompts in the toolbar input to generate new content for the selected element. The AI will generate new content based on the prompt and update the element in the editor.

Caveats

Metadata

Release files for reflex-ai 0.1.0a39

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reflex-ai 0.1.0a39
File Size Uploaded
reflex_ai-0.1.0a39.tar.gz 100.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reflex-ai 0.1.0a39
File Interpreter ABI Platform
reflex_ai-0.1.0a39-py3-none-any.whl Python 3 none any Details

Total release size: 288.7 kB

Release files / reflex_ai-0.1.0a39.tar.gz

Download URL reflex_ai-0.1.0a39.tar.gz
Size 100.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bf5b2bc8b403b9d77ad4aac9348051d075f79ed59b7022bb5f06b67672facde7
BLAKE2b-256 checksum
How to use checksums
3d3d1fa2f7961e3412f1524a353036ea2b7f3526454d9f668cac12154308f71e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Darwin/24.1.0

Release files / reflex_ai-0.1.0a39-py3-none-any.whl

Download URL reflex_ai-0.1.0a39-py3-none-any.whl
Size 188.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
325d36061d9413fe26fefc05601d45042a2debd53b8b46d13ff1486416d60e04
BLAKE2b-256 checksum
How to use checksums
c9f65ad5ee9dd933d7e840de7bb36f90039a07b01e83fa72a374a1da54ea6612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Darwin/24.1.0

Release history Release notifications | RSS feed

This release

0.1.0a39 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page