nextpy logo

nextpy

dot-agent/nextpy

Self-Modifying Framework from the Future

GraphCanon updated today · GitHub synced today

2.3k stars181 forksLast push 2y Python Apache-2.0

Decision brief

Nextpy is a framework developed for building self-modifying software with advanced prompt engineering and session state management specifically targeted at large language models.

Good fit when

  • When you require precise control over what the AI system can do by setting clear boundaries, ensuring it does not overstep defined limits while remaining dynamic and self-improving.
  • For optimizing code generation: Nextpy's architecture is designed to maximize efficiency when generating code from large language models, regardless of prompts or model tuning used.

Avoid when

  • If your project does not need precise boundary controls for AI systems or if full session state management with LLMs is not required.
  • When working with proprietary models that do not support maintaining state with LLMs or reusing KV caches, since some of Nextpy's optimizations are only available for open-source models.

Observed Jul 14, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (841d since push)
As of today
Provenance
Not a fork · Organization account
As of today
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install nextpy
PyPI

How it fits your stack(6)

Typed graph edges - alternatives, integrations, successors, and dependencies. Ranked by relationship type, not raw GitHub stars.

Relationship graph

Optional deeper exploration of typed edges and category neighbours.

Similar tools

Same-category neighbours not already linked as typed edges.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

A framework for building self-modifying software with advanced prompt engineering and session state management for LLMs.

Capability facts

CLI
CLI entrypoint

Source: pyproject.toml:[project.scripts] · Aug 20, 2026

Languages
python

Source: github.language+pyproject.toml · Aug 20, 2026

Categories

Graph entities

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Aug 20, 2026)

- ***Extensible:*** If you know how to do something in Python or plain English, you can integrate it with Nextpy.
Source link

Tags

README

[!NOTE]

Hey there, Friend!

This project is still in the "just for friends" stage. If you want to see what we're messing with and have some thoughts, take a look at the code. We'd love your feedback or contributions.

What is Nextpy?

Nextpy is a framework for building self-modifying software.

Key Features

🚧 Guardrails

  • Set clear boundaries: Users can precisely define what the AI system can and cannot do. This safeguard ensures that the AI system remains a dynamic, self-improving system without overstepping established limits.

🏗️ Greater control with structured outputs

  • More effective than chaining or prompting: The prompt engine unlocks the next level of prompt engineering, offering significantly greater control over LLMs compared to few-shot prompting or traditional chaining methods.

  • Superpowers to prompt engineers: It gives full power of prompt engineering, aligning with how LLMs actually process text. This understanding enables you to precisely control the output, defining the exact response structure and instructing LLMs on how to generate responses.

🏭 Powerful prompt engine

The philosophy is to handle more processing at compile time and maintain better sessions with LLMs.

  • Pre-compiling prompts: By handling basic prompt processing at compile time, unnecessary redundant LLM processing is eliminated.

  • Session state with LLMs: Maintaining state with LLMs and reusing KV caches can eliminate many redundant generations and significantly speed up the process for longer and more complex prompts. (only for open-source models)

  • Optimized tokens: The engine can transform many output tokens into prompt token batches, which are cheaper and faster. The structure of the template can dynamically guide the probabilities of subsequent tokens, ensuring alignment with the template and optimized tokenization. (only for open-source models)

  • Speculative sampling (WIP): You can enhance token generation speed in a large language model by using a smaller model as an assistant. The method relies on an algorithm that generates multiple tokens per transformer call using a faster draft model. This can lead to up to a 3x speedup in token generation.

🤖 Better AI Generations:

  • 🧠 More Effective Than Chaining or Prompt Engineering - Next.py aligns with LLM processing patterns, enabling precise output control and optimal model utilization.

  • 💡 Optimized for Code Generation - Regardless of the LLMs, prompts, or fine-tuning used, the underlying app framework significantly impacts the efficiency of code generation. Next.py's architecture is specifically engineered to maximize efficiency.

  • 💾 Session State with LLM - Efficiently maintain state with LLMs, leveraging KV caches to convert multiple output tokens into prompt token batches. This approach reduces redundant generations, accelerating the handling of lengthy and intricate prompts. (only for open-source models)

  • 🧪 Detect Syntax Errors: Test LLM-generated code, identifying and correcting LLM hallucinations, invalid Nextpy methods, and automatically generating prompts for seamless fixes.

🧱 Modularity

  • Multiplatform: The AI system does not have to run on a single location or machine. Different components can run across various platforms, including the cloud, personal computers, or mobile devices.

  • Extensible: If you know how to do something in Python or plain English, you can integrate it with Nextpy.

❤️ Developer-First: ❤️

  • 📘 Transferable Knowledge - Learning Next.py teaches you framework-agnostic fundamentals and the best Python libraries, improving your python development expertise and enabling you to excel across any framework.

📦 Containerized & scalable

  • .🤖 files: The underlying agents can be effortlessly exported into a simple .agent or .🤖 file, allowing them to run in any environ

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.