Skip to content

Commit 9388a57

Browse files
authored
Merge pull request #9 from BrataBuilds/main
Updated the project directory, Refactored the backend codebase, added better instructions on Contributing.md and improved the readme
2 parents b688ebf + 37dc05e commit 9388a57

27 files changed

+369
-336
lines changed

CONTRIBUTING.md

Lines changed: 78 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,91 @@
11
# CONTRIBUTING
22
This document contains the list of issues, suggestions and improvements that can be added to this project and a proper guide on how to contribute to the project.
3+
- [CONTRIBUTING](#contributing)
4+
- [Registration](#registration)
5+
- [Guildlines :](#guildlines-)
6+
- [List of major issues :](#list-of-major-issues-)
7+
- [List of Improvements and Suggestions](#list-of-improvements-and-suggestions)
8+
- [Improvments to the UI](#improvments-to-the-ui)
9+
- [Long-term Goals :](#long-term-goals-)
10+
- [Improvements to Backend :-](#improvements-to-backend--)
11+
- [Long term Goals :](#long-term-goals--1)
12+
- [In game control :](#in-game-control-)
13+
- [Cross platform compatibility :](#cross-platform-compatibility-)
14+
- [Other Known Bugs and Issues : 🪲](#other-known-bugs-and-issues--)
315

416
## Registration
5-
To be eligible for MLSA X HACKTOBERFEST:
6-
[Star this repo](https://github.com/keploy/keploy)
7-
[Register here for MLSAKKIIT](https://register.mlsakiit.com/)
8-
[Register on HacktoberFest](https://hacktoberfest.com/auth/)
17+
>[!important] Attention
18+
All contributors must do the following to be eligible for MLSA X HACKTOBERFEST:
19+
- [Star this repository](https://github.com/keploy/keploy)
20+
- [Register here on MLSA KIIT website](https://register.mlsakiit.com/)
21+
- [Register on HacktoberFest Official Website](https://hacktoberfest.com/auth/)
922

1023
## Guildlines :
1124
Adhere to [Hacktober Fest Guidlines](https://hacktoberfest.com/) and maintain common ettiquette of contributing to an open source project.
1225

1326
If you have any questions regarding contributing to this repository please contact the contributor.
1427

1528
<!-- (link to the whatsapp group) -->
29+
### List of major issues :
30+
>[!IMPORTANT]
31+
It is highly recommended for contributors to first have a look at the list of major issues work on them with higher priority.
1632

17-
## UI Improvements
18-
1. Add markdown support for gemini's reponses.
19-
2. Improve the chat window UI such that it is easier to tell apart the messages of the user and Pixly.
20-
3. Add the ability to view images results from the web and play recommended youtube videos directly within the overlay.
21-
4. Make the window resizable and all window elements scalable.
22-
5. Add window control buttons for minimise and fullscreen (to be added after the previous implementation)
33+
**Related to UI :-**
34+
1. Make the window resizable and all window elements scalable.
35+
2. Add window control buttons for minimise and fullscreen (to be added after the previous implementation)
36+
3. Whenever you hover over the screenshot button, placehoder text is inserted in the chatbox but it doesn't go away after you stop hovering, and you have to manually press backspace to remove the text.
37+
4. Refactor the codebase of the overlay modular so that it is easier to work with.
38+
39+
**Frontend+Backend :-**
40+
1. Chat history is not stored, if you try to follow up gemini with what you asked in the previous chat it will have 0 idea what you are talking about.
2341

24-
### Long-term Goals :
25-
6. Add the ability for users to add custom themes of the overlay, different themes belonging to different games, so when the overlay can automatically apply a certain theme when a particular game is detected.
42+
>[!TIP] Here is a suggested solution:
43+
Store the chats of the user in a database, (we are already using sqlite for screenshots, might as well use it), then when we give a new prompt to gemini, old chats are added to the prompt.
44+
- Only store the last 30 chats or so.
45+
- Every game will have its own database table, i.e. chats are stored on a per game basis.
46+
- Additional meta-data such as timestamp should also be stored so when user asked "What did I do yesterday?" it should be able to retrieve the screenshot from 24 hours ago etc.
2647

27-
## Main Improvements
28-
1. Chat history is not stored, add the ability to store the chat history the user across various sessions, preferably in a per game basis, in the vector database.
2948

30-
>[!Important] Also add the ability to view the stored chats across various sessions/games from the overlay, add the configuration in the settings menu to delete and edit them. Add a setting to set how many chats per game/session to store.
31-
32-
2. Make a better system for sending existing screenshots. Improve the keyword search and allow user to edit the prompt before sending the screenshot instead of using the default prompt. Allow the chatbot agent to automatically pull a screenshot based on a given time and date duration.
33-
34-
3. Add more entries about wikis, guides, youtube videos, forum posts about more games, especially single player story based titles like `Elden Ring, Hollow Knight : Silksong, Black Myth: Wukong,Cyberpunk 2077`
35-
36-
4. Add cross platform support, (change the win32 dependency to an alternative)
37-
38-
5. Improve the project structure to better align with [best practices](https://github.com/zhanymkanov/fastapi-best-practices) when using FastAPI. The project already defines pydantic schemas. Also Example project structure. :
39-
```
40-
backend/
41-
42-
├── main.py # Entry point (FastAPI app)
43-
44-
├── routers/ # Route definitions (API endpoints)
45-
│ ├── chat.py
46-
│ ├── screenshots.py
47-
│ ├── game_detection.py
48-
│ └── knowledge.py
49-
50-
├── schemas/ # Pydantic models
51-
│ ├── chat.py
52-
│ ├── screenshot.py
53-
│ ├── game_detection.py
54-
│ └── knowledge.py
55-
56-
├── services/ # Business logic / helper functions
57-
│ ├── chatbot.py
58-
│ ├── screenshot_service.py
59-
│ ├── knowledge_service.py
60-
│ └── vector_service.py
61-
62-
└── core/
63-
├── config.py # Settings, env vars, constants
64-
└── logger.py # Central logging setup
65-
66-
```
49+
>[!Important] UI/UX Addition :
50+
- Add the ability to view the stored chats across various sessions/games from the overlay.
51+
- Add the configuration in the settings menu to read, delete and edit them.
52+
- Add a setting to set how many chats per game/session to store.
53+
54+
**Backend :-**
55+
1. Chroma db vector collections aren't searched properly, this may have to do with the chroma client not being initialised properly or the collections are not being created properly in `get_or_create_collection()` or the incorrect implementation of `search_knowledge()` in *vector_service.py*. This issue requires a more thorough investigation.
56+
2. Web Scrapper in *knowledge_manager.py* sometimes gets blocked by certain websites, (*namely* the ones present in *minecraft.csv*)
57+
>[!tip] Recommended Solutions :
58+
- Use Proxies to circumvent IP bans.
59+
- Rotate a list of User Agents and headers.
60+
- Make it asynchronous using `asyncio + httpx`
61+
62+
63+
64+
65+
## List of Improvements and Suggestions
66+
>[!tip] Feel free to give us any of your ideas, suggestions and feedback to add to this list.
67+
68+
### Improvments to the UI
69+
1. Add Markdown support for Gemini's reponses.
70+
2. Improve the chat Window UI such that it is easier to tell apart the messages of the user and Pixly.
71+
3. Add the ability to view images results from the web and play recommended youtube videos directly within the overlay.
72+
73+
74+
75+
#### Long-term Goals :
76+
1. Add the ability for users to add custom themes of the overlay, different themes belonging to different games, so when the overlay can automatically apply a certain theme when a particular game is detected.
77+
78+
### Improvements to Backend :-
79+
80+
1. Add more .csv entries about wikis, guides, youtube videos, forum posts about more games, especially single player story based titles like `Elden Ring, Hollow Knight : Silksong, Black Myth: Wukong,Cyberpunk 2077`
81+
2. Implement a Better way to store screenshots:
82+
>[!tip] Suggested Improvemments :
83+
- Vectorise the screenshots as well.
84+
- Add tool calling for the agent to call a tool to retrieve the screenshot from a specific time or from a specific game.
85+
1. Improve the Web Scrapper :
86+
87+
In Addition to fixing the above issues, add the ability to scrape youtube audio transcriptions.
88+
6789

6890
### Long term Goals :
6991
#### In game control :
@@ -73,9 +95,10 @@ Add the ability for the agent to control the game and play the game for you and
7395
Reliance on the win32 api for taking screenshots means we can't transition to a different platform, and are stuck with Windows for now.
7496
In the future we may wanna add cross platform compatibility with Linux.
7597

76-
## Known Bugs and Issues : 🪲
98+
## Other Known Bugs and Issues : 🪲
99+
> [!important] These are a bit obscure and their causes aren't known yet.
100+
1. Overlay hangs and then crashes when turning off the *enable screenshots setting.*
101+
2. `game_detection.py`, it reports the incorrect game being detected, in some cases.
102+
3. After adding your API Key from the overlay, sometimes it shows that the user has added their key, sometimes it doesn't.
77103

78-
1. Overlay hangs and then crashes when turning off the enable screenshots setting.
79-
2. Diagnose `knowledge_manager.py`, it is unable to scrape the given webpages. Returns a `403: Forbidden Error`, Possibly has to do with anti-bot anti-web_scraping measures.
80-
3. Diagnose `game_detection.py`, sometimes it always reports the current game being played as minecraft.
81104

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Pixly - Your AI Gaming Assistant 🎮
1414

1515
Pixly is a desktop overlay that acts as your gaming assistant, combining AI chat with automated, privacy-friendly screenshot capture and a game-specific Retrieval-Augmented Generation (RAG) knowledge base. Pixly detects what game you're playing, retrieves relevant, curated knowledge (wikis, user-supplied YouTube descriptions, and forum posts) via a local vector database, and grounds Gemini responses on those sources.
1616

17-
**🎃 Hacktoberfest 2025 Participant** | Join us in making gaming more accessible with AI! Also make sure to [star this repo](https://github.com/keploy/keploy).
17+
Make sure to star our repository, your support is much appreciated.
18+
19+
>[!important] 🎃 Hacktoberfest 2025 Participant
20+
Please make sure to [star this repo](https://github.com/keploy/keploy).
1821
## 📋 Table of Contents
1922

2023
- [📋 Table of Contents](#-table-of-contents)
21-
- [🎮 What Pixly Does](#-what-pixly-does)
2224
- [🤝 Contributing, Setup and Install](#-contributing-setup-and-install)
23-
- [🎃 Hacktoberfest 2025 - How to Contribute](#-hacktoberfest-2025---how-to-contribute)
25+
- [🎮 What Pixly Does](#-what-pixly-does)
2426
- [🏗️ Architecture Overview](#️-architecture-overview)
2527
- [1) UI Overlay (`overlay.py`)](#1-ui-overlay-overlaypy)
2628
- [2) Backend API (`backend/`)](#2-backend-api-backend)
@@ -35,32 +37,22 @@ Pixly is a desktop overlay that acts as your gaming assistant, combining AI chat
3537
- [📄 License](#-license)
3638
- [🙏 Acknowledgments](#-acknowledgments)
3739

38-
## 🎮 What Pixly Does
39-
40-
- 🤖 Intelligent, game-focused chat using Google Gemini with a "Game Expert" system prompt
41-
- 🎯 Contextual help based on your active game (process detection and/or user message)
42-
- 📸 Optional screenshot-powered context for visual analysis
43-
- 🔍 RAG pipeline over per-game CSV knowledge with local vector search (Chroma)
44-
- 💻 Modern desktop overlay for chatting, settings, and screenshot gallery
45-
4640
## 🤝 Contributing, Setup and Install
4741

4842
**We welcome Hacktoberfest 2025 contributors!** Whether you're adding new games to the knowledge base, improving the UI, or enhancing AI capabilities, your contributions matter.
4943

5044
- 📖 For Contributing Visit [CONTRIBUTING.md](https://github.com/MLSAKIIT/pixly/blob/main/CONTRIBUTING.md)
5145
- ⚙️ For Setup and Installation visit [INSTALL.md](https://github.com/MLSAKIIT/pixly/blob/main/INSTALL.md)
5246

53-
### 🎃 Hacktoberfest 2025 - How to Contribute
5447

55-
This project is participating in **Hacktoberfest 2025**! Here are some ways you can contribute:
48+
## 🎮 What Pixly Does
5649

57-
1. **Add Game Knowledge**: Contribute CSV files with game wikis, YouTube videos, and forum links
58-
2. **Improve Documentation**: Enhance README, add tutorials, or create guides
59-
3. **Fix Bugs**: Check our issues and help resolve reported bugs
60-
4. **Add Features**: Implement new features like support for more games or UI improvements
61-
5. **Optimize Performance**: Improve RAG retrieval, vector search, or screenshot handling
50+
- 🤖 Intelligent, game-focused chat using Google Gemini with a "Game Expert" system prompt
51+
- 🎯 Contextual help based on your active game (process detection and/or user message)
52+
- 📸 Optional screenshot-powered context for visual analysis
53+
- 🔍 RAG pipeline over per-game CSV knowledge with local vector search (Chroma)
54+
- 💻 Modern desktop overlay for chatting, settings, and screenshot gallery
6255

63-
**Note**: Make sure to follow our [Code of Conduct](CODE_OF_CONDUCT.md) and contribution guidelines!
6456

6557
## 🏗️ Architecture Overview
6658

@@ -150,20 +142,29 @@ The detection result is passed into the RAG layer to scope retrieval to the acti
150142
## 📁 Project Structure
151143

152144
```
153-
Hacktober Fest/
154-
├── backend/
155-
│ ├── __init__.py # FastAPI app initialization
156-
│ ├── backend.py # API endpoints and routing
145+
pixly/
146+
├── backend/
147+
│ ├── backend.py # FastAPI app initialization
148+
├── routers/ # Contains all the API Routers
149+
| ├── chat.py # Stores chat endpoints
150+
| ├── game_detection.py # Stores game detection and vector search endpoints
151+
| ├── screenshot.py # Stores screenshot endpoints
152+
| ├── setting.py # Stores settings endpoints
153+
├── services/ # Contains all the backend services.
157154
│ ├── chatbot.py # Gemini integration, RAG-aware chat, runtime reconfigure
158155
│ ├── screenshot.py # Encrypted screenshot capture, DB ops, delete support
159156
│ ├── game_detection.py # Process/message/screenshot-based game detection
160157
│ ├── knowledge_manager.py # CSV ingestion and content extraction (wiki/forum)
161158
│ └── vector_service.py # Chroma collections, embeddings, and search
159+
├── schemas/ # Contains the schemas for the various requests
160+
| ├── chat.py
161+
| ├── game_detection.py
162+
| ├── knowledge_search.py
163+
| ├── settings.py
162164
├── overlay.py # CustomTkinter overlay (chat, settings, screenshot viewer)
163165
├── games_info/ # Per-game CSVs (e.g., minecraft.csv)
164166
├── vector_db/ # Chroma persistent storage
165167
├── PROMPTS.txt # System persona + RAG grounding instructions
166-
├── test_system.py # Local API test harness
167168
├── run.py # Backend server launcher
168169
├── pyproject.toml # Dependencies and metadata
169170
├── screenshots.db # Encrypted screenshot database (auto-created)

backend/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
from fastapi import FastAPI
2-
app = FastAPI()

0 commit comments

Comments
 (0)