How tuanduy35399/holland-career-rag-ml-api works
Holland Career GraphRAG is a FastAPI backend with two user-facing capabilities: predicting major groups from subject scores and Holland type, and advising on a specific major through conversational RAG. The chat flow routes a question through query rewriting, hypothetical-document generation, vector and graph retrieval, result fusion and reranking, then generates a sourced answer. A separate indexing workflow prepares major data for graph and vector search. The README documents Neo4j and an NVIDIA API key; sampled code also configures a local LLM endpoint. Some indexing and integration details are supported only by the index or README.
Main entry points: build_index.py Index Builder · retrieve.py Retriever · main.py FastAPI API · answer_generator.py Answer Generator
Components 24
API and Prediction
- FastAPI API
graphRAG/api/main.py - Major Predictor
graphRAG/api/main.py
Knowledge Indexing
- Index Builder
graphRAG/indexing/build_index.py - Major Loader
graphRAG/ingestion/loader/load_majors.py - Text Cleaning
graphRAG/ingestion/processes/clean_text.py - Text Normalizing
graphRAG/ingestion/processes/normalize.py - Metadata Extraction
graphRAG/indexing/metadata/extractor.py - BGE Embeddings
graphRAG/indexing/embedding/bge_m3.py - Graph Builder
graphRAG/indexing/graph/graph_builder.py - Neo4j Store
graphRAG/indexing/graph/graph_store.py - Chroma Store
graphRAG/indexing/vector/chroma.py
RAG Retrieval
- Retriever
graphRAG/retrieval/retrieve.py - Query Rewrite
graphRAG/retrieval/rewrite/query_rewrite.py - HyDE Query
graphRAG/retrieval/rewrite/hyde.py - Vector Search
graphRAG/retrieval/search/vector_search.py - Graph Search
graphRAG/retrieval/search/graph_search.py - Hybrid Fusion
graphRAG/retrieval/search/hybrid_search.py - Result Reranker
graphRAG/retrieval/reranker/bge_reranker.py
Answer Generation
- Answer Generator
graphRAG/llm/answer_generator.py - Prompt Templates
graphRAG/llm/prompts.py - Custom LLM
graphRAG/llm/custom.py
Other components
- User
- Neo4j Database
- Local LLM Endpoint
Connections 27
- User → FastAPI API: submits request
README.md - FastAPI API → Major Predictor: routes prediction
graphRAG/api/main.py - FastAPI API → Retriever: requests retrieval
graphRAG/api/main.py - FastAPI API → Answer Generator: generates answer
graphRAG/api/main.py - Index Builder → Major Loader: loads majors
graphRAG/indexing/build_index.py - Index Builder → Text Cleaning: cleans text
graphRAG/indexing/build_index.py - Index Builder → Text Normalizing: normalizes text
graphRAG/indexing/build_index.py - Index Builder → Metadata Extraction: extracts metadata
graphRAG/indexing/build_index.py - Index Builder → BGE Embeddings: configures embeddings
graphRAG/indexing/build_index.py - Index Builder → Graph Builder: builds graph
graphRAG/indexing/build_index.py - Index Builder → Chroma Store: creates vector index
graphRAG/indexing/build_index.py - Graph Builder → Neo4j Store: writes graph
graphRAG/indexing/build_index.py - Neo4j Store → Neo4j Database: connects to
README.md - Retriever → Query Rewrite: rewrites query
graphRAG/retrieval/retrieve.py - Retriever → HyDE Query: generates query
graphRAG/retrieval/retrieve.py - Retriever → Vector Search: searches vectors
graphRAG/retrieval/retrieve.py - Retriever → Graph Search: searches graph
graphRAG/retrieval/retrieve.py - Retriever → Hybrid Fusion: fuses results
graphRAG/retrieval/retrieve.py - Retriever → Result Reranker: reranks results
graphRAG/retrieval/retrieve.py - Query Rewrite → Prompt Templates: uses template
graphRAG/retrieval/rewrite/query_rewrite.py - HyDE Query → Prompt Templates: uses template
graphRAG/llm/prompts.py - Vector Search → Chroma Store: searches index
- Graph Search → Neo4j Store: searches index
- Answer Generator → Prompt Templates: builds prompt
graphRAG/llm/answer_generator.py - Answer Generator → Custom LLM: calls completion
graphRAG/llm/answer_generator.py - FastAPI API → Custom LLM: configures provider
graphRAG/api/main.py - Custom LLM → Local LLM Endpoint: calls endpoint
graphRAG/llm/custom.py