aetherAI
What We Built
We built AetherAI by combining robust backend services with a sleek, intuitive frontend. The backend is powered by OpenAI’s API, transforming raw user queries into optimized, detailed prompts. Below is a key function that powers our query refinement process:
import openai
def refine_query(user_query: str) -> str:
try:
response = openai.ChatCompletion.create(
model="gpt-4-turbo",
messages=[
{
"role": "system",
"content": (
"You are an assistant that improves user queries for maximum effectiveness. "
"Expand the query with relevant details, keywords, and context to ensure a high-quality response. "
"Do NOT ask follow-up questions. Simply return a refined and more complete version of the original query. "
"only do line breaks, no markdown formatting in response including bolding and italics. "
"give text in plaintext format."
)
},
{
"role": "user",
"content": f"Refine this query: {user_query}"
}
]
)
return response['choices'][0]['message']['content']
except openai.AuthenticationError:
raise Exception("Invalid OpenAI API key. Check your environment variables.")
except openai.RateLimitError:
raise Exception("Rate limit exceeded. Try again later.")
except openai.OpenAIError as e:
raise Exception(f"OpenAI API error: {str(e)}")
except Exception as e:
raise Exception(f"Unexpected error: {str(e)}")
Once the refined query is generated, we retrieve both the original and optimized responses to help users compare effectiveness:
def get_query_response(query: str) -> str:
try:
response = openai.ChatCompletion.create(
model="gpt-4-turbo",
messages=[
{
"role": "system",
"content": (
"You are a knowledgeable and helpful assistant. "
"only do line breaks, no markdown formatting in response including bolding and italics. "
"give text in plaintext format."
)
},
{
"role": "user",
"content": query
}
]
)
return response['choices'][0]['message']['content']
except openai.AuthenticationError:
raise Exception("Invalid OpenAI API key. Check your environment variables.")
except openai.RateLimitError:
raise Exception("Rate limit exceeded. Try again later.")
except openai.OpenAIError as e:
raise Exception(f"OpenAI API error: {str(e)}")
except Exception as e:
raise Exception(f"Unexpected error: {str(e)}")
To measure productivity improvements, we implemented a time saved metric, which estimates how much time users gain by using refined queries:
def calculate_time_saved(original_response: str, refined_response: str) -> str:
original_length = len(original_response)
refined_length = len(refined_response)
if original_length == 0:
return "0 seconds"
# total time saved in seconds
time_saved_seconds = (refined_length / original_length) * 20
time_saved_seconds = round(time_saved_seconds, 2)
# minutes and seconds components
minutes = int(time_saved_seconds // 60)
seconds = int(time_saved_seconds - (minutes * 60))
parts = []
if minutes > 0:
minute_unit = "minute" if minutes == 1 else "minutes"
parts.append(f"{minutes} {minute_unit}")
if seconds > 0 or minutes == 0: # always show seconds if minutes is 0
second_unit = "second" if seconds == 1 else "seconds"
parts.append(f"{seconds} {second_unit}")
return " ".join(parts)
Key challenges included managing asynchronous operations while ensuring API call reliability, handling unexpected errors from the AI services, and integrating multiple layers of functionality into a seamless experience. One major hurdle we encountered was ensuring our API calls conformed to OpenAI’s latest standards. After implementing our functions, we initially used outdated syntax when making requests to the OpenAI API. Debugging this issue proved time-consuming, as it required combing through error logs and documentation to identify the discrepancies. Debugging issues related to API rate limits and model accessibility was also demanding. Balancing rapid development with robust error handling and ensuring the interface remained user-friendly under these constraints tested our problem-solving skills.
Accomplishments That We're Proud Of
We’re proud of creating a platform that not only refines queries but also quantifies productivity improvements through a “time saved” metric. Successfully integrating AI models into a productive user experience and allowing side-by-side comparisons of original and refined responses has been a major milestone. The project demonstrates that with the right question formulation, users can access high-quality answers faster, thereby directly boosting their productivity. In terms of programming, we are very happy that we were able to successfully accomplish our idea and make it work.
What We Learned
Throughout development, we learned the immense impact that clear, optimized queries can have on productivity. We gained invaluable experience with API integration, asynchronous programming, and the intricacies of natural language processing. Our journey taught us the importance of robust error handling and user-centric design, we learned that even complex systems can be made intuitive and effective. These insights are shaping our roadmap as we continue to enhance the platform.
What's Next for AetherAI
The next phase of AetherAI focuses on scalability and deeper user engagement through an advanced dashboard. This dashboard will provide detailed analytics on query refinement, track total "time saved", and highlight trends in productivity gains over time. To support a growing user base, I will integrate a database to store user interactions, enabling persistent tracking of query improvements and historical insights. A token-based authentication system will be implemented to assign unique user IDs, allowing for personalized recommendations and secure access to query history. Additionally, AetherAI will expand with customizable settings, integrations with productivity tools, and community-driven features that empower users to optimize their workflows. These enhancements will transform AetherAI from a query optimization tool into a comprehensive AI-driven productivity platform, helping users refine their communication, save time, and work smarter every day.
Log in or sign up for Devpost to join the conversation.