A powerful, privacy-conscious AI assistant powered by GitHub-hosted GPT-4o.
Designed with developers in mind, this agent offers persistent session memory, secure token authentication, and extendability for real-world applications.
- Secure login via GitHub token (user-provided).
- Each token is SHA-256 hashed to create a private identifier (
user_hash) used to:- Track user sessions
- Prevent token storage
- Isolate chat histories across users
💡 You can generate a GitHub token from:
https://github.com/settings/tokens
- All chat messages are stored in a local database (
chat_messages.db). - Each user can create and manage multiple chat sessions.
- All message types (
human,AI,function,tool, etc.) are serialized and deserialized correctly.
- Built using LangGraph's
StateGraphfor controlled message flow. - Node function (
process) invokes the model and updates memory. - Designed to be extensible for:
- Tool calling
- Function execution
- Retrieval-augmented generation
| Feature | Details |
|---|---|
| 🛡️ Token Hashing | Prevents token leaks and supports session-based user isolation |
| 🗃️ Session Management | Named session support with persistent conversations |
| 🧠 GPT-4o Integration | Uses GitHub's hosted inference endpoint (https://models.github.ai/inference) |
| 🔄 Tool & Function Ready | Agent already supports future extensions for tool-calling and more |
| ❌ Invalid Token Check | Validates GitHub token via trial request before login |
| 🔄 Logout Flow | Secure reset and return to auth gate |
├── main.py # Streamlit frontend with authentication and UI
├── agent.py # LangGraph logic and GPT-4o invocation flow
├── github_wrapper.py # Custom wrapper for GitHub-hosted GPT-4o API
├── chat_messages.db # SQLite database for chat/session persistence
├── requirements.txt # Python dependencies
└── README.md # Project overview and usagegit clone https://github.com/your-username/GitHub-GPT4o-Agent.git
cd GitHub-GPT4o-Agentpip install -r requirements.txtstreamlit run main.py- GitHub tokens are not stored.
- All session control is hash-based and local.
- SQLite stores only messages, not secrets.
- LangGraph & LangChain
- Streamlit
- SQLite (for state persistence)
- GitHub GPT-4o Inference API
Jayesh Suryawanshi
- 🧠 Python Developer | 💡 AI Tools Builder | 🌍 Data & Engineering Enthusiast
MIT License



