Skip to main content

No project description provided

Project description

Galadriel

Galadriel is a Python framework for building autonomous, economically useful AI Agents.

Quickstart

Note: you should setup local env for this. In terminal

python3 -m venv venv
source venv/bin/activate

And then, install galadriel package.

pip install galadriel

Now, create a new python file and copy the code below to create sample agent. It uses TestClient which sends 2 messages sequentially to the agent and prints the result of agent execution.

import asyncio
from galadriel import AgentRuntime, CodeAgent, LiteLLMModel
from galadriel.clients import SimpleMessageClient
from galadriel.tools import DuckDuckGoSearchTool

model = LiteLLMModel(model_id="gpt-4o", api_key="<ADD YOUR OPENAI KEY HERE>")

agent = CodeAgent(
    model=model,
    tools=[DuckDuckGoSearchTool()]
)

client = SimpleMessageClient("Explain the concept of blockchain")

runtime = AgentRuntime(
    agent=agent,
    inputs=[client],
    outputs=[client],
)
asyncio.run(runtime.run())

Components

Clients

Clients serve as the bridge between agents and external data sources, handling both input and output operations. An input client (AgentInput) supplies messages to the agent, while an output client (AgentOutput) delivers the agent’s responses to their intended destination. This modular design allows seamless integration with a variety of sources, from scheduled jobs (like cron tasks) to interactive applications (such as Discord bots).

Tools

Tools extend an agent’s capabilities by providing predefined functions that enable interaction with external APIs, data sources, and systems. These tools empower agents to perform tasks such as fetching real-time weather updates or submitting blockchain transactions. Each tool defines its name, purpose, input requirements, and output format, ensuring structured and meaningful interactions. Galadriel supports any tool from HuggingFace, Composio and Langchain out-of-the-box.

Agents

Agents are the core intelligence behind the system, capable of reasoning, processing inputs, and generating informed responses. Our framework supports ToolCallingAgent and CodeAgent, which build upon Hugging Face’s Smolagents while introducing enhancements for improved integration with the runtime. Agents leverage ReAct-based reasoning and can access a wide variety of LLMs via LiteLLM. Additionally, they can be configured with custom personalities and interact with powerful tools to enhance their decision-making capabilities.

Runtime

The Agent Runtime ensures continuous and autonomous agent execution. It manages the lifecycle of agent interactions, efficiently processing incoming requests while maintaining agent state. The runtime follows a structured execution loop:

  1. Receive a Message – An input client sends a message to the runtime.
  2. Process the Message – The agent receives and handles the request.
  3. Send the Response – The agent's output is forwarded to the appropriate client.
  4. Repeat – The runtime continuously handles incoming messages in a loop.

This architecture enables real-time, scalable, and efficient agent operations across diverse environments.

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

galadriel-0.0.11.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

galadriel-0.0.11-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file galadriel-0.0.11.tar.gz.

File metadata

  • Download URL: galadriel-0.0.11.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for galadriel-0.0.11.tar.gz
Algorithm Hash digest
SHA256 b3f5904491896d5a7441d716143974c79de341faefad96a6619aa27cbe2f21e8
MD5 3014537ca1407024f8e4950b9aef2acc
BLAKE2b-256 71f3b9a6e5e8ca25e22baab611d93cf6075038a99d89633ea6098de0ca88443b

See more details on using hashes here.

File details

Details for the file galadriel-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: galadriel-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for galadriel-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 49d6d30578bbc4a3da1d7fd57d980f9093ee225d3930ba6c56991dd454e00b3f
MD5 f2e16de361f1cb83bc4600788283fae0
BLAKE2b-256 afa9896d3c30f1bf6857baf9c906ba2d24abe20996d9447185d2369bbbe11ccf

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