Skip to main content

A powerful SDK for building AI agents

Project description

Semantio: The Mother of Your AI Agents

Semantio is an advanced SDK designed to simplify the creation of AI agents. Whether you’re building a research agent, a customer support bot, or a personal AI, Semantio provides all the tools and integrations to make it easy.

We currently support Groq, OpenAI, and Anthropic LLMs, along with a Retrieval-Augmented Generation (RAG) system for enhanced context-awareness.

Installation

Install Semantio via pip:

pip install semantio

Features

  • Seamless LLM Integration: Plug-and-play support for Groq, OpenAI, and Anthropic.
  • RAG Support: Retrieval-Augmented Generation for contextually aware responses.
  • Customizable Agents: Define the personality, behavior, and instructions for your AI agents.
  • Extensibility: Add new tools or modify behavior with ease.

Example: Blockchain Research Agent

This example demonstrates how to create a blockchain research agent using Semantio and the Groq LLM.

Prerequisites

  1. Set up your Groq API key as an environment variable or directly in the code.
import os
os.environ["GROQ_API_KEY"] = "your-api-key"  # Replace with your Groq API key
  1. Import the Semantio Agent class and configure your agent.

Code Example

# Set the Groq API key (either via environment variable or explicitly)
import os
os.environ["GROQ_API_KEY"] = "your-api-key"  # Set the API key here

# Initialize the Agent
from semantio.agent import Agent

healthcare_research_assistant = Agent(
    name="Healthcare Agent",
    description="Extract and structure medical information from the provided text into a JSON format used in healthcare",
    instructions=[
        "Always use medical terminology while creating json",
        "Extract and structure medical information from the provided text into a JSON format used in healthcare",
    ],
    model="Groq",
    show_tool_calls=True,
    user_name="Researcher",
    emoji=":chains:",
    markdown=True,
)
patient_text = """
Patient Complaints of High grade fever, chest pain, radiating towards right shoulder. Sweating,
patient seams to have high grade fever ,  patient is allergic to pollution , diagnosis high grade fever , plan of care comeback after 2 days , instructions take rest and drink lot of water  Palpitation since 5 days.
Advice investigation: CBC, LFT, Chest X ray, Abdomen Ultrasound
Medication: Diclofenac 325mg twice a day for 5 days, Amoxiclave 625mg once a day for 5 days, Azithromycin 500mg Once a day
Ibuprofen SOS, Paracetamol sos, Pentoprazol before breakfast  , follow up after 2 days
"""
# Test the Agent
healthcare_research_assistant.print_response(patient_text)

File Structure

The Semantio SDK is organized as follows:

Semantio/
├── semantio/                      # Core package
│   ├── __init__.py              # Package initialization
│   ├── agent.py                 # Core Agent class
│   ├── rag.py                   # RAG functionality
│   ├── memory.py                # Conversation memory management
│   ├── llm/                     # LLM integrations
│   │   ├── __init__.py
│   │   ├── openai.py            # OpenAI integration
│   │   ├── anthropic.py         # Anthropic (Claude) integration
│   │   ├── deepseek.py          # Deepseek integration
│   │   ├── gemini.py            # Gemini integration
│   │   ├── mistral.py           # Mistral integration
│   │   └── base_llm.py          # Base class for LLMs
│   ├── knowledge_base/          # Knowledge base integration
│   │   ├── __init__.py
│   │   ├── vector_store.py      # Vector store for embeddings
│   │   ├── document_loader.py   # Load documents into the knowledge base
│   │   └── retriever.py         # Retrieve relevant documents
│   ├── tools/                   # Tools for assistants
│   │   ├── __init__.py
│   │   ├── calculator.py        # Example tool: Calculator
│   │   ├── web_search.py        # Example tool: Web search
│   │   └── base_tool.py         # Base class for tools
│   ├── storage/                 # Storage for memory and data
│   │   ├── __init__.py
│   │   ├── local_storage.py     # Local file storage
│   │   └── cloud_storage.py     # Cloud storage (e.g., S3, GCP)
│   ├── utils/                   # Utility functions
│   │   ├── __init__.py
│   │   ├── logger.py            # Logging utility
│   │   └── config.py            # Configuration loader
│   └── cli/                     # Command-line interface
│       ├── __init__.py
│       └── main.py              # CLI entry point
├── tests/                       # Unit tests
│   ├── __init__.py
│   ├── test_assistant.py
│   ├── test_rag.py
│   └── test_memory.py
├── examples/                    # Example usage
│   ├── basic_assistant.py
│   ├── customer_support.py
│   └── research_assistant.py
├── requirements.txt             # Dependencies
├── setup.py                     # Installation script
├── README.md                    # Documentation
└── LICENSE                      # License file

Contributing

Contributions are welcome! Please fork the repository, create a feature branch, and submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License.

Support

For issues, feature requests, or questions, please open an issue in the repository or reach out to the team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantio-0.0.7.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semantio-0.0.7-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

Details for the file semantio-0.0.7.tar.gz.

File metadata

  • Download URL: semantio-0.0.7.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for semantio-0.0.7.tar.gz
Algorithm Hash digest
SHA256 eacd6faaa823b0b312f8379f478b6eefc8ca2afcea8efa06b61a1d1bc48fb078
MD5 c332ea7fe1d92cf57956d71f03265bbb
BLAKE2b-256 7acee44414cff4122fe2bd7063383dd20dc7e0c9b0481e1b720e228bc251372b

See more details on using hashes here.

File details

Details for the file semantio-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: semantio-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 44.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for semantio-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 79a14cb1eb03f9d2f2268c3c400ba7e26049f04af98e9fd6e829461ca738ceea
MD5 ab626b4944b43f35300cb25e23dd0583
BLAKE2b-256 0e91f1a07a9762af1c37a7d5a1590cc823bca89088fd1e292362c6ef588e3653

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page