Day 3 of Demolishing my Stack of Unfinished Projects: SmartNotes Project

Christian TioyeChristian Tioye
5 min read

The Setup: When Everything Seems Perfect

After successfully implementing a chatbot based on ChatGPT in my portfolio (as detailed in my previous "Redesign Portfolio" post), I was feeling pretty good about myself. The AI integration was working smoothly, users could ask questions about my skills and projects, and I had successfully created content embeddings that made the chatbot intelligent and contextually aware.

Little did I know that this "completed" project was about to become the perfect candidate for my "Unfinished Projects" series.

The Crisis: When OpenAI Goes Silent

It started with a simple error message: "OpenAI API account suspended." At first, I thought it was a simple configuration issue. Maybe I had accidentally exposed my API key or hit some rate limit. But after checking my environment variables and account status, I realized the problem was deeper.

My OpenAI account was suspended, and suddenly, my "completed" AI chat functionality was completely broken. Suddenly, my SmartNotes app which also powers the chat functionality went offline.

This was supposed to be a finished project. Instead, it had become the latest addition to my stack of unfinished work.

The Panic: Scrambling for Solutions

The immediate challenge was clear: either abandon the chat functionality entirely or find an alternative solution. Given that I had already invested significant time in building the user interface and database integration, abandoning it wasn't an option.

I started researching alternatives:

  • Claude API: Limited availability and different pricing structure

  • Local AI models: Required significant computational resources

  • Hugging Face: Promising, but I had no experience with their inference API

The clock was ticking, and my portfolio was broken.

The Discovery: Hugging Face to the Rescue

After several hours of research and testing, I discovered that Hugging Face offered inference APIs that could potentially replace OpenAI's functionality. The catch? I had to completely rewrite the AI integration layer.

This wasn't just a simple API swap - it was a complete architectural overhaul. I had to:

  1. Replace OpenAI's embedding model with Hugging Face alternatives

  2. Find a suitable text generation model

  3. Handle different response formats

  4. Implement proper error handling for a new service

The Implementation: Building Resilience

Model Selection Hell Finding the right model on Hugging Face proved more challenging than expected. My first attempts failed spectacularly:

  • microsoft/DialoGPT-medium - "No inference provider available"

  • gpt2 and distilgpt2 - Limited conversational capabilities

  • Qwen/Qwen3-4B - Finally worked with the nebius provider

Database Architecture Evolution The migration also exposed a fundamental issue: my MongoDB setup wasn't ideal for production use. I decided to migrate to Neon PostgreSQL, which meant:

  • Updating Prisma schema

  • Migrating existing data

  • Handling different ID types

  • Testing the new connection

Streaming Responses: The Silver Lining One positive outcome was implementing streaming text responses. Instead of waiting for complete AI responses, users now see text appear word-by-word, creating a ChatGPT-like experience that's actually better than the original implementation.

The Fallback System: Never Trust a Single Service

I learned a valuable lesson about building robust systems. I implemented a multi-layered fallback approach:

  1. Vector Search: Primary method using Pinecone embeddings

  2. Text Search: Fallback to simple text matching

  3. Intelligent Responses: Pre-built responses for common queries

This ensures that even if the AI service fails, users still get helpful responses.

The Current State: Better Than Before

What started as a crisis has evolved into a more robust, scalable system. The new implementation includes:

  • ✅ Hugging Face AI integration via Nebius

  • ✅ Streaming text responses

  • ✅ PostgreSQL database backend

  • ✅ Comprehensive error handling

  • ✅ Multiple fallback mechanisms

Lessons Learned: Why This Project Wasn't Really "Finished"

  1. Single Point of Failure: Relying on one AI service provider is risky

  2. Production vs. Development: What works in development might fail in production

  3. Resilience by Design: Building fallback systems from the start saves time and maintains user experience

  4. The Definition of "Complete": A project isn't truly finished until it can handle real-world failures gracefully

The Unfinished Projects Paradox

This experience taught me something important about my "Unfinished Projects" series. Sometimes, what appears to be a finished project is actually just waiting for the right failure to reveal its incompleteness.

The AI chat integration wasn't truly finished until it could survive the loss of its primary service provider. In that sense, the "unfinished" phase was actually a blessing - it forced me to build something more robust than I originally planned.

What's Next: The Never-Ending Journey

Even now, I'm not sure this project is truly "finished." I'm already planning improvements:

  • User analytics for chat interactions

  • Conversation history persistence

  • Multi-language support

  • Integration with more AI models

Conclusion: Embracing the Unfinished

This project taught me that "unfinished" isn't always a negative state. Sometimes, it's the catalyst for building something better than originally envisioned. The AI chat integration that almost wasn't has become one of my portfolio's most resilient features.

For developers facing similar challenges, remember: every obstacle is an opportunity to improve your architecture. What seems like a setback might actually be pushing you toward a better solution.

The journey from "finished" to "unfinished" to "better than finished" is what makes development exciting. Embrace the chaos, build resilience, and never stop improving.


Technical Stack Used:

  • Next.js 15.0.0

  • Hugging Face Inference API

  • Neon PostgreSQL

  • Prisma ORM

  • Pinecone Vector Database

  • Streaming text responses

  • Multi-layered fallback system

Resources:


This blog post captures the emotional journey, technical challenges, and valuable lessons learned while maintaining the honest, problem-solving tone that your "Unfinished Projects" series is known for. It shows how "unfinished" can actually lead to better outcomes!

0
Subscribe to my newsletter

Read articles from Christian Tioye directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Christian Tioye
Christian Tioye

I am software engineer based in Louisville Metro. My goals for 2023 is to complete my Master degree in Computer Science and start a full-time role building software to power the modern world.