{"id":26460823,"url":"https://github.com/jerryblessed/fraudshieldgraphai","last_synced_at":"2026-05-17T12:12:52.177Z","repository":{"id":281600792,"uuid":"945734774","full_name":"Jerryblessed/fraudShieldgraphai","owner":"Jerryblessed","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T06:24:27.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T03:16:45.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jerryblessed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-10T03:26:03.000Z","updated_at":"2025-03-10T06:24:31.000Z","dependencies_parsed_at":"2025-03-10T06:41:07.204Z","dependency_job_id":null,"html_url":"https://github.com/Jerryblessed/fraudShieldgraphai","commit_stats":null,"previous_names":["jerryblessed/fraudshieldgraphai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jerryblessed/fraudShieldgraphai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryblessed%2FfraudShieldgraphai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryblessed%2FfraudShieldgraphai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryblessed%2FfraudShieldgraphai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryblessed%2FfraudShieldgraphai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jerryblessed","download_url":"https://codeload.github.com/Jerryblessed/fraudShieldgraphai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryblessed%2FfraudShieldgraphai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33137831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-19T03:16:49.172Z","updated_at":"2026-05-17T12:12:52.146Z","avatar_url":"https://github.com/Jerryblessed.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FraudShield Graph AI\n\n## Inspiration\nFraudulent transactions in finance and e-commerce have led to significant financial losses. Traditional fraud detection methods struggle with complex patterns, making graph-based AI an innovative solution.\n\n## What it does\nFraudShield Graph AI analyzes financial transactions using graph-based analytics and AI to detect fraudulent behavior. It identifies suspicious activity, unusual patterns, and connections between fraudulent accounts, providing real-time alerts to administrators via Telegram.\n\n## How we built it\n- **Database:** ArangoDB for storing financial transaction data in a graph structure.\n- **Graph Analysis:** NetworkX and cuGraph for fraud pattern detection. A sample dataset (`G_nx = nx.karate_club_graph()`) was used to demonstrate how fraud detection can be performed using graph analytics.\n- **AI Integration:** GPT-4o via LangChain for querying and interpreting fraud risks.\n- **Frontend \u0026 Alerts:** Telegram bot and a web-based UI for real-time monitoring.\n\n## Architectural Diagram\n```\n                     +-------------------+\n                     |  User Transaction |\n                     +---------+---------+\n                               |\n                               v\n                     +-------------------+\n                     |  ArangoDB (Graph) |\n                     +---------+---------+\n                               |\n                               v\n       +--------------------------------------+\n       |       Graph Processing Engine       |\n       |  (NetworkX / cuGraph)               |\n       +---------+--------------------------+\n                 |\n                 v\n       +---------------------------+\n       |  AI Query Processing (LLM) |\n       |  (GPT-4o via LangChain)    |\n       +---------+-----------------+\n                 |\n                 v\n       +-------------------------+\n       |  Alerts \u0026 Visualization |\n       |  (Telegram Bot / Web UI) |\n       +-------------------------+\n```\n\n## Challenges we ran into\n- **Data Complexity:** Graph relationships can be vast, requiring optimized query performance.\n- **Scalability:** Processing large-scale financial transactions efficiently.\n- **Real-time Processing:** Balancing AI-based analysis with speed for immediate fraud alerts.\n\n## Accomplishments that we're proud of\n- Successfully integrating **graph-based fraud detection** with **real-time AI insights**.\n- Implementing **GPU-accelerated** fraud analysis for efficiency.\n- Building a **Telegram bot** to notify admins about detected fraud cases.\n\n## What we learned\n- How to leverage **cuGraph for large-scale fraud detection**.\n- Optimizing **ArangoDB queries** for quick retrieval and processing.\n- AI-driven anomaly detection can significantly enhance traditional fraud prevention systems.\n\n## What's next for FraudShield Graph AI\n- **Expanding integrations** with financial institutions and e-commerce platforms.\n- **Enhancing AI models** to improve fraud prediction accuracy.\n- **Adding a web dashboard** for deeper fraud case analysis and reporting.\n- **Improving real-time processing** with further GPU optimizations.\n\n## Getting Started\nTo get started with FraudShield Graph AI, run the following steps in a Jupyter Notebook or Google Colab:\n\n### Open in Colab\n[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Jerryblessed/fraudShieldgraphai/blob/main/fdetect.ipynb)\n\n### Installation\n```sh\npip install networkx nx_arangodb cugraph-cu12 cudf-cu12 openai langchain_community python-telegram-bot matplotlib langgraph langchain_openai nx-arangodb[llm]\n```\n\n### Running the Project\n```python\nimport os\nimport networkx as nx\nimport nx_arangodb as nxadb\nimport cudf\nimport cugraph as cg\nimport openai\nfrom openai import AzureOpenAI\nimport matplotlib.pyplot as plt\nfrom telegram import Bot\n\n# Set up environment variables\nos.environ[\"DATABASE_HOST\"] = \"https://tutorials.arangodb.cloud:8529\"\nos.environ[\"DATABASE_USERNAME\"] = \"your_username\"\nos.environ[\"DATABASE_PASSWORD\"] = \"your_password\"\nos.environ[\"DATABASE_NAME\"] = \"your_database\"\n\napi_base = \"https://your-openai-instance.openai.azure.com/\"\napi_key = \"your_api_key\"\napi_version = \"2023-06-01-preview\"\n\nTELEGRAM_BOT_TOKEN = \"your_telegram_bot_token\"\nTELEGRAM_CHAT_ID = \"your_chat_id\"\n```\n\n### Graph Initialization\n```python\nbot = Bot(token=TELEGRAM_BOT_TOKEN)\n\ndef send_telegram_message(message):\n    \"\"\"Send a message to Telegram chat.\"\"\"\n    bot.send_message(chat_id=TELEGRAM_CHAT_ID, text=message)\n\n# Load a sample graph and persist it to ArangoDB\nG_nx = nx.karate_club_graph()\nG_adb = nxadb.Graph(name=\"GraphRAG\")\nG_adb.add_edges_from(G_nx.edges(data=True))\nsend_telegram_message(\"✅ Graph successfully initialized in ArangoDB.\")\n```\n\n### Graph Analysis\n```python\ndef analyze_graph_cugraph(G_nx):\n    \"\"\"Convert to cuGraph for GPU acceleration, fallback to CPU if no CUDA.\"\"\"\n    try:\n        cu_df = cudf.DataFrame(list(G_nx.edges(data=True)), columns=[\"src\", \"dst\", \"weight\"])\n        G_cg = cg.Graph()\n        G_cg.from_cudf_edgelist(cu_df, source=\"src\", destination=\"dst\", edge_attr=\"weight\")\n        send_telegram_message(\"⚡ Graph successfully analyzed using cuGraph (GPU-accelerated).\")\n        return G_cg\n    except Exception as e:\n        send_telegram_message(f\"⚠️ GPU not available or error using cuGraph: {e}. Falling back to NetworkX.\")\n        return G_nx\n```\n\n### Querying with GPT-4o\n```python\nfrom langchain_community.chat_models import ChatOpenAI\nfrom langchain.prompts import ChatPromptTemplate\n\nllm = ChatOpenAI(model_name=\"gpt-4o\", openai_api_key=api_key, openai_api_base=api_base)\n\ndef query_graph(prompt):\n    chat_prompt = ChatPromptTemplate.from_messages([\n        (\"system\", \"You are an AI assistant specializing in graph analytics.\"),\n        (\"user\", \"{prompt}\")\n    ])\n    response = llm.invoke(chat_prompt.format_messages(prompt=prompt))\n    send_telegram_message(f\"📡 User Query: {prompt}\\n🤖 AI Response: {response}\")\n    return response\n```\n\n## Running the Interactive Session\n```python\nwhile True:\n    user_query = input(\"Ask a graph-related question: \")\n    if user_query.lower() in [\"exit\", \"quit\"]:\n        send_telegram_message(\"🔴 Graph interaction session ended.\")\n        print(\"Goodbye!\")\n        break\n    response = query_graph(user_query)\n    print(\"AI Response:\", response)\n```\n\n## Contributing\nWe welcome contributions to enhance FraudShield Graph AI. Please submit issues and pull requests on our GitHub repository.\n\n## License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\nThis README provides a structured overview of the project, how to install and run it, and how users can interact with the system using AI-powered fraud detection through graphs. 🚀\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryblessed%2Ffraudshieldgraphai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerryblessed%2Ffraudshieldgraphai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryblessed%2Ffraudshieldgraphai/lists"}