0% found this document useful (0 votes)
15 views19 pages

Development of An AI Personal Code Assistant

Uploaded by

allelayessine2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views19 pages

Development of An AI Personal Code Assistant

Uploaded by

allelayessine2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Summer Internship

Development of an AI personal Code Assistant

Manel Hassairi

Supervisors:
Mr. Mahdi Ghribi
Mrs. Sirine Mseddi 1
PLAN
Company
Context And Solution
System Design
Features
Tools
Performance Test
Outlook

2
Company

Lunar TC, founded in 2020 in Sfax, Tunisia,


is a company specialized in workflow
organization and digital transformation.

Its no-code platform, Lunflow, enables


companies to quickly convert manual,
paper-based workflows into fully digital
processes.

3
Context And Solution

Chatbots have become part of our daily lives.


Yet, most remain generic, limited to what they
already know.

what if we needed an assistant that truly


understands our context, can access our own
data and provide precise answers?

That is what Lunar TC aimed to achieve, creating


an assistant that can provide company-specific
answers.
4
Solution
A conversational AI assistant that
helps interacting with company code
while also answering general
questions through a user-friendly
interface.

5
System Design
Generative artificial intelligence
Generative AI is a branch of artificial intelligence that
focuses on creating new, original content rather than
just analyzing existing data.

GENERATORS CHATBOTS ASSISTANTS AI AGENTS

Create content like Provide interactive Help with tasks like perform complex
text or images. answers. drafting emails. tasks, using
reasoning to make
decisions.

6
Large Language Models

Advanced AI models trained on vast amounts


of text data.

Generate coherent responses by predicting


word sequences.

Not to be confused with chatbots as they serve


as the core intelligence behind them.

Open-source: LLaMA 3, Mistral.


API keys: GPT-4, Gemini.
7
Query-to-Response Flow

Basic Flow:

1. User Query 3. Output Generation


The user provides The system produces a
a question. coherent and appropriate
answer.

LLM

2. Processing
The system interprets
the query by the LLM,
using patterns learned
during training. 8
Extended Flow:

To perform specialized
tasks.

By adding Retrieval-Augmented Generation (RAG), the system can access relevant


information from personal sources. 9
Retrieval-Augmented Generation (RAG)
Unlike regular chatbots, RAG-based systems can use information from
user-provided documents or databases and integrate it into responses.

Knowledge Base processing

10
In a RAG system:

Retriever: System converts the user query into an embedding and searches the
vector database for the most relevant chunks using similarity scores.

Generator: When the LLM Uses the query and retrieves chunks to produce a
coherent response.

11
Workflow

In addition to code specific


queries, the system can also
respond to general questions
that are unrelated to the user’s
personal code. That is why it
follows a hybrid workflow
composed of two main chains.

12
Prompt
Prompt is the input provided to the LLM,
which it uses to generate a response.

User queries: The specific question the user


wants the model to address.

Chat history and context: to maintain


continuity in the conversation.

System prompts: Instructions that define the


model’s persona, tone and behavior.

RAG Prompt: “Use ONLY the following documents to answer questions.”


LLM Fallback Prompt: “You are LUNA, a warm and friendly assistant.” 13
Features
Code Handling
Language Detection:
The system automatically identifies
the programming language of code
returned by the model.

Syntax Highlighting:
All code blocks are displayed using
color-coded highlighting. This helps
developers quickly identify key
elements such as class names.
14
Source Attribution

To build user trust, each


answer clearly indicates its
origin. Users can see whether
a response is derived from
the code base through the
RAG chain or from general
knowledge via the LLM
fallback chain.

15
Tools
Ollama: runs large language models locally
LLaMA 3: the LLM used to power the assistant’s core
intelligence.

LangChain: Manages workflows, memory, and RAG–LLM


coordination to ensure accurate responses.

FAISS: organizes data as vector embeddings, allowing fast and


accurate similarity-based searches.

Flask: provides the web interface.


16
Performance Test
Multiple tests were conducted on a
large, multi-language codebase.

Tests confirmed that all system


components worked effectively
across all scenarios including.

Code specific queries.


General questions.
Code blocks handling.
Source attribution.

17
Outlook

The AI Personal Code Assistant provides accurate


responses, but its performance depends on how
closely queries match the documentation. Future
improvements can include fine-tuning with
project-specific knowledge, expanding memory,
and integrating external tools.

18
19

You might also like