dayangrah.am

aisms : ai for dumbphones

AISMS is an AI-powered SMS system that brings llms to dumbphones.

For a few months in 2024, I switched to using a dumbphone to escape doomscrolling and to generally unplug. However, I missed quick access to info and also the phone I was using didn’t have navigation capabilities.

AISMS is a simple python application that uses a twilio phone number to receive SMS messages and uses openai + google maps api to generate responses to make dumbphone life a bit easier.

Technical Implementation

  1. FastAPI and Uvicorn: The core of the application is built on FastAPI, a modern, fast web framework for building APIs with Python. Uvicorn serves as the ASGI server, providing high-performance handling of requests.

  2. Twilio: This library is used to interface with the Twilio API, enabling the sending and receiving of SMS messages programmatically.

  3. LangChain: LangChain is employed for natural language processing tasks, likely used in conjunction with OpenAI’s language models (via langchain-openai) to generate contextually relevant responses to incoming messages.

  4. SQLModel and Tortoise ORM: These libraries are used for database operations, with SQLModel providing a SQL database interface and Tortoise ORM handling asynchronous ORM (Object-Relational Mapping) operations. This allows for efficient storage and retrieval of message data and user information.

  5. Google Maps: The inclusion of the googlemaps library suggests that the system may incorporate location-based services or geocoding capabilities in its responses.

The project structure follows best practices for Python development:

The system works in five steps:

  1. Twilio webhook receives SMS messages through FastAPI
  2. LangChain and OpenAI process the message content
  3. Tortoise ORM handles database operations
  4. Google Maps API provides location data when needed
  5. Response is sent back via Twilio SMS

More details can be found here.

---