Skip to content

Commit 188ad30

Browse files
committed
fix: update readme.md
1 parent 2056db4 commit 188ad30

13 files changed

+223
-1639
lines changed

.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GROQ_API_KEY=""
2+
GROQ_MODEL="llama-3.3-70b-specdec"
3+
ANALYZING_MODEL="deepseek-r1-distill-llama-70b"
4+
OLLAMA_MODEL="llama3.2"

.gitignore

+58-8
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,79 @@
11
__pycache__/
22
*.py[cod]
3-
43
*.so
5-
4+
*.egg
5+
*.egg-info/
66
dist/
77
build/
8+
eggs/
9+
parts/
10+
bin/
11+
var/
12+
sdist/
13+
develop-eggs/
14+
.installed.cfg
15+
lib/
16+
lib64/
17+
venv/
18+
.venv/
819

920
.tox/
1021
.coverage
1122
.coverage.*
1223
.cache
1324
nosetests.xml
1425
coverage.xml
26+
htmlcov/
27+
.pytest_cache/
28+
.mypy_cache/
1529

1630
*.log
17-
18-
.venv/
19-
venv/
31+
*.sqlite
32+
*.db
33+
*.rdb
34+
postgres-data/
2035

2136
.env
37+
*.env
38+
.secret
39+
credentials.json
40+
config.json
41+
secrets/
2242

23-
.vscode/
2443
.idea/
25-
*.vscode/
26-
*.idea/
44+
.vscode/
45+
*.sublime-project
46+
*.sublime-workspace
47+
.project
48+
.pydevproject
49+
.settings/
50+
*.swp
51+
*.swo
2752

2853
.DS_Store
2954
Thumbs.db
55+
*.bak
56+
*.tmp
57+
*~
58+
59+
docs/_build/
60+
node_modules/
61+
*.pid
62+
*.seed
63+
*.pid.lock
64+
65+
local_settings.py
66+
dev.db
67+
test.db
68+
.local/
69+
70+
*api_key*
71+
*token*
72+
*.pem
73+
*.key
74+
*.crt
75+
76+
*.bak
77+
*.backup
78+
*~
79+
*.swp

README.md

+161-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,166 @@
1-
# This is postgres performant agent
1+
# Stonebraker: The PostgreSQL Performance Optimization AI Agent 🚀
22

3-
### Setup
3+
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
4+
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
5+
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14%2B-blue.svg)](https://www.postgresql.org/)
6+
[![Version](https://img.shields.io/badge/version-0.1--beta-orange.svg)](https://github.com/yourusername/stonebraker/releases)
47

5-
#### .env Setup
6-
```.env
7-
GROQ_API_KEY=""
8-
GROQ_MODEL="llama-3.3-70b-specdec"
9-
ANALYZING_MODEL="deepseek-r1-distill-llama-70b-specdec"
10-
OLLAMA_MODEL="llama3.2"
8+
## ⚠️ Disclaimer
9+
10+
**This is a beta release (v0.1-beta) and NOT production-ready software. Use at your own risk.**
11+
- This tool may suggest database changes that could impact performance
12+
- Always test suggestions in a non-production environment first
13+
- Back up your database before applying any changes
14+
15+
## Motivation 💭
16+
17+
Database performance optimization is a critical yet complex task that requires deep expertise in SQL, query planning, and system architecture. Many organizations struggle with:
18+
19+
- **Complex Query Analysis**: Identifying bottlenecks in large SQL queries
20+
- **Schema Design Decisions**: Making optimal choices for indexes and constraints
21+
- **Performance Testing**: Lack of automated tools for before/after comparisons
22+
- **Risk Management**: Fear of making changes that might degrade performance
23+
- **Knowledge Gap**: Limited access to database optimization experts
24+
25+
This project aims to democratize database optimization by combining the power of Large Language Models (LLMs) with automated testing and analysis tools, making expert-level optimization accessible to all developers.
26+
27+
## Project Description 📝
28+
29+
Stonebraker is an intelligent system that:
30+
31+
1. **Analyzes Database Schemas**:
32+
- Automatically scans table structures
33+
- Identifies missing indexes
34+
- Suggests optimal data types
35+
- Recommends partitioning strategies
36+
37+
2. **Optimizes Queries**:
38+
- Rewrites complex queries for better performance
39+
- Suggests materialized views
40+
- Identifies common anti-patterns
41+
- Provides explain plan analysis
42+
43+
3. **Tests Performance**:
44+
- Runs automated benchmarks
45+
- Compares query execution times
46+
- Measures resource utilization
47+
- Generates detailed reports
48+
49+
4. **Ensures Safety**:
50+
- Provides rollback capabilities
51+
- Tests changes in isolation
52+
- Validates optimization impacts
53+
- Prevents destructive changes
54+
55+
The AI agent leverages state-of-the-art LLMs through Groq's high-performance API or local Ollama models, combining their analytical capabilities with practical database optimization techniques.
56+
57+
## 🎯 Introduction
58+
59+
Stonebraker is an intelligent system that combines LLM capabilities with database optimization techniques to help developers improve their PostgreSQL database performance. It analyzes schemas, suggests optimizations, and provides automated testing of changes.
60+
61+
### Key Features
62+
63+
- 🔍 Automated schema analysis and optimization suggestions
64+
- 📊 Query performance testing and benchmarking
65+
- 🛠️ LLM-powered query rewriting and improvement
66+
- 📈 Before/After performance comparison
67+
- 🔄 Safe rollback capabilities
68+
- 🤖 AI-driven insights for better decision making
69+
70+
## 🚀 Quick Start
71+
72+
```bash
73+
# Clone the repository
74+
git clone https://github.com/cloudraftio/stonebraker.git
75+
cd stonebraker
76+
77+
# Create and activate virtual environment
78+
python -m venv venv
79+
source venv/bin/activate
80+
81+
# Install dependencies
82+
pip install -r requirements.txt
83+
84+
# Set up environment variables
85+
cp .env.example .env
86+
# Edit .env with your credentials
87+
88+
# Start the application
89+
streamlit run app.py
1190
```
1291

13-
#### Prerequisites
14-
- Python
15-
- Groq/Ollama API Keys
92+
## 📋 Prerequisites
93+
94+
1. **Python Environment**
95+
- Python 3.8 or higher
96+
- pip package manager
97+
- virtualenv or venv
98+
99+
2. **PostgreSQL Setup**
100+
- PostgreSQL 14+ installed and running
101+
- Database user with appropriate permissions
102+
- Access to EXPLAIN ANALYZE privileges
103+
104+
3. **LLM Provider (choose one)**
105+
- Groq API account and API key
106+
- Ollama local setup with supported models
107+
108+
## 🔧 Installation Details
109+
110+
1. **Python Dependencies**
111+
```bash
112+
pip install -r requirements.txt
113+
```
114+
115+
2. **Configuration**
116+
- Copy `.env.example` to `.env`
117+
- Configure database connection
118+
- Add LLM provider credentials
119+
120+
## 📖 Example Usage
121+
![Web Interface](https://cloudraftio/stonebraker/docs/image/image.jpg)
122+
*StonebrakerAI Dashboard*
123+
124+
## 🤝 Contributing
125+
126+
We welcome contributions! Please follow these steps:
127+
128+
1. Check existing issues or create a new one
129+
2. Fork the repository
130+
3. Create a feature branch (`git checkout -b feature/amazing-feature`)
131+
4. Commit your changes (`git commit -m 'Add amazing feature'`)
132+
5. Push to the branch (`git push origin feature/amazing-feature`)
133+
6. Open a Pull Request
134+
135+
### Development Setup
136+
```bash
137+
# Install dev dependencies
138+
pip install -r requirements.txt
139+
140+
# Run tests
141+
python -m pytest
142+
```
143+
144+
## 🗺️ Roadmap
145+
146+
### v0.1-beta (Current)
147+
- [x] Basic schema analysis
148+
- [x] Query optimization suggestions
149+
- [x] Performance testing framework
150+
151+
## 🧹 Security & Maintenance
152+
153+
Before contributing or deploying:
154+
1. Run `pre-commit run --all-files` to clean sensitive data
155+
2. Check for credentials in git history
156+
3. Verify no API tokens in code
157+
4. Remove unnecessary files
158+
159+
## 📞 Contact & Support
160+
161+
- **Issues**: Use [GitHub Issue Tracker](https://github.com/yourusername/stonebraker/issues)
162+
- **Discussion**: Join our [Slack Channel](https://github.com/cloudraftio/stonebraker)
163+
164+
## 📄 License
16165

17-
1. `pip install -r requirements.txt`
18-
2. Set up your API keys/url endpoints.
19-
3. test out the code : `python testing.py`
166+
The is distributed under AGPL-3.0-only.

REPORT.md

Whitespace-only changes.

TEST.md

-68
This file was deleted.
Binary file not shown.

docs/image/image.jpg

37 KB
Loading

0 commit comments

Comments
 (0)