rakam-systems-core 0.1.1rc7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rakam_systems_core/__init__.py +41 -0
- rakam_systems_core/ai_core/__init__.py +68 -0
- rakam_systems_core/ai_core/base.py +142 -0
- rakam_systems_core/ai_core/config.py +12 -0
- rakam_systems_core/ai_core/config_loader.py +580 -0
- rakam_systems_core/ai_core/config_schema.py +395 -0
- rakam_systems_core/ai_core/interfaces/__init__.py +30 -0
- rakam_systems_core/ai_core/interfaces/agent.py +83 -0
- rakam_systems_core/ai_core/interfaces/chat_history.py +122 -0
- rakam_systems_core/ai_core/interfaces/chunker.py +11 -0
- rakam_systems_core/ai_core/interfaces/embedding_model.py +10 -0
- rakam_systems_core/ai_core/interfaces/indexer.py +10 -0
- rakam_systems_core/ai_core/interfaces/llm_gateway.py +139 -0
- rakam_systems_core/ai_core/interfaces/loader.py +86 -0
- rakam_systems_core/ai_core/interfaces/reranker.py +10 -0
- rakam_systems_core/ai_core/interfaces/retriever.py +11 -0
- rakam_systems_core/ai_core/interfaces/tool.py +162 -0
- rakam_systems_core/ai_core/interfaces/tool_invoker.py +260 -0
- rakam_systems_core/ai_core/interfaces/tool_loader.py +374 -0
- rakam_systems_core/ai_core/interfaces/tool_registry.py +287 -0
- rakam_systems_core/ai_core/interfaces/vectorstore.py +37 -0
- rakam_systems_core/ai_core/mcp/README.md +545 -0
- rakam_systems_core/ai_core/mcp/__init__.py +0 -0
- rakam_systems_core/ai_core/mcp/mcp_server.py +334 -0
- rakam_systems_core/ai_core/tracking.py +602 -0
- rakam_systems_core/ai_core/vs_core.py +55 -0
- rakam_systems_core/ai_utils/__init__.py +16 -0
- rakam_systems_core/ai_utils/logging.py +126 -0
- rakam_systems_core/ai_utils/metrics.py +10 -0
- rakam_systems_core/ai_utils/s3.py +480 -0
- rakam_systems_core/ai_utils/tracing.py +5 -0
- rakam_systems_core-0.1.1rc7.dist-info/METADATA +162 -0
- rakam_systems_core-0.1.1rc7.dist-info/RECORD +34 -0
- rakam_systems_core-0.1.1rc7.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rakam-systems-core
|
|
3
|
+
Version: 0.1.1rc7
|
|
4
|
+
Summary: A Package containing core logic and schema for rakam-systems
|
|
5
|
+
Author-email: Mohamed Hilel <mohammedjassemhlel@gmail.com>, Peng Zheng <pengzheng990630@outlook.com>, somebodyawesome-dev <luckynoob2011830@gmail.com>
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: boto3>=1.26.0
|
|
8
|
+
Requires-Dist: pydantic
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# Rakam System Core
|
|
12
|
+
|
|
13
|
+
The core package of Rakam Systems providing foundational interfaces, base components, and utilities.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`rakam-system-core` is the foundation of the Rakam Systems framework. It provides:
|
|
18
|
+
|
|
19
|
+
- **Base Component**: Abstract base class with lifecycle management
|
|
20
|
+
- **Interfaces**: Standard interfaces for agents, tools, vector stores, embeddings, and loaders
|
|
21
|
+
- **Configuration System**: YAML/JSON configuration loading and validation
|
|
22
|
+
- **Tracking System**: Input/output tracking for debugging and evaluation
|
|
23
|
+
- **Logging Utilities**: Structured logging with color support
|
|
24
|
+
|
|
25
|
+
This package is required by both `rakam-system-agent` and `rakam-systems-vectorstore`.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install -e ./rakam-system-core
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Key Components
|
|
34
|
+
|
|
35
|
+
### BaseComponent
|
|
36
|
+
|
|
37
|
+
All components extend `BaseComponent` which provides:
|
|
38
|
+
|
|
39
|
+
- Lifecycle management with `setup()` and `shutdown()` methods
|
|
40
|
+
- Auto-initialization via `__call__`
|
|
41
|
+
- Context manager support
|
|
42
|
+
- Built-in evaluation harness
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from rakam_systems_core.ai_core.base import BaseComponent
|
|
46
|
+
|
|
47
|
+
class MyComponent(BaseComponent):
|
|
48
|
+
def setup(self):
|
|
49
|
+
super().setup()
|
|
50
|
+
# Initialize resources
|
|
51
|
+
|
|
52
|
+
def shutdown(self):
|
|
53
|
+
# Clean up resources
|
|
54
|
+
super().shutdown()
|
|
55
|
+
|
|
56
|
+
def run(self, *args, **kwargs):
|
|
57
|
+
# Main logic
|
|
58
|
+
pass
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Interfaces
|
|
62
|
+
|
|
63
|
+
Standard interfaces for building AI systems:
|
|
64
|
+
|
|
65
|
+
- **AgentComponent**: AI agents with sync/async support
|
|
66
|
+
- **ToolComponent**: Callable tools for agents
|
|
67
|
+
- **LLMGateway**: LLM provider abstraction
|
|
68
|
+
- **VectorStore**: Vector storage interface
|
|
69
|
+
- **EmbeddingModel**: Text embedding interface
|
|
70
|
+
- **Loader**: Document loading interface
|
|
71
|
+
- **Chunker**: Text chunking interface
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from rakam_systems_core.ai_core.interfaces.agent import AgentComponent
|
|
75
|
+
from rakam_systems_core.ai_core.interfaces.tool import ToolComponent
|
|
76
|
+
from rakam_systems_core.ai_core.interfaces.vectorstore import VectorStore
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Configuration System
|
|
80
|
+
|
|
81
|
+
Load and validate configurations from YAML files:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from rakam_systems_core.ai_core.config_loader import ConfigurationLoader
|
|
85
|
+
|
|
86
|
+
loader = ConfigurationLoader()
|
|
87
|
+
config = loader.load_from_yaml("agent_config.yaml")
|
|
88
|
+
agent = loader.create_agent("my_agent", config)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Tracking System
|
|
92
|
+
|
|
93
|
+
Track inputs and outputs for debugging:
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from rakam_systems_core.ai_core.tracking import TrackingMixin
|
|
97
|
+
|
|
98
|
+
class MyAgent(TrackingMixin, BaseAgent):
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
agent.enable_tracking(output_dir="./tracking")
|
|
102
|
+
# Use agent...
|
|
103
|
+
agent.export_tracking_data(format='csv')
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Package Structure
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
rakam-system-core/
|
|
110
|
+
├── src/rakam_systems_core/
|
|
111
|
+
│ ├── ai_core/
|
|
112
|
+
│ │ ├── base.py # BaseComponent
|
|
113
|
+
│ │ ├── interfaces/ # Standard interfaces
|
|
114
|
+
│ │ ├── config_loader.py # Configuration system
|
|
115
|
+
│ │ ├── tracking.py # I/O tracking
|
|
116
|
+
│ │ └── mcp/ # MCP server support
|
|
117
|
+
│ └── ai_utils/
|
|
118
|
+
│ └── logging.py # Logging utilities
|
|
119
|
+
└── pyproject.toml
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Usage in Other Packages
|
|
123
|
+
|
|
124
|
+
### Agent Package
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
# rakam-system-agent uses core interfaces
|
|
128
|
+
from rakam_systems_core.ai_core.interfaces.agent import AgentComponent
|
|
129
|
+
from rakam_system_agent import BaseAgent
|
|
130
|
+
|
|
131
|
+
agent = BaseAgent(name="my_agent", model="openai:gpt-4o")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Vectorstore Package
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
# rakam-systems-vectorstore uses core interfaces
|
|
138
|
+
from rakam_systems_core.ai_core.interfaces.vectorstore import VectorStore
|
|
139
|
+
from rakam_systems_vectorstore import ConfigurablePgVectorStore
|
|
140
|
+
|
|
141
|
+
store = ConfigurablePgVectorStore(config=config)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Development
|
|
145
|
+
|
|
146
|
+
This package contains only interfaces and utilities. To contribute:
|
|
147
|
+
|
|
148
|
+
1. Install in editable mode: `pip install -e ./rakam-system-core`
|
|
149
|
+
2. Make changes to interfaces or utilities
|
|
150
|
+
3. Ensure backward compatibility with agent and vectorstore packages
|
|
151
|
+
4. Update version in `pyproject.toml`
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
Apache 2.0
|
|
156
|
+
|
|
157
|
+
## Links
|
|
158
|
+
|
|
159
|
+
- [Main Repository](https://github.com/Rakam-AI/rakam-systems)
|
|
160
|
+
- [Documentation](../docs/)
|
|
161
|
+
- [Agent Package](../rakam-system-agent/)
|
|
162
|
+
- [Vectorstore Package](../rakam-systems-vectorstore/)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
rakam_systems_core/__init__.py,sha256=quPHjgOzz9OiycbJClJzeq909xoyjZ9D05OkqCqQ8yI,797
|
|
2
|
+
rakam_systems_core/ai_core/__init__.py,sha256=vdxaDCyMlyPxo_MPZMcm4kp0WcM-IzouDaMqffwdroI,1430
|
|
3
|
+
rakam_systems_core/ai_core/base.py,sha256=z73yRZ9bhQ9GQMWmuYTf-k5RTyOXl2Py9jEHAzU6KIA,5023
|
|
4
|
+
rakam_systems_core/ai_core/config.py,sha256=Xavg3Y4DuGPnY4P3evnl7K39qqZL0brEO-C_8qHqvvo,374
|
|
5
|
+
rakam_systems_core/ai_core/config_loader.py,sha256=rPnp9-UdIyDBR2LjkJuekRZ4DFc1sD3s2-_Ukv15gv8,20762
|
|
6
|
+
rakam_systems_core/ai_core/config_schema.py,sha256=2xeJynv67GTr1_fs35nky03a461bnDptff5k82VW7eI,16521
|
|
7
|
+
rakam_systems_core/ai_core/tracking.py,sha256=6aNokIdBGlWrCw47ql7emIbuO1VGeN2BlwRNiURUWnI,20632
|
|
8
|
+
rakam_systems_core/ai_core/vs_core.py,sha256=9dJUzQTB7GMBE9KDgFdcTY67A7LzGvisL6uB-at5yNM,1722
|
|
9
|
+
rakam_systems_core/ai_core/interfaces/__init__.py,sha256=iGnPAQOyQqRRZq3wfNKtaPwAb7Mk6UNj6wVbxt2_Z2I,853
|
|
10
|
+
rakam_systems_core/ai_core/interfaces/agent.py,sha256=hrDwyaIpZaSLesiOrz8ra8GMX31tvvnNCjG2Vapw2io,3652
|
|
11
|
+
rakam_systems_core/ai_core/interfaces/chat_history.py,sha256=qWvoVES_0MTPdHd_3bd5GmgVOQg-KpMSneWDW0JqFag,4052
|
|
12
|
+
rakam_systems_core/ai_core/interfaces/chunker.py,sha256=E0g4eBUL83MWE_xKiIg4nBJVtK7kS82k9YwmwSGXIjY,380
|
|
13
|
+
rakam_systems_core/ai_core/interfaces/embedding_model.py,sha256=EnW732q6su9vnYuR8SYfdDSbltwuD2w7TGxshSO1OLU,331
|
|
14
|
+
rakam_systems_core/ai_core/interfaces/indexer.py,sha256=XNGJ-tgX7DMiDlNCU-9G6UEJmf3bndc28FplTgVFnro,373
|
|
15
|
+
rakam_systems_core/ai_core/interfaces/llm_gateway.py,sha256=tFcFCsa5Y1HbXO0TcAX5SlVbNoN3urdZSVMiPlxZKn0,3913
|
|
16
|
+
rakam_systems_core/ai_core/interfaces/loader.py,sha256=w5JTN0nwPZK7iaKMUh6U2COFspsCg3ETzhsLFRjf5fI,2573
|
|
17
|
+
rakam_systems_core/ai_core/interfaces/reranker.py,sha256=X8Wn8qRRo9oW66hiAi7z2vNvBKXLSm6C0akdQL_xDjo,374
|
|
18
|
+
rakam_systems_core/ai_core/interfaces/retriever.py,sha256=EYqrwxnI3rzd-XedWLC1qOt4n3ZGD8_jq6zv9_yH5fA,419
|
|
19
|
+
rakam_systems_core/ai_core/interfaces/tool.py,sha256=K-CCZUEGoqgnVq4tu8E0MVS6gaXOSgPazb40rI-vdxQ,5465
|
|
20
|
+
rakam_systems_core/ai_core/interfaces/tool_invoker.py,sha256=jh6bg9Q8_RuMejifLgx7Gez-t6d66VS_TA8A7gkXbRA,8908
|
|
21
|
+
rakam_systems_core/ai_core/interfaces/tool_loader.py,sha256=-GJ6BvFOnIop_Mg9cZNbrNhjpqYTtUY8qPFOkDmSp0Y,12110
|
|
22
|
+
rakam_systems_core/ai_core/interfaces/tool_registry.py,sha256=nd4PaH24tsWf0umCf6nBszgOEdizHgofzd0Zz7YRY50,9367
|
|
23
|
+
rakam_systems_core/ai_core/interfaces/vectorstore.py,sha256=q8XnDNex1J882Y3WPigTC5f21c7xvNNXRnZoomQHvrs,1200
|
|
24
|
+
rakam_systems_core/ai_core/mcp/README.md,sha256=LsVdvbJCVThz40cGWjLGtYdpw2PjWZf0MJa0jDqdid4,12055
|
|
25
|
+
rakam_systems_core/ai_core/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
rakam_systems_core/ai_core/mcp/mcp_server.py,sha256=aDsNv9-3bdYPGKai4aWXoqW6HrJ9cb5JDmojAPOvuIk,10599
|
|
27
|
+
rakam_systems_core/ai_utils/__init__.py,sha256=sM3eT765z34-G4XHVMtc5g3ch_FaGp4PSuzf2b5lM3A,203
|
|
28
|
+
rakam_systems_core/ai_utils/logging.py,sha256=wIfoTFS5fqgRrJeFaOJUQNRd8P9gKhbjfGn28HoxWxY,3256
|
|
29
|
+
rakam_systems_core/ai_utils/metrics.py,sha256=uhCjV-QPBTrOmYmxNOdg1I3ZbEv8oqAMllpYkcTLHfA,246
|
|
30
|
+
rakam_systems_core/ai_utils/s3.py,sha256=rlcGwoiMDpDRdwPABPpkJ0FScovfqaTXN6hpFpnbeGc,13210
|
|
31
|
+
rakam_systems_core/ai_utils/tracing.py,sha256=QivJoqQpwHfd120MBqkPKlTg7rNCI4ITMr9avrNgn0w,212
|
|
32
|
+
rakam_systems_core-0.1.1rc7.dist-info/METADATA,sha256=C8mydIVlmBP-5ndsRjXDNZV-vfiGkQI18ECJboxD6_M,4549
|
|
33
|
+
rakam_systems_core-0.1.1rc7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
34
|
+
rakam_systems_core-0.1.1rc7.dist-info/RECORD,,
|