Jaseur - An AP Server in C++, written by AI agents

I decided to explore GitHub Copilot’s experimental/preview coding agent support. As a test case, I prompted it to write an ActivityPub server in C++. I chose C++ because it’s a relatively complex programming language and there are few, if any, ActivityPub servers written with it.

The result is Jaseur. At this point, it’s 100% written with AI agents based on natural language directions from me. The AI agents even wrote the README.md, the FEDERATION.md and set up a GitHub action to build the project when changes are pushed.

The features currently include:

  • URI-Independent Architecture: The server doesn’t depend on specific URI path structures for resource retrieval or POST operations, making future extensions for multi-tenant (multi-domain) support relatively easy
  • Abstracted Storage Layer: While utilizing efficient file-based storage by default, the architecture employs a clean interface abstraction that enables seamless integration with alternative storage backends (databases, cloud storage, etc.) without modifying core application logic
  • ActivityPub Protocol Support: Implements a subset of ActivityPub server-to-server protocol
  • Flexible Configuration: TOML files, environment variables, and command-line arguments
  • Resource Management: Tools for manipulating ActivityPub resources
  • Actor Management: Create and manage ActivityPub actors
  • Inbox/Outbox Handling: Process incoming and outgoing activities
  • WebFinger Support: Actor discovery through WebFinger
  • LLM Integration: Connect to Ollama for AI-enhanced interactions
  • Security Features: IP filtering and authentication
  • Comprehensive Logging: Detailed logs for troubleshooting

For manual testing, I used Mastodon and snac2 with an actor that used a local LLM for responses to direct messages.

Multi-instance (multi-domain / multi-tenant) support will be added soon. The code is already compatible with it, but it needs a bit more tooling to make it easier to manage.

It’s mostly written by Anthropic Claude 3.5/3.7 Sonnet models with some code written by OpenAI 4o. The Claude Sonnet models are better than 4o because they support a larger context window. The context window seems to be an important consideration for AI agent coding effectiveness (with non-trivial code).

The implementation isn’t the best code I’ve seen but it’s as good or slightly better than some other human-written ActivityPub server implementations I’ve studied.

2 Likes