Spaces:
Build error
Build error
| title: Ontograph | |
| emoji: π» | |
| colorFrom: red | |
| colorTo: green | |
| sdk: streamlit | |
| sdk_version: 1.41.1 | |
| app_file: app.py | |
| pinned: false | |
| # π OntoGraph - Drug Interaction Analysis System | |
| A sophisticated Python-based application that combines ontology reasoning with LLM capabilities to analyze drug interactions, conflicts, and alternatives. The system provides comprehensive analysis through both CLI and web interfaces. | |
|  | |
| ## π Key Features | |
| - Dual Interface Options: | |
| - Web-based interface using Streamlit | |
| - Command-line interface for direct interaction | |
| - Comprehensive Drug Analysis: | |
| - Drug interaction detection | |
| - Conflict identification | |
| - Similar drug suggestions | |
| - Alternative medication recommendations | |
| - Advanced Technology Stack: | |
| - RDF/OWL ontology for knowledge representation | |
| - Groq LLM integration for natural language processing | |
| - Agent-based architecture using Langgraph for modular analysis | |
| - Structured logging system | |
| ## π οΈ Technical Requirements | |
| - Python 3.x | |
| - Groq API key | |
| - Required Python packages: | |
| - rdflib | |
| - langchain | |
| - python-dotenv | |
| - langchain-community | |
| - langchain-groq | |
| - langgraph | |
| - streamlit | |
| ## π₯ Installation | |
| 1. Clone the repository: | |
| ```bash | |
| git clone https://github.com/Manithj/onto_graph.git | |
| cd onto_graph | |
| ``` | |
| 2. Install dependencies: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 3. Configure environment: | |
| - Create a `.env` file in the project root | |
| - Add your Groq API key: | |
| ```bash | |
| GROQ_API_KEY=your_api_key_here | |
| ``` | |
| ## π» Usage | |
| ### Web Interface | |
| ```bash | |
| streamlit run app.py | |
| ``` | |
| Navigate to the displayed local URL to access the web interface. | |
| ### Command Line Interface | |
| ```bash | |
| python appcli.py | |
| ``` | |
| ## ποΈ Project Structure | |
| ``` | |
| onto_graph/ | |
| βββ app.py # Streamlit web interface | |
| βββ appcli.py # Command line interface | |
| βββ agents/ # Agent implementations | |
| β βββ __init__.py | |
| β βββ alternative_agent.py | |
| β βββ base_agent.py | |
| β βββ conflict_agent.py | |
| β βββ interaction_agent.py | |
| β βββ similarity_agent.py | |
| βββ analyzers/ # Analysis coordination | |
| β βββ __init__.py | |
| β βββ drug_interaction_analyzer.py | |
| βββ ontology/ # Knowledge base | |
| β βββ DrugInteraction.owl | |
| βββ requirements.txt # Project dependencies | |
| ``` | |
| ## π Features in Detail | |
| ### Agent System | |
| - **Base Agent**: Common functionality for ontology queries | |
| - **Alternative Agent**: Identifies alternative medications | |
| - **Similarity Agent**: Finds similar drugs | |
| - **Conflict Agent**: Detects drug conflicts | |
| - **Interaction Agent**: Analyzes drug interactions | |
| ### Analysis Pipeline | |
| 1. User input processing | |
| 2. Ontology querying | |
| 3. LLM-powered result synthesis | |
| 4. Structured response generation | |
| ## π€ Contributing | |
| We welcome contributions! Please follow these steps: | |
| 1. Fork the repository | |
| 2. Create a feature branch | |
| 3. Commit your changes | |
| 4. Push to your branch | |
| 5. Create a Pull Request | |
| ## π Logging | |
| The system maintains detailed logs in `app.log`, capturing: | |
| - Information level messages | |
| - Warning and error states | |
| - Query execution details | |
| - System state changes | |
| ## π License | |
| This project is licensed under the [Apache 2.0](LICENSE). | |