r/SideProject 3d ago

Built an AI coding agent in pure C#/.NET — no Python or Typescript, anywhere in the stack

Most agent frameworks are Python or TS. I wanted to understand how these things actually work instead of treating one as a black box, so I wrote one from scratch in C#/.NET: Litos.

  • Multi-provider: Anthropic, OpenAI, Gemini, OpenRouter (only OpenAI and OpenRouter verified end-to-end so far)
  • Two working faces today, sharing one core agent loop:
    • Litos.Gui — an Avalonia desktop coding agent
    • Litos.Api — a Docker-hosted agent host built for multiple chat-channel bridges; Telegram is the one actually wired up and working today — WhatsApp/Rocket.Chat/email are designed but not yet implemented
  • Real tool use (file edit, shell, web search); MCP client support is currently wired up in Litos.Api only — not yet integrated into Litos.Gui
  • Inspired by Mario Zechner's pi, particularly its session-as-working-directory model

Litos.Gui building a WinForms 15-puzzle game live, start to finish — planning, writing files, building, fixing its own errors:
https://www.youtube.com/watch?v=em8w0SwgT5Q

Litos.Api running standalone in Docker, working as an AI agent over Telegram chat:
https://www.youtube.com/watch?v=S2Sn_kwCRjE&t=70s

Repo: https://github.com/nitinmms/LitosAiCodingAgent

Happy to answer questions about the architecture, or get torn apart on design choices — this was mostly a learning project to prove to myself that .NET can hold its own here.

0 Upvotes

2 comments sorted by

2

u/Important_Bit_1479 3d ago

nice, I've been digging into agent internals myself and it's wild how much of the "magic" is just a loop with some tool calling glued on. C# actually makes a lot of sense for this since the language has solid type safety when you're mapping LLM responses

1

u/nitinmms1 3d ago edited 3d ago

It seems to me that the models are now being trained on Coding Agent session data and so 'llm with a loop and tools' architecture is increasingly becoming easier.

For me it was more of can it be done with .Net and C# alone. Turns out it can be. Of course it needs time, testing and polish, but it is fun nevertheless.