Building SmartXiv: Navigating the Challenges of Creating an AI SaaS Platform
In the ever-evolving landscape of academic research, efficiently navigating and digesting vast amounts of information is crucial. arXiv, a renowned platform, hosts over 2.4 million scholarly articles spanning physics, mathematics, computer science, and other scientific fields. While it is an invaluable resource, the sheer volume of content and complex categorization can often overwhelm researchers and students. With the creation of SmartXiv, we aimed to build a platform that not only simplifies this process but also enhances the research experience for academics worldwide. This article explores the challenges we encountered and the technical journey we undertook while honing our skills on a SaaS platform.
An idea from a problem
Our journey began with a simple but ambitious goal: to make researchers' lives a little easier. Despite its immense value, the traditional arXiv platform often left users feeling lost in an overwhelming sea of data. We envisioned SmartXiv as a friendly guide—an intelligent assistant that could help users navigate the maze of scholarly articles more smoothly and intuitively.
SmartXiv is designed as a SaaS platform that delivers personalized email digests. These digests are curated based on user preferences, summarizing the key elements of academic papers. This approach saves researchers time while ensuring they receive the most relevant and impactful information tailored to their specific interests.
Navigating the Tech Stack
As a software engineer with a background in Angular, transitioning to a new tech stack—Astro with React—was both challenging and rewarding. While I had worked with React during the first two years of my career, my proficiency had diminished over time. However, the past four years of exploring various frameworks helped me deepen my understanding of web development.
We chose React for its component-based architecture, enabling us to create a dynamic and responsive user interface. Integrating React with Astro and Shadcn presented unique challenges:
- Astro excelled at delivering static content efficiently, making it essential for parts of our application that required fast load times and SEO optimization. We used Astro for server-side rendering (SSR) to ensure critical content was rendered server-side, improving performance and accessibility.
- Shadcn refined our UI components, providing a modern and cohesive design language. The real challenge was balancing SSR and client-side rendering (CSR). As a rule of thumb, CSR was considered for components requiring high interactivity and frequent updates, allowing us to maintain a seamless user experience.
The Challenge of Building an Efficient RAG
One of our biggest hurdles was building an efficient Retrieval-Augmented Generation (RAG) system for digest creation. We integrated an open-source LLM orchestration framework with RAG, which brought significant benefits, such as improved accuracy and efficiency in content generation.
To ensure precise and reliable digests, we set the model’s temperature to 0.3. This low value kept the AI’s responses focused and deterministic, sticking closely to the most likely predictions.
We also developed a prompt template to define clear rules for the AI, ensuring consistency with our standards. Four key functions were implemented:
- Managing papers and their schemas.
- Handling user information and its schema.
- Creating an advanced output parser using the Zod schema to validate model outputs, ensuring they met quality and format requirements.
But it wasn’t just about the tech. We had to address challenges like:
- Scaling the system to meet growing demand.
- Maintaining content quality as we expanded.
These efforts required a robust infrastructure and constant monitoring to adapt to evolving needs.
Handling API Fallbacks and Ensuring Reliable Delivery
One unexpected challenge was dealing with inconsistencies in the arXiv API, which wasn’t updated as frequently as we anticipated. To ensure uninterrupted service, we implemented robust fallback mechanisms, including:
- Caching previous data and applying retry logic to handle temporary API unavailability.
- A queuing system to monitor email delivery status, allowing retries for failed attempts.
These measures ensured that users received their personalized digests reliably and on time, even in the face of external challenges.
Additionally, ensuring that our email digests were delivered reliably and not debounced was crucial. We implemented a queuing system that monitored the status of email deliveries, allowing us to retry sending emails if they were initially unsuccessful. This system ensured that our users received their personalized digests on time, maintaining the trust and reliability that SmartXiv aims to provide.
These strategies not only enhanced the robustness of our platform but also demonstrated our commitment to delivering a seamless user experience, even in the face of external challenges.
Conclusion
Building SmartXiv was a transformative experience that challenged us technically and creatively, reinforcing our belief in the power of innovation. By integrating personalized recommendations and automated summarizations, we created a platform that simplifies access to complex academic content.
Every piece of this system—from the tech stack to the thoughtful handling of challenges—came together to create something we’re incredibly proud of. SmartXiv doesn’t just generate personalized digests; it enhances the way researchers interact with academic content, saving them time and making their experience more intuitive.