Disclaimer: This a prototype to test a concept and will not be maintained.
A modular framework for building dynamic prompts with pluggable components for AI systems.
- Modular Components: Define reusable prompt components with type-specific behaviors
- Dynamic Templates: Flexible prompt structures with variable insertion
- Working Memory: Automatic conversation history management with intelligent summarization
- Easy Experimentation: Swap components and templates on the fly
- Web UI: Modern web interface for configuration and management
- Character System: Save and load different AI configurations
- Event System: Monitor and react to system changes
- Provider Abstraction: Support for different LLM backends
- Ensure you have the dependencies installed:
pip install langchain langchain-community langgraph langchain-ollama flask flask-cors- Make sure Ollama is running:
ollama serve # In one terminal
ollama pull gemma3:latest # Or any other model you prefer- Run the web UI:
python start_web_ui.py- Access the web interface at http://localhost:5000
dynamic_ai_framework/
├── core/ # Core framework classes
├── components/ # Reusable prompt components
├── templates/ # Prompt structure templates
├── providers/ # LLM provider abstractions
└── storage/ # Storage backend implementations
from dynamic_ai_framework import (
DynamicPromptManager, PromptStructure, OllamaLLMProvider,
create_basic_components, create_simple_chat_template
)
# Initialize components
components = create_basic_components()
template = create_simple_chat_template()
# Create framework instances
structure = PromptStructure(template, components)
llm_provider = OllamaLLMProvider("gemma3:latest")
manager = DynamicPromptManager(structure, llm_provider)
# Chat
response = manager.get_response("Hello! How are you?")
print(response)
# Update components
manager.update_component("context", "We're discussing AI frameworks")from dynamic_ai_framework.core import TypedPromptComponent, ComponentType
# Define a custom component with type-specific behavior
custom_component = TypedPromptComponent(
name="mood",
component_type=ComponentType.CUSTOM,
content="I'm feeling curious and helpful today!",
update_strategy="manual"
)
# Use in templates
template = "PERSONALITY: {personality}\nMOOD: {mood}\n\nRespond to: {user_input}"This framework provides a foundation for experimenting with dynamic prompt engineering!

