🌐 English · 한국어 · 日本語 · Français · Deutsch · Русский · Українська · 简体中文 · 繁體中文 · Tiếng Việt · ภาษาไทย · Português · Español
Switch providers, add RAG, load documents — all with a unified API.
📖 Get Started · API Reference · GitHub ↗
dotnet add package Mythosia.AI # start here (this is all you need)
dotnet add package Mythosia.AI.Rag # optional: when you need RAG
dotnet add package Mythosia.VectorDb.Postgres # optional: when you need a production vector store
| Step | Package | When |
|---|---|---|
| 1 | Mythosia.AI |
Start here — completions, streaming, function calling, structured output (OpenAI / Claude / Gemini / Grok / DeepSeek / Perplexity) |
| 2 | Mythosia.AI.Rag |
When you need RAG — text splitters, embeddings, hybrid search, reranking, InMemory vector store, and document loaders (Word / Excel / PowerPoint / PDF) |
| 3 | Mythosia.VectorDb.Postgres / Qdrant / Pinecone |
When you need a production vector store instead of InMemory — pick one |
graph TD
subgraph "🔗 Orchestration Layer"
Rag["<b>Mythosia.AI.Rag</b><br/>RagPipeline · TextSplitters<br/>EmbeddingProviders · HybridSearch · Reranking<br/><i>netstandard2.1 · v7.5.0</i>"]
end
subgraph "⚡ Core AI"
AI["<b>Mythosia.AI</b><br/>OpenAI · Anthropic · Google<br/>xAI · DeepSeek · Perplexity<br/><i>netstandard2.1 · v6.5.0</i>"]
AIAbs["<b>Mythosia.AI.Abstractions</b><br/>IAIService · shared models<br/><i>netstandard2.1 · v2.3.0</i>"]
end
subgraph "🔌 Provider Packages"
Alibaba["<b>Mythosia.AI.Providers.Alibaba</b><br/>Qwen / Alibaba provider package<br/><i>netstandard2.1 · v1.2.6</i>"]
end
subgraph "📄 Document Loaders"
Office["<b>Mythosia.Documents.Office</b><br/>Word · Excel · PowerPoint<br/><i>netstandard2.1 · v1.1.0</i>"]
Pdf["<b>Mythosia.Documents.Pdf</b><br/>PdfPig Parser<br/><i>netstandard2.1 · v1.1.1</i>"]
end
subgraph "📐 Composite Abstractions"
RagAbs["<b>Mythosia.AI.Rag.Abstractions</b><br/>ITextSplitter · IEmbeddingProvider<br/>IContextBuilder · IRetrievalStrategy · IReranker<br/>RagDocument<br/><i>netstandard2.1 · v6.2.0</i>"]
end
subgraph "🗄️ Vector Stores — pick one or more"
InMem["<b>Mythosia.VectorDb.InMemory</b><br/>Cosine Similarity · TopK · BM25<br/><i>netstandard2.1 · v4.1.0</i>"]
Pine["<b>Mythosia.VectorDb.Pinecone</b><br/>Managed Index · Namespace · Scope<br/><i>netstandard2.1 · v4.0.1</i>"]
Pg["<b>Mythosia.VectorDb.Postgres</b><br/>pgvector · HNSW · IVFFlat · HybridSearch<br/><i>net10.0 · v10.7.1</i>"]
Qd["<b>Mythosia.VectorDb.Qdrant</b><br/>gRPC · Cosine · Euclidean · Dot · HybridSearch<br/><i>netstandard2.1 · v4.1.1</i>"]
end
subgraph "🧱 Foundation Abstractions"
LoaderAbs["<b>Mythosia.Documents.Abstractions</b><br/>IDocumentLoader · IDocumentParser<br/>ParsedDocument · DoclingDocument<br/><i>netstandard2.1 · v1.2.0</i>"]
VdbAbs["<b>Mythosia.VectorDb.Abstractions</b><br/>IVectorStore · HybridSearchAsync · VectorRecord<br/>VectorFilter · VectorSearchResult · Bm25Tokenizer<br/><i>netstandard2.1 · v4.0.1</i>"]
end
%% Core AI internal
AI --> AIAbs
%% Orchestration → dependencies
Rag --> AIAbs
Rag --> Office
Rag --> Pdf
Rag --> RagAbs
Rag --> InMem
%% Provider packages → core
Alibaba --> AI
%% Composite → Foundation
RagAbs --> VdbAbs
%% Loaders → Foundation
Office --> LoaderAbs
Pdf --> LoaderAbs
%% VectorStores → Foundation
InMem --> VdbAbs
Pine --> VdbAbs
Pg --> VdbAbs
Qd --> VdbAbs
This repository includes a sample Chat UI built on Mythosia.AI — launch Mythosia.AI.Samples.ChatUi to test the library in action.
Run Mythosia.AI.Samples.ChatUi to try it locally:
# from repo root
dotnet run --project apps/Mythosia.AI.Samples.ChatUi2026-02-27.18-21-02.mp4
using Mythosia.AI;
var service = new OpenAIService(apiKey, httpClient);
var response = await service.GetCompletionAsync("Hello!");await foreach (var token in service.StreamAsync("Tell me a story"))
{
Console.Write(token);
}All reasoning-capable providers (OpenAI, Claude, Gemini, Grok, DeepSeek) share the same streaming pattern:
await foreach (var content in service.StreamAsync(message, new StreamOptions().WithReasoning()))
{
if (content.Type == StreamingContentType.Reasoning)
Console.Write($"[Think] {content.Content}");
else if (content.Type == StreamingContentType.Text)
Console.Write(content.Content);
}var service = new OpenAIService(apiKey, httpClient)
.WithFunction(
"get_weather",
"Gets the current weather for a location",
("location", "The city and country", required: true),
(string location) => $"The weather in {location} is sunny, 22C"
);
var response = await service.GetCompletionAsync("What's the weather in Seoul?");// Deserialize LLM responses directly into C# POCOs with auto-recovery
var result = await service.GetCompletionAsync<WeatherResponse>(
"What's the weather in Seoul?");// Collection types work directly — no wrapper DTO needed
var items = await service.GetCompletionAsync<List<ItemDto>>(
"Extract all entities from this document...");// Stream text chunks in real-time + get final deserialized object
var run = service.BeginStream(prompt).As<MyDto>();
await foreach (var chunk in run.Stream())
Console.Write(chunk); // real-time UI
MyDto dto = await run.Result; // parsed & auto-repaired// Automatically summarize old messages when conversation gets long
service.ConversationPolicy = SummaryConversationPolicy.ByMessage(
triggerCount: 20,
keepRecentCount: 5
);
// Token-based trigger
service.ConversationPolicy = SummaryConversationPolicy.ByToken(
triggerTokens: 3000,
keepRecentTokens: 1000
);
// Just use as normal — summarization happens automatically
await service.GetCompletionAsync("Continue our conversation...");
// For streaming, call summarization explicitly before StreamAsync()
await service.ApplySummaryPolicyIfNeededAsync();
await foreach (var chunk in service.StreamAsync("Continue..."))
Console.Write(chunk.Content);
// Save/restore summary across sessions
string saved = service.ConversationPolicy.CurrentSummary;
policy.LoadSummary(saved);dotnet add package Mythosia.AI.Ragusing Mythosia.AI.Rag;
var service = new AnthropicService(apiKey, httpClient)
.WithRag(rag => rag
.AddDocument("manual.txt")
.AddDocument("policy.txt")
);
var response = await service.GetCompletionAsync("What is the refund policy?");For agent-controlled retrieval, register the store with WithAgenticRag(...) and run either RunAgentAsync(...) or RunAgentStreamAsync(...). See Mythosia.AI.Rag README for full examples.
| Provider | Package | Models |
|---|---|---|
| OpenAI | Mythosia.AI |
GPT-5.5 / 5.5 Pro / 5.4 / 5.4 Mini / 5.4 Nano / 5.4 Pro / 5.3 Codex / 5.2 / 5.2 Pro / 5.2 Codex / 5.1 / 5 / 5 Pro / 5 Mini / 5 Nano, GPT-4.1 / 4.1 Mini / 4.1 Nano, GPT-4o / 4o Mini, o3 / o3 Pro |
| Anthropic | Mythosia.AI |
Claude Opus 4.8 / 4.7 / 4.6 / 4.5 / 4.1 / 4, Sonnet 4.6 / 4.5, Haiku 4.5 |
Mythosia.AI |
Gemini 3.1 Pro Preview, Gemini 3.5 Flash, Gemini 3 Flash Preview, Gemini 3.1 Flash-Lite, Gemini 2.5 Pro/Flash/Flash-Lite | |
| xAI | Mythosia.AI |
Grok 4.3, Grok 4.20 (reasoning / non-reasoning), Grok Build 0.1, Grok 3 Mini |
| DeepSeek | Mythosia.AI |
Chat, Reasoner |
| Perplexity | Mythosia.AI |
Sonar, Sonar Pro, Sonar Reasoning Pro |
| Alibaba / Qwen | Mythosia.AI.Providers.Alibaba |
Qwen Max / Plus / Turbo / Qwen3 / Qwen3.5 variants |
| Package | NuGet | Description |
|---|---|---|
| Mythosia.AI | Core library — built-in providers, streaming, function calling, and multimodal support | |
| Mythosia.AI.Abstractions | IAIService interface and shared models — lightweight contract package for libraries |
|
| Mythosia.AI.Providers.Alibaba | Alibaba / Qwen provider package built on top of Mythosia.AI |
| Package | NuGet | Description |
|---|---|---|
| Mythosia.AI.Rag | Fluent RAG extension for IAIService with .WithRag() API |
|
| Mythosia.AI.Rag.Abstractions | Interfaces and models for RAG pipeline components |
| Package | NuGet | Description |
|---|---|---|
| Mythosia.Documents.Abstractions | Document loader interfaces and models (IDocumentLoader, DoclingDocument) |
|
| Mythosia.Documents.Office | OpenXml parsers for Word / Excel / PowerPoint | |
| Mythosia.Documents.Pdf | PDF parser via PdfPig |
Pick one or more — all implement
IVectorStorefrom the Abstractions package.
| Package | NuGet | Description |
|---|---|---|
| Mythosia.VectorDb.Abstractions | IVectorStore · VectorRecord · VectorFilter contracts |
|
| Mythosia.VectorDb.InMemory | In-memory store — zero infrastructure, great for prototyping | |
| Mythosia.VectorDb.Pinecone | Pinecone HTTP API — index/namespace/scope isolation for managed vector DB | |
| Mythosia.VectorDb.Postgres | PostgreSQL + pgvector — HNSW / IVFFlat indexes, production-ready | |
| Mythosia.VectorDb.Qdrant | Qdrant gRPC client — Cosine / Euclidean / Dot, auto-provisioning |
src/
core/
Mythosia.AI/ # Core AI service library
Mythosia.AI.Abstractions/ # IAIService interface and shared models
Mythosia.AI.Providers.Alibaba/ # Alibaba / Qwen provider package
loaders/
Mythosia.Documents.Abstractions/ # Document loader contracts (IDocumentLoader, DoclingDocument)
Mythosia.Documents.Office/ # Office document loaders (Word/Excel/PowerPoint)
Mythosia.Documents.Pdf/ # PDF document loader
rag/
Mythosia.AI.Rag/ # RAG fluent API and pipeline
Mythosia.AI.Rag.Abstractions/ # RAG interfaces and models (RagDocument)
vectordb/
Mythosia.VectorDb.Abstractions/ # Vector store contracts
Mythosia.VectorDb.InMemory/ # In-memory vector store
Mythosia.VectorDb.Pinecone/ # Pinecone vector store
Mythosia.VectorDb.Postgres/ # PostgreSQL + pgvector store
Mythosia.VectorDb.Qdrant/ # Qdrant vector store
apps/ # Applications (samples & tools)
tests/ # Unit/integration test projects
dotnet add package Mythosia.AIFor advanced LINQ operations with streams:
dotnet add package System.Linq.Async- 📖 Full Documentation Site — DocFX-generated docs covering all features, RAG pipeline, vector stores, and API reference
- Basic Usage Guide
- Mythosia.AI README Full API reference with function calling, streaming, and model configuration
- Mythosia.AI.Rag README RAG pipeline usage and custom implementations
- Document Loaders
- Release Notes
This project is licensed under the MIT License.
This project was originally part of Mythosia.