Inspiration
While the world is buzzing about Generative AI, LLMs, and 5G, a massive portion of the global population is being left behind. There are over 3 billion people offline or using feature phones (dumbphones) with limited data. We realized that the "Digital Divide" is quickly becoming an "Intelligence Divide."
We asked ourselves: How can we bring the power of state-of-the-art AI to a device as simple as a Nokia 3310?
The answer was SMS. It’s the universal protocol. It requires no app installation, no 4G/5G, and no account setup. TextPedia was born from the desire to turn the simplest phone into a portal for the sum of human knowledge.
What it does
TextPedia is an SMS-based Operating System. Users simply text our toll-free number to access a suite of AI-powered tools immediately. There are no apps to download and no ads to watch.
The system features a robust State Machine menu that allows users to:
- Knowledge Search: Ask any question (e.g., "Who is Elon Musk?") and get a concise, hallucination-free summary.
- Universal Translator: Translate text between 50+ languages instantly.
- Health & First Aid: Get immediate, offline medical advice for emergencies.
- Dictionary: Define complex terms on the fly.
- Live Weather: Real-time updates for any city.
- Unit Converter: Natural language conversion (e.g., "100km to miles").
It handles context retention, meaning the AI remembers who you are and what you just asked, allowing for natural, conversational follow-ups via text.
How we built it
We engineered TextPedia to be extremely lightweight yet capable of handling massive concurrency.
- Backend Core: We chose Rust (Actix-web) for the backend API. Rust provided the type safety and memory efficiency needed to handle thousands of concurrent SMS webhooks without the garbage collection pauses that would slow down a Node.js or Python server.
- AI Engine: We integrated Google Gemini 2.5 Flash. Its speed and low latency were critical. We utilized aggressive System Prompting to force the model to output strict plain text, adhering to the 160-character limit of GSM protocols.
- The SMS Gateway: We used Twilio Programmable SMS to handle the ingress/egress of messages.
- State Management & Caching: We implemented Redis to store user session state and chat history, keyed by the user's phone number. This allows us to maintain conversational context (Context Window) for the AI while keeping the database hits low.
- Queue System: To ensure reliability during traffic spikes, incoming messages are pushed to a RabbitMQ message broker before processing. This decouples the webhook reception from the AI generation, ensuring no message is ever lost even if the AI takes a second to think.
Challenges we ran into
- The "Markdown" Problem: LLMs love to format text with bolding (
**text**) and headers (#). SMS protocols display these as raw ugly characters. We had to write a custom Response Sanitizer in Rust that strips Markdown and intelligently truncates responses to fit into multipart SMS segments without cutting words in half. - Context Window vs. Cost: Storing history for every phone number gets expensive. We had to implement a rolling window algorithm in Redis that summarizes previous conversations to keep the token count low while maintaining context.
- Latency: SMS inherently has delivery latency. Adding AI generation on top risked timing out the user's attention. Switching to Rust and the faster Gemini Flash model reduced our internal processing time to sub-200ms.
Accomplishments that we're proud of
- The "Text OS" Feel: We successfully built a menu-driven interface purely over text that feels responsive and app-like.
- Rust Implementation: Pushing our technical boundaries to build the backend in Rust resulted in a system that is incredibly stable and performant.
- Accessibility: We tested the outputs against strict constraints to ensure that even on a 20-year-old device, the information is readable and useful.
- Zero-Hallucination Formatting: Getting the AI to reliably stop using emojis and markdown stars was a prompt engineering battle we won.
What we learned
- Constraint Breeds Creativity: Limiting ourselves to 160 characters forced us to be better prompt engineers. We learned how to make AI concise and direct.
- Rust Ownership Model: We gained a deeper appreciation for Rust's borrow checker when managing async tasks for the message queue.
- The Importance of State: Managing user state via stateless SMS webhooks is tricky; relying on Redis as a "short-term memory" for the phone numbers was a key architectural breakthrough.
What's next for TextPedia
- Voice Integration: Integrating Twilio Voice to allow users to call in and speak to the AI (IVR) for those who cannot read or write.
- WhatsApp & Telegram Support: Expanding beyond SMS to data-light messaging apps to reach a wider audience in regions where SMS is expensive.
- Local Edge Computing: We are exploring running quantized LLMs on local servers in rural areas to reduce API costs and latency even further.
Log in or sign up for Devpost to join the conversation.