Skip to main content

A Package containing core logic and schema for rakam-systems

Project description

Rakam System Core

The core package of Rakam Systems providing foundational interfaces, base components, and utilities.

Overview

rakam-systems-core is the foundation of the Rakam Systems framework. It provides:

  • Base Component: Abstract base class with lifecycle management
  • Interfaces: Standard interfaces for agents, tools, vector stores, embeddings, and loaders
  • Configuration System: YAML/JSON configuration loading and validation
  • Tracking System: Input/output tracking for debugging and evaluation
  • Logging Utilities: Structured logging with color support

This package is required by both rakam-systems-agent and rakam-systems-vectorstore.

Installation

pip install -e ./rakam-systems-core

Key Components

BaseComponent

All components extend BaseComponent which provides:

  • Lifecycle management with setup() and shutdown() methods
  • Auto-initialization via __call__
  • Context manager support
  • Built-in evaluation harness
from rakam_systems_core.ai_core.base import BaseComponent

class MyComponent(BaseComponent):
    def setup(self):
        super().setup()
        # Initialize resources

    def shutdown(self):
        # Clean up resources
        super().shutdown()

    def run(self, *args, **kwargs):
        # Main logic
        pass

Interfaces

Standard interfaces for building AI systems:

  • AgentComponent: AI agents with sync/async support
  • ToolComponent: Callable tools for agents
  • LLMGateway: LLM provider abstraction
  • VectorStore: Vector storage interface
  • EmbeddingModel: Text embedding interface
  • Loader: Document loading interface
  • Chunker: Text chunking interface
from rakam_systems_core.ai_core.interfaces.agent import AgentComponent
from rakam_systems_core.ai_core.interfaces.tool import ToolComponent
from rakam_systems_core.ai_core.interfaces.vectorstore import VectorStore

Configuration System

Load and validate configurations from YAML files:

from rakam_systems_core.ai_core.config_loader import ConfigurationLoader

loader = ConfigurationLoader()
config = loader.load_from_yaml("agent_config.yaml")
agent = loader.create_agent("my_agent", config)

Tracking System

Track inputs and outputs for debugging:

from rakam_systems_core.ai_core.tracking import TrackingMixin

class MyAgent(TrackingMixin, BaseAgent):
    pass

agent.enable_tracking(output_dir="./tracking")
# Use agent...
agent.export_tracking_data(format='csv')

Package Structure

rakam-systems-core/
├── src/rakam_systems_core/
│   ├── ai_core/
│   │   ├── base.py              # BaseComponent
│   │   ├── interfaces/          # Standard interfaces
│   │   ├── config_loader.py     # Configuration system
│   │   ├── tracking.py          # I/O tracking
│   │   └── mcp/                 # MCP server support
│   └── ai_utils/
│       └── logging.py           # Logging utilities
└── pyproject.toml

Usage in Other Packages

Agent Package

# rakam-systems-agent uses core interfaces
from rakam_systems_core.ai_core.interfaces.agent import AgentComponent
from rakam_system_agent import BaseAgent

agent = BaseAgent(name="my_agent", model="openai:gpt-4o")

Vectorstore Package

# rakam-systems-vectorstore uses core interfaces
from rakam_systems_core.ai_core.interfaces.vectorstore import VectorStore
from rakam_systems_vectorstore import ConfigurablePgVectorStore

store = ConfigurablePgVectorStore(config=config)

Development

This package contains only interfaces and utilities. To contribute:

  1. Install in editable mode: pip install -e ./rakam-systems-core
  2. Make changes to interfaces or utilities
  3. Ensure backward compatibility with agent and vectorstore packages
  4. Update version in pyproject.toml

License

Apache 2.0

Links

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

rakam_systems_core-0.1.1rc8.tar.gz (138.4 kB view details)

Uploaded Source

Built Distribution

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

rakam_systems_core-0.1.1rc8-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file rakam_systems_core-0.1.1rc8.tar.gz.

File metadata

File hashes

Hashes for rakam_systems_core-0.1.1rc8.tar.gz
Algorithm Hash digest
SHA256 e4b912673115507605a46227ee15558417dfb1d58a55a9e980b257a869fa1a3a
MD5 af2cbd6d9f61e47677c90bc4aec0c252
BLAKE2b-256 f2bb9ac1370351577a1b5b1de45a0cb15f2e02e06342b95c557ef7d82f3b2487

See more details on using hashes here.

File details

Details for the file rakam_systems_core-0.1.1rc8-py3-none-any.whl.

File metadata

File hashes

Hashes for rakam_systems_core-0.1.1rc8-py3-none-any.whl
Algorithm Hash digest
SHA256 5920e3d6a359dd13b2aa7402158ed1b1f499af4685638bb9077486057c1b39fe
MD5 a4be9d6ab453e92536005894cbd073cc
BLAKE2b-256 4ba0d064daff6796d95924b67273778d55ec7ec5d6657945d7ca958f0a0a5f49

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