LuciAI


NameLuciAI JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://revmaxx.co
SummaryThe First AI-Based Medical Agent Designed to Automate All Medical Processes.
upload_time2024-10-01 11:10:25
maintainerNone
docs_urlNone
authorwbavishek
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## LUCI 

Luci is the first AI-based medical agent designed to automate a wide range of healthcare processes. Luci also facilitates advanced tasks like generating master prompts that interconnect and enabling custom search queries for text or images, all with simple Python calls. It helps professionals handle everything from generating SOAP notes to performing agentic searches, assisting with GPT queries, and even creating personalized AI models.

## Installation

```bash
pip install LuciAI
```

## Usage

After installing luci - go to your terminal and type luci_cli

### Ask Any Query

```bash
luci-cli cerina "Your Query?"
```
![alt text](image.png)

### Agentic Search

```bash
luci-cli search "COVID-19 symptoms" --type text --async-mode --max-results 5
```
![alt text](image-1.png)

You can switch between text and image searches, and toggle asynchronous mode by adding --async-mode.

- Change --type to `text` or `image`
- If you choose asynchronous mode then add it `--async-mode`
- If you want to use synchronous then remove it

### Models

Choose your model and find their respective methods!

|FUNCTION NAME | METHOD | TYPE |
| -------------| ------------- | -------------|
| TOGETHER     | call_together | ASYNC |
| OPENAI       | call_gpt | SYNC |
| OPENAI       | call_async_gpt | ASYNC |
| AZURE OPENAI | call_azure | ASYNC |
| AZURE OPENAI | call_azure_sync | SYNC |

```python
from Luci.Models.model import ChatModel

# Initialize the ChatModel class
chat_model = ChatModel(
    model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",  # Specify your model name
    api_key="",  # Your OpenAI API key
    prompt="What is the weather today?"
    #SysPrompt = "You can mention your system prompt here"
)

# Call the method that generates a response
result = chat_model.call_together()

# Print the result
print(result)
```

### Searching any Query

```python
from Luci.Agents import Search

query = "Revmaxx LLC"
search_instance = Search(query)

results = search_instance.search_text(max_results=5)
search_instance.print_text_result(results)
```

### Get the JSON Response of the Search Query

```python
from Luci import search_text

query="Recent trends of AI?"

print(search_text(query, max_results=3))
```

### Search any Image

```python
from Luci import Search

query = "Your Query ?"
search_instance = Search(query)

results = search_instance.search_images(max_results=5)
search_instance.print_text_result(results)
```

### Generate SOAP Notes through CLI

```bash
luci-cli soap --model "your_model" --api-key "your_api_key" --subjective "..." --objective "..." --assessment "..." --plan "..." --master-prompt "..." --connected
```

### Generate SOAP Notes

```python
from Luci.Agents.soap import *

model_name = "" # Mention the model name
api_key = # or pass directly from user input

t = "Fetch transcript from a audio of doctor & patient conversations"   
S = f"""Generate a subjective from the transcript {t} by mentioning the heading ## Subjective under sub headings **Chief Complaints**, **HPI** """
O = f"Find the objectives from the transcript {t} by mentioning the heading ## Objective under sub headings **Vitals** and **History**"
A = f"Find the assessment from the transcript {t} by mentioning the heading ## Assessment under a list of valid assessments"
P = f"Generate plan from the transcript {t} by mentioning the heading ## Plan under a list of valid plans"
M = "Generate a detailed SOAP note based on the inputs. Follow headings and sub-headings carefully"

    # Create an instance of the SoapAgent class
soap_agent = SoapAgent(model_name=model_name, api_key=api_key, connected=True)
soap_agent.create_soap(S, O, A, P, M)
```

### Voice Documentation

Voice dictation for clinical notes, transcribing speech to text, and structuring it into standardized formats like SOAP notes.

```python
from Luci.Agents.voice_documentation_agent import VoiceDocumentationAgent

agent = VoiceDocumentationAgent(
    model_name='',  # Replace with your model name
    api_key='',   # Replace with your Together API key
    method='call_together' #mention here method
)
agent.run()
```
### CLI Example

```bash
luci-cli voice_doc --model-name <MODEL_NAME> --api-key <API_KEY> [--method <METHOD>] [--stop-word <STOP_WORD>]
```

### Medical Search Agent

Search the new papers on pubmed through luci!

```python
from Luci.Agents.medica_search_agent import MedicalSearchAgent

email = "wbavishek@gmail.com"
max_results = 5
query = "diabetes treatment guidelines"

agent = MedicalSearchAgent(email=email, max_results=max_results)
articles = agent.search(query)
agent.print_results(articles)
```
### CLI Example

```python
luci-cli medsearch "diabetes treatment guidelines" --email "wbavishekbhattacharjee@gmail.com"
 --max-results 2
```

### Run Agents 

```python
from Luci import Agent, SearchTool
import os  # Import os to set environment variables

# User-defined parameters
query = "diabetes treatment guidelines"  # Final Query
model = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"  # Choose a model name
method = "call_together"  # Choose a ChatModel method (corrected)
email = "wbavishek@gmail.com"

# Set the API_KEY environment variable
os.environ['API_KEY'] = ""

# Make a Research Agent
research_agent = Agent.built(
    name="ResearchAgent",
    objective="Gather the latest research on diabetes treatment guidelines.",
    task=query,  # The research task/query
    precautions="Do not hallucinate information; only use reputable medical journals and sources.",
    tool=SearchTool(email=email)
)

# Make a Writer Agent
writer = Agent.built(
    name="WriterAgent",
    objective="Compose a comprehensive summary based on the research findings.",
    task="Summarize the diabetes treatment guidelines based on the provided research.",
    precautions="Maintain medical accuracy and clarity.",
    tool=None  # No specific tool needed for writing
)

# Connect the Writer Agent to the Research Agent
research_agent.connect_agent('writer_agent', writer)

# Generate the final answer using the connected Writer Agent 
# This uses the Research Agent's task as the query for the Writer Agent
final_answer = research_agent.generate_final_answer(model, method, query)

print("Final Answer:")
print(final_answer)
```

### CLI Example to build Optimized Agent YAML

```bash
luci-cli refined_agent --name "Research" --objective "Building open source AI Medical Agent Framework how it can help my company focused on ai medical scribe" --precautions "Avoid using outdated information" --task "AI Medical Agent framework experience" 
```
Change the value of --name , --objective, --precautions, --task.

### ClI Example for Run Agents Automatically from YAML

```bash
luci-cli run_agent --yaml-path "agents_configs/Research_research.yaml" --model "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo" --method "call_together"
```

Change --yaml-path to your yaml path and -- model to your model name and --method to your method name.

### Chain of Thoughts

```python
import asyncio
from Luci import create_master_prompt

async def main():
    # Define API key and model
    api_key = ""
    model_name = "cerina"  # Could be "together" or "cerina"

    # Define your list of prompts
    prompts = [
        "Generate a summary of the latest AI research.",
        "Explain the benefits of using AI in healthcare."
    ]

    # Generate master prompt using the standalone function
    master_prompt = await create_master_prompt(
        api_key=api_key,
        model_name=model_name,
        prompts=prompts,
        connected=True,  # Set to True to enable passing info between prompts
        search=True  # Set to True to enable search functionality
    )

    print("Generated Master Prompt:", master_prompt)

# Run the async main function
if __name__ == "__main__":
    asyncio.run(main())
```

## Contributing

We welcome contributions to LuciAI! If you're interested in improving the project, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes.
4. Create a pull request.

## License

[![License: RevMaxx LLC Software License](https://img.shields.io/badge/license-RevMaxx%20LLC-blue.svg)](LICENSE)



            

Raw data

            {
    "_id": null,
    "home_page": "https://revmaxx.co",
    "name": "LuciAI",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "wbavishek",
    "author_email": "wbavishek@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cc/f6/92a7ff7e030bfa0d25b85e3211f491d317ef69e22f3125d0ee21861beaab/luciai-0.5.0.tar.gz",
    "platform": null,
    "description": "## LUCI \r\n\r\nLuci is the first AI-based medical agent designed to automate a wide range of healthcare processes. Luci also facilitates advanced tasks like generating master prompts that interconnect and enabling custom search queries for text or images, all with simple Python calls. It helps professionals handle everything from generating SOAP notes to performing agentic searches, assisting with GPT queries, and even creating personalized AI models.\r\n\r\n## Installation\r\n\r\n```bash\r\npip install LuciAI\r\n```\r\n\r\n## Usage\r\n\r\nAfter installing luci - go to your terminal and type luci_cli\r\n\r\n### Ask Any Query\r\n\r\n```bash\r\nluci-cli cerina \"Your Query?\"\r\n```\r\n![alt text](image.png)\r\n\r\n### Agentic Search\r\n\r\n```bash\r\nluci-cli search \"COVID-19 symptoms\" --type text --async-mode --max-results 5\r\n```\r\n![alt text](image-1.png)\r\n\r\nYou can switch between text and image searches, and toggle asynchronous mode by adding --async-mode.\r\n\r\n- Change --type to `text` or `image`\r\n- If you choose asynchronous mode then add it `--async-mode`\r\n- If you want to use synchronous then remove it\r\n\r\n### Models\r\n\r\nChoose your model and find their respective methods!\r\n\r\n|FUNCTION NAME | METHOD | TYPE |\r\n| -------------| ------------- | -------------|\r\n| TOGETHER     | call_together | ASYNC |\r\n| OPENAI       | call_gpt | SYNC |\r\n| OPENAI       | call_async_gpt | ASYNC |\r\n| AZURE OPENAI | call_azure | ASYNC |\r\n| AZURE OPENAI | call_azure_sync | SYNC |\r\n\r\n```python\r\nfrom Luci.Models.model import ChatModel\r\n\r\n# Initialize the ChatModel class\r\nchat_model = ChatModel(\r\n    model_name=\"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\",  # Specify your model name\r\n    api_key=\"\",  # Your OpenAI API key\r\n    prompt=\"What is the weather today?\"\r\n    #SysPrompt = \"You can mention your system prompt here\"\r\n)\r\n\r\n# Call the method that generates a response\r\nresult = chat_model.call_together()\r\n\r\n# Print the result\r\nprint(result)\r\n```\r\n\r\n### Searching any Query\r\n\r\n```python\r\nfrom Luci.Agents import Search\r\n\r\nquery = \"Revmaxx LLC\"\r\nsearch_instance = Search(query)\r\n\r\nresults = search_instance.search_text(max_results=5)\r\nsearch_instance.print_text_result(results)\r\n```\r\n\r\n### Get the JSON Response of the Search Query\r\n\r\n```python\r\nfrom Luci import search_text\r\n\r\nquery=\"Recent trends of AI?\"\r\n\r\nprint(search_text(query, max_results=3))\r\n```\r\n\r\n### Search any Image\r\n\r\n```python\r\nfrom Luci import Search\r\n\r\nquery = \"Your Query ?\"\r\nsearch_instance = Search(query)\r\n\r\nresults = search_instance.search_images(max_results=5)\r\nsearch_instance.print_text_result(results)\r\n```\r\n\r\n### Generate SOAP Notes through CLI\r\n\r\n```bash\r\nluci-cli soap --model \"your_model\" --api-key \"your_api_key\" --subjective \"...\" --objective \"...\" --assessment \"...\" --plan \"...\" --master-prompt \"...\" --connected\r\n```\r\n\r\n### Generate SOAP Notes\r\n\r\n```python\r\nfrom Luci.Agents.soap import *\r\n\r\nmodel_name = \"\" # Mention the model name\r\napi_key = # or pass directly from user input\r\n\r\nt = \"Fetch transcript from a audio of doctor & patient conversations\"   \r\nS = f\"\"\"Generate a subjective from the transcript {t} by mentioning the heading ## Subjective under sub headings **Chief Complaints**, **HPI** \"\"\"\r\nO = f\"Find the objectives from the transcript {t} by mentioning the heading ## Objective under sub headings **Vitals** and **History**\"\r\nA = f\"Find the assessment from the transcript {t} by mentioning the heading ## Assessment under a list of valid assessments\"\r\nP = f\"Generate plan from the transcript {t} by mentioning the heading ## Plan under a list of valid plans\"\r\nM = \"Generate a detailed SOAP note based on the inputs. Follow headings and sub-headings carefully\"\r\n\r\n    # Create an instance of the SoapAgent class\r\nsoap_agent = SoapAgent(model_name=model_name, api_key=api_key, connected=True)\r\nsoap_agent.create_soap(S, O, A, P, M)\r\n```\r\n\r\n### Voice Documentation\r\n\r\nVoice dictation for clinical notes, transcribing speech to text, and structuring it into standardized formats like SOAP notes.\r\n\r\n```python\r\nfrom Luci.Agents.voice_documentation_agent import VoiceDocumentationAgent\r\n\r\nagent = VoiceDocumentationAgent(\r\n    model_name='',  # Replace with your model name\r\n    api_key='',   # Replace with your Together API key\r\n    method='call_together' #mention here method\r\n)\r\nagent.run()\r\n```\r\n### CLI Example\r\n\r\n```bash\r\nluci-cli voice_doc --model-name <MODEL_NAME> --api-key <API_KEY> [--method <METHOD>] [--stop-word <STOP_WORD>]\r\n```\r\n\r\n### Medical Search Agent\r\n\r\nSearch the new papers on pubmed through luci!\r\n\r\n```python\r\nfrom Luci.Agents.medica_search_agent import MedicalSearchAgent\r\n\r\nemail = \"wbavishek@gmail.com\"\r\nmax_results = 5\r\nquery = \"diabetes treatment guidelines\"\r\n\r\nagent = MedicalSearchAgent(email=email, max_results=max_results)\r\narticles = agent.search(query)\r\nagent.print_results(articles)\r\n```\r\n### CLI Example\r\n\r\n```python\r\nluci-cli medsearch \"diabetes treatment guidelines\" --email \"wbavishekbhattacharjee@gmail.com\"\r\n --max-results 2\r\n```\r\n\r\n### Run Agents \r\n\r\n```python\r\nfrom Luci import Agent, SearchTool\r\nimport os  # Import os to set environment variables\r\n\r\n# User-defined parameters\r\nquery = \"diabetes treatment guidelines\"  # Final Query\r\nmodel = \"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\"  # Choose a model name\r\nmethod = \"call_together\"  # Choose a ChatModel method (corrected)\r\nemail = \"wbavishek@gmail.com\"\r\n\r\n# Set the API_KEY environment variable\r\nos.environ['API_KEY'] = \"\"\r\n\r\n# Make a Research Agent\r\nresearch_agent = Agent.built(\r\n    name=\"ResearchAgent\",\r\n    objective=\"Gather the latest research on diabetes treatment guidelines.\",\r\n    task=query,  # The research task/query\r\n    precautions=\"Do not hallucinate information; only use reputable medical journals and sources.\",\r\n    tool=SearchTool(email=email)\r\n)\r\n\r\n# Make a Writer Agent\r\nwriter = Agent.built(\r\n    name=\"WriterAgent\",\r\n    objective=\"Compose a comprehensive summary based on the research findings.\",\r\n    task=\"Summarize the diabetes treatment guidelines based on the provided research.\",\r\n    precautions=\"Maintain medical accuracy and clarity.\",\r\n    tool=None  # No specific tool needed for writing\r\n)\r\n\r\n# Connect the Writer Agent to the Research Agent\r\nresearch_agent.connect_agent('writer_agent', writer)\r\n\r\n# Generate the final answer using the connected Writer Agent \r\n# This uses the Research Agent's task as the query for the Writer Agent\r\nfinal_answer = research_agent.generate_final_answer(model, method, query)\r\n\r\nprint(\"Final Answer:\")\r\nprint(final_answer)\r\n```\r\n\r\n### CLI Example to build Optimized Agent YAML\r\n\r\n```bash\r\nluci-cli refined_agent --name \"Research\" --objective \"Building open source AI Medical Agent Framework how it can help my company focused on ai medical scribe\" --precautions \"Avoid using outdated information\" --task \"AI Medical Agent framework experience\" \r\n```\r\nChange the value of --name , --objective, --precautions, --task.\r\n\r\n### ClI Example for Run Agents Automatically from YAML\r\n\r\n```bash\r\nluci-cli run_agent --yaml-path \"agents_configs/Research_research.yaml\" --model \"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\" --method \"call_together\"\r\n```\r\n\r\nChange --yaml-path to your yaml path and -- model to your model name and --method to your method name.\r\n\r\n### Chain of Thoughts\r\n\r\n```python\r\nimport asyncio\r\nfrom Luci import create_master_prompt\r\n\r\nasync def main():\r\n    # Define API key and model\r\n    api_key = \"\"\r\n    model_name = \"cerina\"  # Could be \"together\" or \"cerina\"\r\n\r\n    # Define your list of prompts\r\n    prompts = [\r\n        \"Generate a summary of the latest AI research.\",\r\n        \"Explain the benefits of using AI in healthcare.\"\r\n    ]\r\n\r\n    # Generate master prompt using the standalone function\r\n    master_prompt = await create_master_prompt(\r\n        api_key=api_key,\r\n        model_name=model_name,\r\n        prompts=prompts,\r\n        connected=True,  # Set to True to enable passing info between prompts\r\n        search=True  # Set to True to enable search functionality\r\n    )\r\n\r\n    print(\"Generated Master Prompt:\", master_prompt)\r\n\r\n# Run the async main function\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n```\r\n\r\n## Contributing\r\n\r\nWe welcome contributions to LuciAI! If you're interested in improving the project, please follow these steps:\r\n\r\n1. Fork the repository.\r\n2. Create a new branch for your feature or bug fix.\r\n3. Make your changes.\r\n4. Create a pull request.\r\n\r\n## License\r\n\r\n[![License: RevMaxx LLC Software License](https://img.shields.io/badge/license-RevMaxx%20LLC-blue.svg)](LICENSE)\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The First AI-Based Medical Agent Designed to Automate All Medical Processes.",
    "version": "0.5.0",
    "project_urls": {
        "Homepage": "https://revmaxx.co"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0db08ea8e9062bbe1b282416b33e2dd34db25d136e719ee9b4bcd3e3e1c24add",
                "md5": "cd5effc380d5da28980957bddcfe4def",
                "sha256": "93139a6166db2ca99fa97ad84c7beeee658433f3812cbd9db9789a7b11f62540"
            },
            "downloads": -1,
            "filename": "LuciAI-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cd5effc380d5da28980957bddcfe4def",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 27134,
            "upload_time": "2024-10-01T11:10:24",
            "upload_time_iso_8601": "2024-10-01T11:10:24.598115Z",
            "url": "https://files.pythonhosted.org/packages/0d/b0/8ea8e9062bbe1b282416b33e2dd34db25d136e719ee9b4bcd3e3e1c24add/LuciAI-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ccf692a7ff7e030bfa0d25b85e3211f491d317ef69e22f3125d0ee21861beaab",
                "md5": "2ee2cecac68f7b2cba6ca5736e80ddd6",
                "sha256": "75249d5ded54037c479f5267571d5379a802667f635527938f8a7f65f7cc869d"
            },
            "downloads": -1,
            "filename": "luciai-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2ee2cecac68f7b2cba6ca5736e80ddd6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20486,
            "upload_time": "2024-10-01T11:10:25",
            "upload_time_iso_8601": "2024-10-01T11:10:25.748031Z",
            "url": "https://files.pythonhosted.org/packages/cc/f6/92a7ff7e030bfa0d25b85e3211f491d317ef69e22f3125d0ee21861beaab/luciai-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-01 11:10:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "luciai"
}
        
Elapsed time: 0.67328s