saherelm
c1173042d4
last ...
2026-10-31 05:49:17 +03:30
saherelm
ad8ea9c1dd
Integrate RAG into Chat Pipeline and Decouple Embedding Service
...
- AskAsync: accept Guid? projectId / conversationId; resolve defaults;
- AskAsync: ingest attached files into Conversation scope (replaceExisting)
via IXAiRAGService instead of Upload + Extract + raw content attachment;
- AskAsync: retrieve context (Conversation -> Project -> User -> Global)
and build a single System message: Introduction + ChatWithDocuments prompt
+ Context block (+ Project prompt);
- XAIServiceBase / XDefaultAiService / XDefaultThinkingAiService:
inject IXAiRAGService instead of IXFileProvider;
- Add IXAiEmbeddingService + XAiEmbeddingService; remove
IXDefaultEmbeddingService + XDefaultEmbeddingService;
- XAiEmbeddingServiceBase no longer inherits XAIServiceBase;
IXAiEmbeddingServiceBase / IXAiEmbeddingServiceControllerBase no longer
extend chat interfaces; XAiEmbeddingServiceControllerBase derives from
XBaseIdentityApiV1Controller;
- XAiRAGService: drop IXDefaultAiService dependency (removes circular
dependency); remove AskWithRAGAsync / AskWithRAGAsEnumerable; add file
reference (AddReference) for scoped ingests;
- KnowledgeController: remove POST Ask and POST AskStream;
- DI: add AddXRagService() and call it from Startup before AddXAiServices();
- Add XAiApiRagPromptName = "ChatWithDocuments";
- Knowledge scope factories default Type to XAiDefaultKnowledgeType;
- ChatWithDocuments ask request: TopK and MinScore are now required.
BREAKING: /Knowledge/Ask and /Knowledge/AskStream removed;
IXDefaultEmbeddingService replaced by IXAiEmbeddingService.
2026-10-30 19:46:20 +03:30
saherelm
37d4e622e9
Implement RAG Scopes, Remove ProxyController, Fix Pipeline Order and SSE Format
...
- RAG: real scopes with identifiers conversation/{id}/, project/{id}/, user/{ownerId}/, global/;
- RAG: ownership checks via GetProject/GetConversation; Global write requires admin role;
- RAG: tiered retrieval Conversation -> Project -> User -> Global (single embedding, dedup, TopK fill);
- RAG: apply Type filter, sanitize file names, enforce MaxFilesPerIngest/MaxFileSizeBytes/MaxDocumentsPerScope;
- RAG: store scope/scopeId/type/ownerId metadata; return it in documents and sources;
- RAG: add MigrateLegacyVectorsAsync + POST /Knowledge/MigrateLegacy ({ownerId}/... -> user/{ownerId}/...);
- Knowledge API: scope/scopeId on Ingest, Documents, DELETE Documents;
- Remove ProxyController (root route "{modelName}/{path}" + AllowAnonymous hijacked all 2-segment paths);
- Startup: ExceptionHandler("/error") + HSTS outside Development; Swagger only in Development;
static files before routing; CORS before model proxy; add /error endpoint;
- SSE: all stream endpoints use xHttpService XSseExtensions; validate before streaming;
pre-stream errors return proper HTTP status; remove "Connection: keep-alive";
- Use xAiModels.Constants for XAiKnowledgeScope / Knowledge constants / XOpenAINoKey;
- Register XAiVectorEntityRegisterar in XAiApiDbContext;
- XCodeFileContentExtractor: actually read stream content; drop hard-coded "book.epub".
BREAKING: AskTextStream emits data: {"text":"..."}; AskStream emits data: {json}; both end with event: done.
2026-10-29 19:59:18 +03:30
saherelm
d3ecc8feea
Last Refactor Works for Improvement ...
2026-10-29 14:17:11 +03:30
saherelm
9e82e05bfe
Add Persistent Knowledge RAG Service and API
...
- Add IXAiRAGService and XAiRAGService for Extract -> Chunk -> Embed -> Store;
- Add synchronous and streaming RAG answers with sources;
- Add Knowledge models and KnowledgeController endpoints;
- Register IXAiRAGService as scoped;
- Keep current identifier: {ownerId}/{fileName}#{chunkIndex}.
2026-10-26 17:51:39 +03:30
saherelm
fef38cad1b
Fix Jinja Conversation Role Alternation in RAG Context History
...
- Merge Introduction prompt, RAG prompt and context block into one System message;
- Keep the user question as the following User message;
- Prevent consecutive System roles in AskWithContextAsync and AskWithContextAsEnumerable;
- Update the GetContextHistory XML documentation to describe the new message layout;
- Preserve the existing context retrieval and response flow.
- ...
2026-10-26 10:43:17 +03:30
saherelm
47da04a594
Implement Chat With Documents (In-Memory RAG) ...
...
- Add XAiDocumentModels (IngestResult, AskRequest, Answer, AnswerChunk, Source, SessionInfo, RAGDescriptor DTOs);
- Add AskWithContextAsync and AskWithContextAsEnumerable (Context Actions) to IXAiServiceBase and XAIServiceBase;
- Add GetContextHistory and BuildContextBlock Helpers for Building RAG Chat History without Persisting;
- Rewrite ChatWithDocumentsController with Ingest, Ask, AskStream (SSE), Get Session and Delete Session Endpoints;
- Add XInMemoryVectorStoreCleanupService (BackgroundService) for Removing Expired Sessions Periodically;
- Add AddXAiChatWithDocuments DI Extension, Register Cleanup HostedService and use it in Startup;
- Add RAGDescriptor Property to XAiApiConfiguration and its Section to appsettings.Development.json;
- Add ChatWithDocuments System Prompt to Prompts in appsettings.Development.json;
- Add IsValid Extension Method for XAiDocumentAskRequest;
- Optimize XInMemoryVectorStore.Search (Query Embedding Converted once) and Refactor Formatting;
- Remove Unused Usings in XAIServiceBase and IXAiServiceBase;
- ...
2026-10-25 22:24:39 +03:30
saherelm
4b857de518
- Add Proxy Configuration in AppSettings;
...
- Remap Proxy Configurations in AiApiConfiguration;
- Implement AiModelProxy Middleware for Proxifing Requests to Models;
- ad DI Extensions Method for Handling Proxy Middleware Usage in AiApi;
- Implement Proxy Middleware for Handling Proxifying Requests to Models for Test;
2026-10-23 19:58:35 +03:30
saherelm
ddfa7979a5
last ...
2026-10-21 17:55:12 +03:30
saherelm
7cad889cd0
last ...
2026-10-03 17:42:36 +03:30
saherelm
aac3eb92c1
Start Add File Support in Messages Feature ...
2026-09-30 23:13:32 +03:30
saherelm
efaf71d962
last ...
2026-09-30 15:27:39 +03:30
saherelm
383e42a8d2
last ...
2026-09-29 17:41:48 +03:30
saherelm
767479e80d
last ...
2026-09-28 16:35:04 +03:30
saherelm
b596afbe57
last ...
2026-09-26 16:46:30 +03:30
saherelm
ed8a66f432
refactor for better support of streaming and etc ...
2026-09-26 10:46:14 +03:30
saherelm
ae2713eddd
fix typos ...
2026-09-19 12:14:44 +03:30
saherelm
7b1f16bd18
last works on AiApi:
...
- Default Ai Service and Controller;
- Default Embeding and Controller;
- ...
2026-08-15 17:25:33 +03:30
saherelm
a4bcde5994
last ...
2026-08-15 10:49:08 +03:30
saherelm
9caf46a266
fix issues and build and run Successfully ...
2026-07-29 09:05:36 +03:30
saherelm
a3b3e69e53
Cleanup and Backup Exists AiApi and Create a New .net 10 App and Configureit for using xDashboard ...
2026-07-24 23:10:06 +03:30
saherelm
6b869e82d8
last ...
2026-05-06 04:41:48 +03:30
saherelm
f7184c7b79
last works ...
2026-04-30 12:01:56 +03:30
saherelm
2b5e09912f
last ...
2026-04-27 21:43:06 +03:30
saherelm
8868afe656
last ...
2026-04-17 03:04:14 +03:30
saherelm
43d0433a8e
Fix Stream Issues ...
2026-04-16 23:06:02 +03:30
saherelm
509acc1488
last ...
2026-04-16 16:02:26 +03:30
saherelm
ce1d96078f
last ...
2026-04-14 23:53:46 +03:30
saherelm
81ea808377
last ...
2026-04-10 23:51:44 +03:30
saherelm
e4ddceafa0
last ...
2026-04-10 17:41:01 +03:30
saherelm
523ad16b3c
last ...
2026-04-09 17:02:13 +03:30
saherelm
843aff3879
Add support for SemanticKernel and Build Project ...
2026-04-04 04:50:55 +03:30
saherelm
058b55f4fa
Add Required Stuffs to running Project on net8.0 ...
2026-04-04 00:11:31 +03:30
saherelm
f863f49af7
Initial ...
2026-03-23 19:13:06 +03:30