{"id":25197074,"url":"https://github.com/databytesun/csv-data-agent-with-deepseek-r1","last_synced_at":"2026-02-09T06:31:05.376Z","repository":{"id":275625599,"uuid":"926576624","full_name":"DataByteSun/CSV-Data-Agent-with-DeepSeek-R1","owner":"DataByteSun","description":"Chat with your dataset.","archived":false,"fork":false,"pushed_at":"2025-02-04T14:44:14.000Z","size":1077,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T15:04:32.745Z","etag":null,"topics":["agent","agent-based","database","dataquery","deepseek","deepseek-r1","huggingface-transformers","langchain","python"],"latest_commit_sha":null,"homepage":"","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/DataByteSun.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,"zenodo":null}},"created_at":"2025-02-03T14:00:57.000Z","updated_at":"2025-03-11T05:38:56.000Z","dependencies_parsed_at":"2025-07-06T15:04:36.068Z","dependency_job_id":"02c37a69-19c5-40e5-92d1-b0dc884a168b","html_url":"https://github.com/DataByteSun/CSV-Data-Agent-with-DeepSeek-R1","commit_stats":null,"previous_names":["databytesun/generative_ai_project","databytesun/csv-data-agent-with-deepseek-r1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DataByteSun/CSV-Data-Agent-with-DeepSeek-R1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataByteSun%2FCSV-Data-Agent-with-DeepSeek-R1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataByteSun%2FCSV-Data-Agent-with-DeepSeek-R1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataByteSun%2FCSV-Data-Agent-with-DeepSeek-R1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataByteSun%2FCSV-Data-Agent-with-DeepSeek-R1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataByteSun","download_url":"https://codeload.github.com/DataByteSun/CSV-Data-Agent-with-DeepSeek-R1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataByteSun%2FCSV-Data-Agent-with-DeepSeek-R1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29258154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["agent","agent-based","database","dataquery","deepseek","deepseek-r1","huggingface-transformers","langchain","python"],"created_at":"2025-02-10T01:51:20.005Z","updated_at":"2026-02-09T06:31:05.359Z","avatar_url":"https://github.com/DataByteSun.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV Data Agent with DeepSeek-R1 \n\n## Overview\n\nThis project demonstrates how to interact with CSV data using a DeepSeek-R1-Distill-Qwen-32B. It integrates a streaming LLM from Hugging Face to process natural language queries on a pandas DataFrame. The project leverages `langchain`, `pandas`, and `huggingface_hub` to enable seamless data interaction.\n\n## Features\n- Uses a Hugging Face-hosted LLM `(deepseek-ai/DeepSeek-R1-Distill-Qwen-32B)` for processing queries.\n- Parses structured output from the LLM.\n- Integrates `langchain` to create a pandas DataFrame agent.\n- Allows querying CSV data using natural language prompts.\n- Supports structured parsing for responses.\n\n## Installation\n\n1. Clone this repository:\n```\ngit clone https://github.com/DataByteSun/CSV-Data-Agent-with-DeepSeek-R1.git\n```\n2. Create and activate a virtual environment (optional but recommended):\n```\npython -m venv venv\nsource venv/bin/activate   # On Windows use: venv\\Scripts\\activate\n```\n3. Install dependencies:\n```\npip install -r requirements.txt\n```\n4. Set up your environment variables:\n- Create a .env file in the project directory and add your Hugging Face API key(Get Free key from \u003ca href=\"https://huggingface.co/\" target=\"_blank\"\u003eHuggung Face\u003c/a\u003e):\n  ```\n  HUGGINGFACE_API_KEY=your_huggingface_api_key\n  ```\n- Load environment variables:\n  ```\n  from dotenv import load_dotenv\n  load_dotenv()\n  ```\n\n## Usage\n1. Load and preprocess your CSV data:\n```\nimport pandas as pd\ndf = pd.read_csv(\"your_data.csv\")\n```\n2. Instantiate the LLM and create an agent:\n```\nfrom huggingface_hub import InferenceClient\n\nclient = InferenceClient(api_key=\"your_huggingface_api_key\")\nagent = create_pandas_dataframe_agent(llm=client, df=df, verbose=True)\n```\n3. Query the agent using natural language:\n```\nresult = agent.invoke(\"how many rows are there?\")\n```\n\n## Expected Output (Screenshots)\n\n- Running `agent.invoke(\"how many rows are there?\")` may yield an output like:\n![image](https://github.com/user-attachments/assets/9a072d14-e302-49f4-b350-2afa212cde53)\n\n\n- With a Prompt Engineering\n    Question: `How may patients were hospitalized during Mar 2021 in Alaska use column hospitalizedCumulative?`\n  ![image](https://github.com/user-attachments/assets/9918b54b-8a2f-460c-a364-0de30bf40b2c)\n  ![image](https://github.com/user-attachments/assets/ad531f61-9d31-45b5-bc49-3db0a5b358f2)\n\n\n\n\n\u003e ⚠️ **Warning:**\n\u003e This code includes experimental components that may pose risks. Ensure thorough testing in a sandboxed environment to avoid potential vulnerabilities or data loss.\n## Customization\n\nModify `model_name` in the Hugging Face API request to experiment with different LLMs.\n\nAdjust parameters such as `temperature`, `max_tokens`, and `top_p` for fine-tuning responses.\n\n\n## Contributions\n\nFeel free to contribute by opening an issue or submitting a pull request.\n\n## Contact\n\nFor questions or feedback, reach out to `surajpawar.in@gmail.com`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabytesun%2Fcsv-data-agent-with-deepseek-r1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabytesun%2Fcsv-data-agent-with-deepseek-r1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabytesun%2Fcsv-data-agent-with-deepseek-r1/lists"}