π€ Silvio's Portfolio API: RAG-Powered Personal Assistant

π Overview
Silvio's Portfolio API is a next-generation interactive resume built on Retrieval-Augmented Generation (RAG) architecture.
Instead of reading a static PDF, recruiters and developers can chat with this API to ask specific questions about Silvio's experience, skills, and projects. It combines the reasoning power of Google Gemini with a precise Vector Knowledge Base (FAISS) to ensure every answer is factually grounded in Silvio's actual profile data, complete with source citations and relevance scores.
β¨ Key Features
π§ RAG Architecture (Retrieval-Augmented Generation)
Unlike standard chatbots that hallucinate, this engine:
- Retrieves relevant chunks from Silvio's structured profile (JSON/Text).
- Injects specific context into the LLM.
- Generates a precise answer referenced directly from the source.
π Transparent Source Citation & Scoring
Trust but verify. Every response includes a source_list object that proves the AI isn't making things up. It provides:
- Exact Content: The snippet of text used for reasoning.
- Similarity Score: A mathematical L2 Distance metric (e.g.,
0.51) indicating how closely the source matches the query.
Note: In FAISS L2, a lower score means a better match.
π£οΈ Context-Aware Conversation
Built with LangChain's Conversational Retrieval Chain, the API remembers previous turns in the chat (via history parameter), allowing for follow-up questions like "Tell me more about that project."
π‘οΈ Robust Backend
- Lazy Loading: Vector stores initialize only when needed to save resources.
- Google Gemini Embeddings: State-of-the-art semantic search.
- Dockerized: Fully containerized for consistent deployment across environments.
π οΈ Tech Stack
- Framework: FastAPI (Asynchronous)
- Orchestration: LangChain
- LLM & Embeddings: Google Gemini (Generative AI)
- Vector Database: FAISS (Facebook AI Similarity Search)
- Deployment: Hugging Face Spaces (Docker)
π The Processing Pipeline
- Query Ingestion: User asks, "What is Silvio's tech stack?"
- Vector Search: System embeds the query and finds the top 4 most similar chunks in
silvio_profile.json.
- Prompt Engineering: Constructs a strict system prompt enforcing the specific persona.
- LLM Inference: Google Gemini generates a natural language response based only on the retrieved chunks.
- Response: Returns the answer + source metadata + confidence scores.
π Integration Guide (API Contract)
Live Base URL
https://silvio0-silvio-portfolio-api.hf.space
Chat Assistant (Main Endpoint)
Interact with the AI to learn about Silvio.
- Endpoint:
/assistant
- Method:
POST
- Body (JSON):
{
"text": "Who is Silvio and what is his focus?",
"language": "English",
"history": []
}
{
"answer": "Silvio Christian Joe, known as Vio, is a highly driven 5th-semester Informatics Engineering undergraduate student at Universitas Dian Nuswantoro (UDINUS). He is an aspiring Data Scientist and AI Engineer based in Semarang, Central Java, Indonesia.\n\nVio specializes in **Natural Language Processing (NLP)** and **Tabular Data Analysis**, demonstrating a strong ability to transform raw data into meaningful insights. His expertise extends beyond just algorithms; he focuses on rigorous data preprocessing, effectively handling class imbalances using techniques like SMOTE/SMOTENC, and building robust, end-to-end solutions from model training to API deployment.\n\nHe is proficient in languages such as Python and SQL, and his data science toolkit includes libraries like Scikit-learn, Pandas, NumPy, Matplotlib, Seaborn, and NLTK. Vio is actively seeking internship opportunities to further apply and expand his skills in the field.",
"source_list": [
{
"doc_id": "28cf610e-3b82-4825-b625-1c6ddac96aa8",
"content": "{\n \"profile\": {\n \"name\": \"Silvio Christian Joe\",\n \"short_name\": \"Vio\",\n \"role\": \"Data Scientist & AI Engineer\",\n \"specialization\": \"Natural Language Processing (NLP) & Tabular Data Analysis\",\n \"university\": \"Universitas Dian Nuswantoro (UDINUS)\",\n \"current_semester\": 5,\n \"location\": \"Semarang, Central Java, Indonesia\",\n \"summary\": \"I am a 5th-semester Informatics Engineering undergraduate driven by curiosity to turn raw data into meaningful stories. I specialize in mining insights from structured numbers (Tabular) and unstructured language (NLP). My approach goes beyond algorithms; I focus on rigorous preprocessing, handling class imbalances (SMOTE/SMOTENC), and building end-to-end solutions from training to API deployment.\",\n \"availability\": \"Seeking Internship Opportunities\",\n \"quote\": \"Data is the new oil, but itβs useless without the engine to refine it.\"\n },\n \"contact\": {\n \"email\": \"viochristian12@gmail.com\",",
"source": "silvio_profile.json",
"score": 0.517580509185791
},
{
"doc_id": "3ff5bb20-ae54-443b-8bc4-4ab83496fbeb",
"content": "},\n \"contact\": {\n \"email\": \"viochristian12@gmail.com\",\n \"phone\": \"+62 895 3426 37871\",\n \"linkedin\": \"https://www.linkedin.com/in/silvio-christian-joe/\",\n \"github\": \"https://github.com/viochris\",\n \"address\": \"Jalan Bintoro VIIA No. 23A, Semarang\",\n \"cv_download\": \"https://github.com/viochris/viochris/raw/main/CV_Silvio_Christian_Joe_Data_Scientist.pdf\"\n },\n \"education\": [\n {\n \"institution\": \"Universitas Dian Nuswantoro (UDINUS)\",\n \"degree\": \"Bachelor of Informatics Engineering\",\n \"focus\": \"Data Science (NLP & Tabular Data)\",\n \"start_date\": \"August 2023\",\n \"end_date\": \"Present (Expected 2027)\",\n \"status\": \"Undergraduate Student\"\n },\n {\n \"institution\": \"SMA Kristen YSKI\",\n \"degree\": \"High School Diploma, Science\",\n \"start_date\": \"July 2020\",\n \"end_date\": \"May 2023\"\n }\n ],\n \"skills\": {\n \"languages\": [\"Python\", \"SQL\"],\n \"data_science\": [",
"source": "silvio_profile.json",
"score": 0.5361928939819336
},
{
"doc_id": "cfd2f84a-3848-4db2-970c-e98100384d03",
"content": "},\n {\n \"name\": \"Stuntify API\",\n \"domain\": \"API / MLOps\",\n \"role\": \"ML Engineer\",\n \"link\": \"https://github.com/viochris/Stuntify-API\",\n \"tech_stack\": [\"FastAPI\", \"Pydantic\", \"Scikit-Learn\"],\n \"description\": \"A high-performance inference engine serving real-time stunting predictions. Designed with strict Type Coercion, multi-artifact orchestration, and interactive Swagger documentation.\"\n },\n {\n \"name\": \"Insightify API\",\n \"domain\": \"NLP / API\",\n \"role\": \"Developer\",\n \"link\": \"https://github.com/viochris/Insightify-Sentiment-API\",\n \"tech_stack\": [\"FastAPI\", \"Transformers (RoBERTa)\", \"Pandas\"],\n \"description\": \"A dual-lingual (English & Indonesian) NLP microservice for sentiment analysis. Supports batch processing (Excel/CSV) and N-Gram keyword extraction.\"\n },\n {\n \"name\": \"DocuChat AI (Long Context)\",\n \"domain\": \"GenAI / LLM\",\n \"role\": \"Developer\",",
"source": "silvio_profile.json",
"score": 0.5770090818405151
},
{
"doc_id": "9a37ce03-7a8e-4804-9fec-49b68ec487f7",
"content": "\"issuer\": \"Coursera (IBM)\",\n \"year\": \"2025\"\n },\n {\n \"name\": \"Code Generation and Optimization Using IBM Granite\",\n \"issuer\": \"IBM\",\n \"year\": \"2025\"\n },\n {\n \"name\": \"Artificial Intelligence Essentials V2\",\n \"issuer\": \"Certiport / Relevant Body\",\n \"year\": \"2025\"\n }\n ],\n \"languages\": [\n {\n \"language\": \"Indonesian\",\n \"proficiency\": \"Native / Bilingual\"\n },\n {\n \"language\": \"English\",\n \"proficiency\": \"Professional Working Proficiency\"\n }\n ]\n}",
"source": "silvio_profile.json",
"score": 0.6120243668556213
}
]
}
π Interactive Documentation (Swagger UI)
Test the API directly in your browser without writing code:
- Access Docs: https://silvio0-silvio-portfolio-api.hf.space/docs
- Navigate: Click on
POST /assistant.
- Try it out: Enter your question and see the magic happen.
π¦ Local Installation
- Clone the Repository
git clone https://github.com/viochris/silvio-portfolio-api.git
cd silvio-portfolio-api
- Setup Environment Variables
Create a
.env file and add your Google Gemini API Key:
GOOGLE_API_KEY=your_actual_api_key_here
- Install Dependencies
pip install -r requirements.txt
- Run the Server
uvicorn api:app --reload
Output: Uvicorn running on http://127.0.0.1:8000
Author: Silvio Christian, Joe
"Data is the new oil, but itβs useless without the engine to refine it."