Skip to main content

Just Agents - Base Package

Project description

just-agents-core

A lightweight, straightforward core library for LLM agents - no over-engineering, just simplicity!

🎯 Core Features

  • 🪶 Lightweight and simple implementation
  • 📝 Easy-to-understand agent interactions
  • 🔧 Customizable prompts using YAML files
  • 🤖 Support for various LLM models through litellm
  • 🔄 Chain of Thought reasoning with function calls

🏗️ Core Components

BaseAgent

A thin wrapper around litellm for basic LLM interactions. Provides:

  • Simple prompt management
  • Direct LLM communication
  • Memory handling

ChatAgent

The fundamental building block for agent interactions. Here's an example of using multiple chat agents:

from just_agents.base_agent import ChatAgent
from just_agents.llm_options import LLAMA3_3

# Initialize agents with different roles
harris = ChatAgent(
    llm_options=LLAMA3_3, 
    role="You are Kamala Harris in a presidential debate",
    goal="Win the debate with clear, concise responses",
    task="Respond briefly and effectively to debate questions"
)

trump = ChatAgent(
    llm_options=LLAMA3_3,
    role="You are Donald Trump in a presidential debate",
    goal="Win the debate with your signature style",
    task="Respond briefly and effectively to debate questions"
)

moderator = ChatAgent(
    llm_options={
        "model": "groq/mixtral-8x7b-32768",
        "api_base": "https://api.groq.com/openai/v1",
        "temperature": 0.0,
        "tools": []
    },
    role="You are a neutral debate moderator",
    goal="Ensure a fair and focused debate",
    task="Generate clear, specific questions about key political issues"
)

ChainOfThoughtAgent

Extended agent with reasoning capabilities and function calling:

from just_agents.patterns.chain_of_throught import ChainOfThoughtAgent
from just_agents import llm_options

def count_letters(character: str, word: str) -> str:
    """ Returns the number of character occurrences in the word. """
    count = word.count(character)
    return str(count)

# Initialize agent with tools and LLM options
agent = ChainOfThoughtAgent(
    tools=[count_letters],
    llm_options=llm_options.LLAMA3_3
)

# Get result and reasoning chain
result, chain = agent.think("Count the number of occurrences of the letter 'L' in 'HELLO'.")

📚 Usage

This core package provides the fundamental building blocks for LLM agents. For full usage examples and documentation, please refer to the main repository.

🔧 Installation

pip install just-agents-core

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

just_agents_core-0.5.1.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

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

just_agents_core-0.5.1-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file just_agents_core-0.5.1.tar.gz.

File metadata

  • Download URL: just_agents_core-0.5.1.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.10 Linux/6.8.0-52-lowlatency

File hashes

Hashes for just_agents_core-0.5.1.tar.gz
Algorithm Hash digest
SHA256 06a40eed4711535cff29393d79d6669be45083f82a33ad43771f71515b6e3053
MD5 f60f69bdd76b8d7385880cb1da7299fb
BLAKE2b-256 789ddec3c26fce6beaf24f480130a5e18db100ba6d33b7fc8fdbefa7a157b43c

See more details on using hashes here.

File details

Details for the file just_agents_core-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: just_agents_core-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.10 Linux/6.8.0-52-lowlatency

File hashes

Hashes for just_agents_core-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aba463be805299c4ee39ea4fd882cefa925a86adc86486db1b87a8da3ee7163
MD5 003fd4f402664d60845a294a3d3d0943
BLAKE2b-256 1165047d5bd8655a282a0a6786d506556949c3503d3a9c744516849f07c80b83

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