Day 3 of Demolishing my Stack of Unfinished Projects: SmartNotes Project A developer's SmartNotes project and portfolio chatbot broke after their OpenAI API account was suspended. They migrated to Hugging Face inference APIs via Nebius, rewrote the AI integration layer, and switched from MongoDB to Neon PostgreSQL, implementing streaming responses and multi-layered fallbacks for resilience. Published on Aug 18th, 2025 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. 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 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. 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: Replace OpenAI's embedding model with Hugging Face alternatives Find a suitable text generation model Handle different response formats Implement proper error handling for a new service 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. I learned a valuable lesson about building robust systems. I implemented a multi-layered fallback approach: Vector Search : Primary method using Pinecone embeddings Text Search : Fallback to simple text matching Intelligent Responses : Pre-built responses for common queries This ensures that even if the AI service fails, users still get helpful responses. 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 Single Point of Failure : Relying on one AI service provider is risky Production vs. Development : What works in development might fail in production Resilience by Design : Building fallback systems from the start saves time and maintains user experience The Definition of "Complete" : A project isn't truly finished until it can handle real-world failures gracefully 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. 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 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