{"id":35887397,"url":"https://github.com/omaaartamer/ScientificPaperAgent","last_synced_at":"2026-01-15T06:00:45.469Z","repository":{"id":280687432,"uuid":"942712673","full_name":"omaaartamer/ScientificPaperAgent","owner":"omaaartamer","description":"A LangGraph-based research assistant that helps find, analyze, and summarize scientific papers. Built with Mistral LLM (via Ollama) and Flask, this agent can search papers through CORE API, process PDFs, and provide structured research summaries.","archived":false,"fork":false,"pushed_at":"2025-03-04T22:38:07.000Z","size":41,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T08:02:12.076Z","etag":null,"topics":["flask","javascript","langchain","langraph","llm","mistral-7b","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omaaartamer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-04T14:53:48.000Z","updated_at":"2025-06-03T19:29:43.000Z","dependencies_parsed_at":"2025-03-04T19:46:42.060Z","dependency_job_id":null,"html_url":"https://github.com/omaaartamer/ScientificPaperAgent","commit_stats":null,"previous_names":["omaaartamer/scientificpaperagent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omaaartamer/ScientificPaperAgent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaaartamer%2FScientificPaperAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaaartamer%2FScientificPaperAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaaartamer%2FScientificPaperAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaaartamer%2FScientificPaperAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omaaartamer","download_url":"https://codeload.github.com/omaaartamer/ScientificPaperAgent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaaartamer%2FScientificPaperAgent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28444124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T05:05:00.929Z","status":"ssl_error","status_checked_at":"2026-01-15T05:04:58.515Z","response_time":62,"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":["flask","javascript","langchain","langraph","llm","mistral-7b","python"],"created_at":"2026-01-08T22:00:39.536Z","updated_at":"2026-01-15T06:00:45.461Z","avatar_url":"https://github.com/omaaartamer.png","language":"Python","funding_links":[],"categories":["Agent Categories"],"sub_categories":["\u003ca name=\"LangGraph\"\u003e\u003c/a\u003eLangGraph"],"readme":"# Scientific Research Assistant Agent\n\nA LangGraph-based research assistant that helps users find, analyze, and summarize scientific papers using the CORE API.\n\n## Overview\n\nThis project implements a research assistant agent that can:\n- Search for scientific papers\n- Download and analyze PDFs\n- Provide structured summaries\n- Answer research-related questions\n\n## Challenges and Approach\n\n### 1. LLM Integration Challenge\n\n**Original Implementation:**\n- The original paper used OpenAI's GPT models\n- Required API keys and had usage costs\n- Had specific message formatting requirements\n\n**Solution:**\n- Migrated to locally-hosted Mistral using Ollama\n- Created a custom wrapper for Mistral to handle message formatting\n- Implemented structured output parsing for consistent responses\n- Eliminated API costs and privacy concerns\n\n### 2. Architecture Challenges\n\n**Workflow Management:**\n- Complex state management between different agent nodes\n- Need for consistent message formatting\n- Tool integration and execution flow\n\n**Solution:**\n- Used LangGraph for structured workflow\n- Implemented state management through AgentState\n- Created modular tools system for paper search and download\n- Built clear node transitions and decision making\n\n### 3. Frontend Integration\n\n**Challenges:**\n- Real-time communication with the agent\n- Handling async operations\n- Displaying structured research outputs\n\n**Solution:**\n- Created a Flask-based API endpoint\n- Implemented async processing with proper error handling\n- Built a responsive frontend for real-time interaction\n- Structured output formatting for better readability\n\n## Technical Stack\n\n- **Backend Framework:** Flask\n- **LLM:** Mistral (via Ollama)\n- **Workflow Management:** LangGraph\n- **API Integration:** CORE API\n- **PDF Processing:** pdfplumber\n- **Frontend:** HTML, CSS, JavaScript\n\n## Getting Started\n\n1. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n2. Install Ollama and Mistral:\n```bash\n# Install Ollama\ncurl https://ollama.ai/install.sh | sh\n# Pull Mistral model\nollama pull mistral\n```\n3. Set up environment variables:\n```bash\n# Create .env file\nCORE_API_KEY=your_key_here\n```\nRun the application:\n```bash\npython run.py\n```\n```bash\nProject Structure\n.\n├── run.py                 # Flask app entry point\n├── requirements.txt       # Project dependencies\n├── flaskApp/             # Flask application\n│   ├── __init__.py\n│   ├── config.py\n│   ├── views.py\n│   ├── static/\n│   └── templates/\n└── agent/                  # Agent implementation\n    ├── __init__.py\n    ├── models.py         # Pydantic models\n    ├── core_wrapper.py   # CORE API wrapper\n    ├── mistral_wrapper.py # LLM wrapper\n    ├── prompts.py        # System prompts\n    ├── tools.py          # Agent tools\n    ├── utils.py          # Helper functions\n    └── workflow.py       # LangGraph workflow\n```\n\n## Contributing\n- Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.\n\n## License\n- This project is licensed under the Apache License 2.0 - see the LICENSE file for details.\n\n\n## Acknowledgments\n\n- This implementation is based on the scientific research agent from [NirDiamant/GenAI_Agents](https://github.com/NirDiamant/GenAI_Agents), specifically their implementation of the Scientific Papers Researcher\n- Modified the original implementation to:\n  - Replaced OpenAI with locally-hosted Mistral via Ollama\n  - Added Flask web interface\n  - Restructured code for modularity\n- Uses the CORE API for academic paper access\n- Built with LangGraph and Mistral\n\n### Original Paper and Implementation\nThe original implementation and research was done by:\n- Repository: [NirDiamant/GenAI_Agents](https://github.com/NirDiamant/GenAI_Agents)\n- Authors: Nir Diamant and contributors\n- Implementation: Scientific Papers Researcher Jupyter notebook\n\nThis project maintains the core functionality and workflow of the original implementation while adapting it for web deployment and local LLM usage.\n\n## Known Limitations and Future Work\n\n### Local Model Performance\n\nWhile the integration of tools and API is functional, the locally hosted Mistral model shows some limitations:\n\n1. **Hallucinations**:\n   - Generated paper titles and authors that don't exist\n   - Produced plausible but fake content\n   - Inconsistent date ranges in results\n\n2. **Comparison with OpenAI Models**:\n   - Less accurate paper summaries\n   - Lower quality of research analysis\n   - More prone to fabricating details\n   - Less reliable tool usage\n\n### Future Improvements\n\n1. **Model Enhancement**:\n   - Experiment with different local models depending on the deployment server specs\n   - Fine-tune for research paper analysis\n   - Optimize for tool usage\n   - Improve response formatting\n\n2. **Integration Refinement**:\n   - Better state management\n   - Cleaner response handling\n   - Improved error handling\n   - Debug output filtering\n\n3. **Alternative Approaches**:\n   - Enhance validation checks\n   - Add fact-checking mechanisms\n\nNote: For production use cases requiring high accuracy and reliability, consider using OpenAI's models or other cloud-based solutions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomaaartamer%2FScientificPaperAgent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomaaartamer%2FScientificPaperAgent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomaaartamer%2FScientificPaperAgent/lists"}