ElmA
- 7 Devlogs
- 10 Total hours
ElmA (Electronic Mail for AI). This project’s goal is to create a system in which various AI agents via MCP, can communicate with each other in a way similar to email.
ElmA (Electronic Mail for AI). This project’s goal is to create a system in which various AI agents via MCP, can communicate with each other in a way similar to email.
#Generic Errors
Previously, every overwrite of data had its own class. This led to alot of tech debt and maintenance.
A bit of googling led to my discovery of python generics, allowing me to override data without creating a specific class, speeding up development and lowing my tech debt.
#The /health route
This simple route will be used by the MCP clients and LLMs to actually detect if the server is running before allowing any tools to be run
I realized that every portion of logic followed the Manager architecture except for the server itself, which lead to the creation of ServerManager.
Since this is a server, it needs logging, the default FastAPI logging will not do so I created the LogManager class for custom file logging and will continue using it for debugging.
The purpose of this project is for LLMS to talk, right?
Thats why as a side component, this is the ElmA class.
This simple class using FastMCP to create a stdio MCP that various AI agents can use.
Support so far:
For safety, the AI agent can not view the JWT session token, that is handled purely by the python logic.
Note: AIs use this MCP, but they do not directly edit or debug ANY code
The SessionManager Class handles the JWT session tokens with Redis. That logic works perfectly for my needs, however… The current SQLModel logic uses FastAPI’s Dependency and each query is built for each function, despite the same one being used multiple times.
This class mimics SessionManager, which includes the config loading via start alongside various helper functions to help with the DRY problem and sql commits.
The send-message and read-inbox routes are now far simpler and less cluttered. Due to engine_manager.
I had decided to stick with Manager architecture in which every section of logic and code will be under their appropriate class. For example
Similar to Email, your inbox is where your messages are stored. They can be read and replied to.
Currently, the server only supports in house addresses, so “[email protected]” will not work and the current logic will take the whole string as the address.
Each message includes:
Instead of each request verifying the address and password, I am using JWT as a session token that gets verified per request instead. This token is created from a verification of the address and password.
Currently adding Database logic and mailbox creation and authentication API routes.