Feature/be 018 ai assistant - #323
Open
spartan124 wants to merge 3 commits into
Open
Conversation
Contributor
|
Resolve conflicts; edit issue reference @spartan124 |
# Conflicts: # PR_MESSAGE.md # package-lock.json # package.json # prisma/schema.prisma # src/ai-assistant/ai-assistant.module.ts # src/app.module.ts # src/generated/client/browser.ts # src/generated/client/client.ts # src/generated/client/commonInputTypes.ts # src/generated/client/internal/class.ts # src/generated/client/internal/prismaNamespace.ts # src/generated/client/internal/prismaNamespaceBrowser.ts # src/generated/client/models.ts # src/generated/client/models/SybilExplanation.ts # src/generated/client/models/User.ts # src/generated/client/models/WorldIdVerification.ts # src/jobs/jobs.service.spec.ts # src/jobs/jobs.service.ts
Author
|
@dDevAhmed conflicts resolved and PR description updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Overview
This PR introduces the server-side infrastructure that powers TruthBounty's intelligent AI
Assistant. The API acts as the core orchestration layer between verified protocol state and
external Large Language Models (LLMs), allowing contributors to safely interact with the
protocol via natural language.
By using Retrieval-Augmented Generation (RAG) and maintaining strict read-only execution
constraints, we ensure the assistant remains a helpful guide without ever becoming a source of
unverified truth.
🚀 What Changed
ConversationandMessagetables to the Prisma schema,paired with standard CRUD endpoints (
AiAssistantController) for chat history retention.RagServicewhich retrieves and sanitizes verifiedprotocol state (claims, reputation, governance) into the LLM context payload.
LlmProviderServiceto support routing requeststo multiple providers (e.g. OpenAI
gpt-4o-mini, Anthropicclaude-3-haiku).JwtAuthGuardensuring users can only interact with andview their own private conversation sessions.
AiUsageMetricmodel to track token consumption(prompt/completion) and request latency for cost monitoring.
docs/AI_ARCHITECTURE.md(System design & flow)docs/PROMPT_ENGINEERING_GUIDE.md(System prompt tuning guidelines)PrismaClientInitializationErrorinschema.prismaby standardizing theprovider dialect for
v7.src/jobs/jobs.service.ts.🛠 Testing
src/ai-assistant/ai- assistant.service.spec.ts).mainand verified integration with recentAdmin/Profiler modules.
🔗 Closes