CSAT commited on
Commit
f7fa71d
·
verified ·
1 Parent(s): 32dc763

Upload Documentation.md

Browse files
Files changed (1) hide show
  1. Documentation.md +124 -0
Documentation.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OntoGraph - Drug Interaction Analysis System
2
+
3
+ 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.
4
+ ![alt text](img/img.png)
5
+
6
+ ## Key Features
7
+
8
+ - Dual Interface Options:
9
+ - Web-based interface using Streamlit
10
+ - Command-line interface for direct interaction
11
+ - Comprehensive Drug Analysis:
12
+ - Drug interaction detection
13
+ - Conflict identification
14
+ - Similar drug suggestions
15
+ - Alternative medication recommendations
16
+ - Advanced Technology Stack:
17
+ - RDF/OWL ontology for knowledge representation
18
+ - Groq LLM integration for natural language processing
19
+ - Agent-based architecture using Langgraph for modular analysis
20
+ - Structured logging system
21
+
22
+ ## Technical Requirements
23
+
24
+ - Python 3.x
25
+ - Groq API key
26
+ - Required Python packages:
27
+ - rdflib
28
+ - langchain
29
+ - python-dotenv
30
+ - langchain-community
31
+ - langchain-groq
32
+ - langgraph
33
+ - streamlit
34
+
35
+ ## Installation
36
+
37
+ 1. Clone the repository:
38
+ ```bash
39
+ git clone https://github.com/Manithj/onto_graph.git
40
+ cd onto_graph
41
+ ```
42
+
43
+ 2. Install dependencies:
44
+ ```bash
45
+ pip install -r requirements.txt
46
+ ```
47
+
48
+ 3. Configure environment:
49
+ - Create a `.env` file in the project root
50
+ - Add your Groq API key:
51
+ ```bash
52
+ GROQ_API_KEY=your_api_key_here
53
+ ```
54
+
55
+ ## Usage
56
+
57
+ ### Web Interface
58
+ ```bash
59
+ streamlit run app.py
60
+ ```
61
+ Navigate to the displayed local URL to access the web interface.
62
+
63
+ ### Command Line Interface
64
+ ```bash
65
+ python appcli.py
66
+ ```
67
+
68
+ ## Project Structure
69
+
70
+ ```
71
+ onto_graph/
72
+ ├── app.py # Streamlit web interface
73
+ ├── appcli.py # Command line interface
74
+ ├── agents/ # Agent implementations
75
+ │ ├── __init__.py
76
+ │ ├── alternative_agent.py
77
+ │ ├── base_agent.py
78
+ │ ├── conflict_agent.py
79
+ │ ├── interaction_agent.py
80
+ │ └── similarity_agent.py
81
+ ├── analyzers/ # Analysis coordination
82
+ │ ├── __init__.py
83
+ │ └── drug_interaction_analyzer.py
84
+ ├── ontology/ # Knowledge base
85
+ │ └── DrugInteraction.owl
86
+ └── requirements.txt # Project dependencies
87
+ ```
88
+
89
+ ## Features in Detail
90
+
91
+ ### Agent System
92
+ - **Base Agent**: Common functionality for ontology queries
93
+ - **Alternative Agent**: Identifies alternative medications
94
+ - **Similarity Agent**: Finds similar drugs
95
+ - **Conflict Agent**: Detects drug conflicts
96
+ - **Interaction Agent**: Analyzes drug interactions
97
+
98
+ ### Analysis Pipeline
99
+ 1. User input processing
100
+ 2. Ontology querying
101
+ 3. LLM-powered result synthesis
102
+ 4. Structured response generation
103
+
104
+ ## Contributing
105
+
106
+ We welcome contributions! Please follow these steps:
107
+
108
+ 1. Fork the repository
109
+ 2. Create a feature branch
110
+ 3. Commit your changes
111
+ 4. Push to your branch
112
+ 5. Create a Pull Request
113
+
114
+ ## Logging
115
+
116
+ The system maintains detailed logs in `app.log`, capturing:
117
+ - Information level messages
118
+ - Warning and error states
119
+ - Query execution details
120
+ - System state changes
121
+
122
+ ## License
123
+
124
+ This project is licensed under the [Apache 2.0](LICENSE).