sentinel is a repository containing Python and Next.js components designed to integrate GitHub repository analysis, semantic search, and AI-driven code reviews. The backend leverages Python libraries such as LangChain, Groq, Sentence Transformers, and FAISS for semantic indexing and retrieval. The frontend is built with Next.js, React, and Tailwind CSS.
spirizeon-sentinel/
├── README.md
├── requirements.txt
├── sentinel.py
└── frontend/
├── README.md
├── eslint.config.mjs
├── next.config.ts
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── tsconfig.json
├── .gitignore
├── public/
└── src/
├── app/
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ ├── Gemini.tsx
│ ├── Globe.tsx
│ ├── Grid.tsx
│ └── ui/
│ ├── globe.tsx
│ ├── google-gemini-effect.tsx
│ └── layout-grid.tsx
├── data/
│ ├── globe.json
│ └── music_courses.json
└── lib/
└── utils.ts
- sentinel.py: Core Python script responsible for fetching GitHub repositories, embedding files using Sentence Transformers, indexing embeddings with FAISS, and generating AI-driven code reviews using LangChain and Groq.
- GitHub Integration: Fetches repository files and pull requests using PyGithub.
- Semantic Search: Embeds file contents into vector representations using Sentence Transformers (
all-MiniLM-L6-v2
) and indexes them with FAISS. - AI-driven Reviews: Generates constructive feedback on code quality, readability, optimization opportunities, robustness, security issues, and best practices using LangChain with Groq's
mixtral-8x7b-32768
model.
Function Name | Description |
---|---|
fetch_github_repo_files |
Retrieves files from a specified GitHub repository. |
update_rag_index |
Updates the FAISS index with embeddings of the latest repository files. |
search_faiss |
Performs semantic search within the indexed embeddings. |
generate_response |
Generates AI-driven responses based on user queries and context. |
process_github_repo |
Processes a GitHub repository to answer user queries. |
process_pull_request |
Automatically generates review comments for open pull requests. |
Key libraries include:
- LangChain ecosystem (
langchain
,langchain-core
,langchain-community
,langchain-groq
) - Groq API (
groq
) - Sentence Transformers (
sentence-transformers
) - FAISS (
faiss-cpu
) - PyGithub (
PyGithub
) - Flask (for potential API development)
- numpy, requests, python-dotenv
The frontend is built with Next.js 15.x and React 19.x, styled using Tailwind CSS.
- Gemini.tsx, Globe.tsx, Grid.tsx: UI components for interactive visualizations.
- Layout Components: Define global styles and page layouts.
To run the frontend locally:
npm install
npm run dev # or yarn dev / pnpm dev / bun dev
Visit http://localhost:3000
to view the application.
Key dependencies include:
- Next.js 15.x (
next
) - React 19.x (
react
,react-dom
) - Three.js ecosystem (
three
,@react-three/fiber
,@react-three/drei
) - Tailwind CSS (
tailwindcss
,@tailwindcss/postcss
) - Radix UI components (
@radix-ui/react-hover-card
) - ESLint for code quality enforcement
repo_name = 'Spirizeon/claxvim'
user_query = "What improvements can be made to error handling?"
result = process_github_repo(repo_name, user_query)
print(f"Query: {result['query']}")
print(f"Relevant files: {result['relevant_files']}")
print(f"Response: {result['response']}")
open_prs = get_open_pr_numbers("spirizeon", "claxvim")
if not open_prs:
print("Nothing to review!")
for pr_number in open_prs:
pr_result = process_pull_request('Spirizeon/claxvim', pr_number)
print(f"PR Review Status: {pr_result['status']}")
if 'review' in pr_result:
print(f"Review Comments:\n{pr_result['review']}")
The frontend can be easily deployed on Vercel:
- Connect your GitHub repository to Vercel.
- Configure build commands as per Next.js defaults.
- Deploy directly from the Vercel dashboard.
For backend deployment:
- Containerize the Python backend using Docker.
- Deploy on cloud platforms like AWS ECS, Google Cloud Run, or Azure Container Instances.
To contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/your-feature-name
). - Commit your changes (
git commit -am 'Add feature'
). - Push your branch (
git push origin feature/your-feature-name
). - Open a Pull Request on GitHub.
This project is licensed under the MIT License.