Skip to main content

Modular Python framework for building AI agents with persistent memory

Project description

Karo Framework

PyPI version License: MIT

Karo is a modular Python framework designed for building robust and maintainable AI agent applications. It emphasizes:

  • Modularity: Construct agents from reusable components (core logic, memory, tools).
  • Predictability: Define clear agent interactions using Pydantic schemas.
  • Memory: Equip agents with persistent memory using vector stores like ChromaDB.
  • Extensibility: Easily integrate various LLM providers and custom tools.
  • Control: Maintain fine-grained control over agent behavior and data flow.

Inspired by frameworks like Atomic Agents, Karo aims to provide developers with the building blocks needed for creating sophisticated, reliable AI agents.

Key Features

  • Schema-Driven Development: Use Pydantic for defining agent inputs, outputs, and tool parameters.
  • Provider Abstraction: Pluggable interface for different LLM providers (OpenAI included).
  • Persistent Memory: Built-in MemoryManager using ChromaDBService for storing and retrieving relevant context.
  • Tool Integration: Define and integrate custom tools for agents to use.
  • Pythonic Control Flow: All agent logic and orchestration is written in Python.

Installation

pip install karo

(Note: Replace karo with the actual package name if different)

See the full Installation Guide for details on setting up dependencies and environment variables (like OPENAI_API_KEY).

Quickstart

Here's a minimal example of creating a basic agent:

import os
from dotenv import load_dotenv
from karo.core.base_agent import BaseAgent, BaseAgentConfig
from karo.providers.openai_provider import OpenAIProvider, OpenAIProviderConfig
from karo.schemas.base_schemas import BaseInputSchema, BaseOutputSchema

# Load API keys from .env file in your project root
load_dotenv()

# Configure provider (requires OPENAI_API_KEY in .env)
provider_config = OpenAIProviderConfig(model="gpt-4o-mini")
provider = OpenAIProvider(config=provider_config)

# Configure agent
agent_config = BaseAgentConfig(provider=provider)
agent = BaseAgent(config=agent_config)

# Run agent
input_data = BaseInputSchema(chat_message="Explain the concept of AI agents briefly.")
result = agent.run(input_data)

if isinstance(result, BaseOutputSchema):
    print(f"Agent: {result.response_message}")
else:
    print(f"Error: {result.error_message}")

For more detailed examples, including memory and tool usage, check out the Quickstart Guide.

Documentation

Full documentation, including guides and API references, can be found in the docs/ directory (or at the hosted documentation site - link TBD).

Contributing

Contributions are welcome! Please see the Contributing Guidelines for more information.

License

Karo is licensed under the MIT License. See the LICENSE file for details.

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

karo-0.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

karo-0.1.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file karo-0.1.0.tar.gz.

File metadata

  • Download URL: karo-0.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.3 Darwin/22.6.0

File hashes

Hashes for karo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7602fee6b4eae7684b925612944006011816f7e2950105e391218a084607ea52
MD5 5817152836a230fddd91922d8815f92f
BLAKE2b-256 34c7a860cd79d66b14466fdb8ed5de5e7f2b3dc68ca78077cfaa48e95e146b0c

See more details on using hashes here.

File details

Details for the file karo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: karo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.3 Darwin/22.6.0

File hashes

Hashes for karo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5870e335842ad5e3ede139e0eba96a7baa78ffe78aeb7a3bfbbf368b76d70fef
MD5 784557bfa37163be023b192610e7374a
BLAKE2b-256 dca5224839ccae990aebd6fe15eac480b262a3cfeec6d09a33258405a9836741

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