Skip to content

A next-generation AI Assistant platform built with ASP.NET Core 8. Implements Onion/Clean Architecture, Repository Pattern, and Unit of Work. Features include real-time chat, LLM API integration, secure identity management, and dynamic RAG (Retrieval-Augmented Generation) capabilities.

Notifications You must be signed in to change notification settings

enesimo16/MelesAI-NextGen-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MelesAI: Intelligent Multi-Conversation Platform

.NET Architecture MVC API AI ORM Mapper

MelesAI is a robust, scalable, and secure AI conversation platform engineered with Clean Architecture principles. It bridges the gap between complex LLM interactions and user-friendly web interfaces, offering features like real-time streaming, dynamic context management, and provider-agnostic AI integration.


Key Features

Core Architecture & Infrastructure

  • Clean Architecture: Strictly decoupled layers (Core, Data, Service, API, Web) ensuring maintainability, testability, and separation of concerns.
  • Async & Resilience: Built from the ground up with asynchronous patterns and retry policies to handle API failures gracefully.
  • Data Isolation: Multi-tenant design where every user's data is strictly isolated, ensuring privacy and security.
  • Rate Limiting: Intelligent throttling mechanisms to prevent abuse and manage API quotas effectively.

AI & Conversation Intelligence

  • Multi-Conversation Support: Users can manage concurrent chat sessions with distinct contexts and histories.
  • Provider Abstraction: flexible backend that supports swapping AI providers (e.g., Groq, Ollama/Local AI, OpenAI) without code changes.
  • Streaming (Typewriter Effect): Real-time, token-by-token response streaming using Server-Sent Events (SSE) for a responsive UX.
  • Streaming Cancel & Resume: Full control for users to interrupt generation and resume or regenerate as needed.
  • Conversation State Machine: sophisticated state management to handle complex dialogue flows and transitions reliably.

Memory & Context Management

  • Memory Scope (Persona/Profile): Dynamic system prompts that adapt to the user's occupation, interests, and tone preferences.
  • Context Window Optimization: Automated summarization and quiz generation to keep the context window efficient without losing critical history.
  • Memory Opt-in / Opt-out: Granular user control over what data the AI retains for future interactions.
  • Cost Awareness: Built-in token usage tracking and cost estimation logic to monitor AI resource consumption.

Security & Observability

  • Auth + Session Management: Secure authentication via ASP.NET Core Identity with persistent session handling.
  • Prompt Injection Protection: Advanced sanitization layers to detect and neutralize malicious prompt engineering attacks.
  • AI Request Tracing: Comprehensive logging of the request/response lifecycle for debugging and performance monitoring.
  • Data Privacy: Strict adherence to data isolation protocols.

Developer Experience & UI

  • Syntax Highlighting (Markdown): Rich text rendering with highlight.js support for code blocks in multiple languages.
  • Tool Registry: A centralized registry for defining and managing AI-callable functions (Tools).
  • Deterministic Tool Execution: Ensures tools invoked by the AI produce predictable and reliable outputs.
  • Unit Testing: Extensive test coverage for core business logic and services.
  • Documentation: Comprehensive README and design documents located in the /docs directory.
  • Project Management: Trackable progress via GitHub Issues and Milestones.

Architecture Overview

The project follows a strict N-Layered Architecture:

  1. MelesAI.Core: Contains the domain entities, DTOs, and abstract interfaces. It has no dependencies.
  2. MelesAI.Data: Implements the database context (EF Core), migrations, and repositories.
  3. MelesAI.Service: Contains the business logic, AI provider implementations (Groq/Ollama), and AutoMapper profiles.
  4. MelesAI.API: Exposes RESTful endpoints and handles JWT authentication and SSE streaming.
  5. MelesAI.Web: A modern MVC frontend using Bootstrap 5 and vanilla JavaScript for interactivity.

Technology Stack

Category Technology
Framework .NET 8, ASP.NET Core
Database MS SQL Server (Entity Framework Core)
AI Providers Groq (Llama 3.3), Ollama (Local Models)
Frontend MVC, Bootstrap 5, JavaScript (ES6+)
Libraries Marked.js, Highlight.js, jsPDF, AutoMapper
Security ASP.NET Core Identity, JWT, User Secrets

Getting Started

Prerequisites

  • .NET 8 SDK
  • SQL Server (LocalDB or Docker)
  • Groq API Key (optional, for cloud inference)

Installation

  1. Clone the repository

    git clone [https://github.com/yourusername/MelesAI.git](https://github.com/enesimo16/MelesAI.git)
    cd MelesAI
  2. Configure User Secrets (Securely) Avoid hardcoding keys. Use the .NET Secret Manager:

    cd MelesAI.API
    dotnet user-secrets init
    dotnet user-secrets set "Groq:ApiKey" "YOUR_GROQ_API_KEY"

3 Configure Database (LocalDB) The project is pre-configured to use SQL Server LocalDB for development. Ensure your appsettings.Development.json (in MelesAI.API) or User Secrets contains the correct connection string:

```json
"ConnectionStrings": {
  "SqlServer": "Server=(localdb)\\mssqllocaldb;Database=MelesAIDb;Trusted_Connection=True;MultipleActiveResultSets=true"
}
```
  1. Database Migration Apply the schema to your local database:

    dotnet ef database update --project ../MelesAI.Data
  2. Run the Application Set multiple startup projects (API + Web) in Visual Studio, or run them via terminal:

    # Terminal 1
    dotnet run --project MelesAI.API
    # Terminal 2
    dotnet run --project MelesAI.Web

Screenshots

Home

  • A streamlined central hub designed to manage your AI interactions, providing quick access to recent activities and the ability to initiate new conversations instantly.
image

Chat

  • An advanced chat interface featuring real-time response streaming, conversation organization tools like pinning and archiving, and an integrated system for context-aware note-taking.
image

Profile & Personalization

  • A dedicated settings area where you define your professional identity and interests, enabling the AI to dynamically tailor its persona and responses to your specific needs.
image

Contributing

Contributions are welcome! We follow a structured workflow:

  1. Check the Issues tab for open tasks.
  2. Fork the project and create a feature branch.
  3. Ensure all Unit Tests pass.
  4. Submit a Pull Request detailed with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.


*Built with by Enes Yel

About

A next-generation AI Assistant platform built with ASP.NET Core 8. Implements Onion/Clean Architecture, Repository Pattern, and Unit of Work. Features include real-time chat, LLM API integration, secure identity management, and dynamic RAG (Retrieval-Augmented Generation) capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published