
An AI-powered programming assistant that explains its thought process
Features • Demo • API • Installation • Usage • Architecture • Contributing • License
CodevAI is a powerful programming assistant that not only generates code but also provides insights into its thinking process. It's designed to help developers understand the reasoning behind code suggestions, offering a more educational experience than traditional code completion tools.
The system leverages advanced AI models via Cloudflare AI Workers to provide intelligent assistance across multiple programming languages, with continuous learning capabilities that improve over time based on user feedback.
- AI Thinking Process: See how the AI approaches problems, reasons through solutions, and explains its thought process
- Code Completion: Get intelligent code suggestions across multiple programming languages
- Error Detection: Identify and fix errors with detailed correction suggestions
- Interactive Editor: Edit code with real-time AI assistance and syntax highlighting
- Web Search Integration: Search for programming solutions and incorporate examples
- Continuous Learning: System learns from feedback to improve suggestions over time
- Language Support: Python, JavaScript, Java, C++, and Go
Visit our live demo to experience CodevAI's capabilities without creating an account.
The demo showcases:
- AI thinking visualization
- Code completion
- Error detection
- Interactive coding
CodevAI provides a RESTful API for integration into your development workflow.
https://api.codevai.example.com/v1
API requests require an API key passed in the header:
Authorization: Bearer your_api_key
POST /ai-thinking
Content-Type: application/json
{
"prompt": "Write a function to find the GCD of two numbers",
"language": "python",
"max_thoughts": 5
}
POST /code-completion
Content-Type: application/json
{
"code": "def fibonacci(n):",
"language": "python",
"max_tokens": 100
}
POST /error-check
Content-Type: application/json
{
"code": "def fibonacci(n):\n if n <= 0:\n return 0\n elif n == 1\n return 1\n else:\n return fibonacci(n-1) + fibonacci(n-2)",
"language": "python"
}
POST /detect-language
Content-Type: application/json
{
"code": "function factorial(n) {\n if (n === 0 || n === 1) {\n return 1;\n }\n return n * factorial(n - 1);\n}"
}
POST /web-search
Content-Type: application/json
{
"query": "Python recursive sorting",
"language": "python"
}
POST /web-content
Content-Type: application/json
{
"url": "https://example.com/python-tutorial"
}
- Python 3.8+
- Flask
- SQLAlchemy
- Cloudflare API access (for AI Workers)
- Clone the repository
git clone https://github.com/Bogdan11212/CodevAI.git
cd CodevAI
- Install dependencies
pip install -r requirements.txt
- Set up environment variables
cp .env.example .env
# Edit .env with your Cloudflare credentials and other settings
- Initialize the database
flask db init
flask db migrate
flask db upgrade
- Start the server
flask run
Once installed, access the web interface at http://localhost:5000
with the following sections:
- Home: Overview of CodevAI's capabilities
- AI Thinking: Visualize AI thought processes
- Code Generator: Generate code with continuous learning
- Interactive Editor: Code with real-time AI assistance
- Demo: Try all features without an account
- Documentation: Comprehensive API documentation
Using the Python client:
from codevai import CodevAIClient
client = CodevAIClient(api_key="your_api_key")
# Get AI thinking for a coding problem
response = client.ai_thinking(
prompt="Write a function to sort a list using quicksort",
language="python"
)
# Print the thought process and solution
for thought in response["thoughts"]:
print(f"Thought: {thought}")
print(f"\nSolution:\n{response['solution']}")
CodevAI follows a modular architecture with several key components:
-
Brain
ai_processor.py
: Main processing logiccloudflare_ai.py
: Integration with Cloudflare AIthinking_patterns.py
: Templates for AI thinkingweb_access.py
: Internet data access for learning
-
API
- RESTful endpoints for different functionalities
- Authentication and rate limiting
- Request validation and processing
-
Models
- Database models for storing examples, feedback, etc.
- Versioning system for tracking AI improvements
-
Web Interface
- Interactive demos
- Documentation
- Code editor with real-time suggestions
- Backend: Flask (Python)
- Database: SQLAlchemy with SQLite
- AI Processing: Cloudflare AI Workers
- Frontend: Bootstrap, Modern JS, Monaco Editor
- Authentication: Flask-Login
We welcome contributions from the community! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Cloudflare AI Workers for providing the AI capabilities
- Flask for the web framework
- All contributors who have helped shape this project