Contributing
Guidelines for contributing to Remina.
Development Setup
# Clone and setup
git clone https://github.com/bikidsx/remina
cd remina
python -m venv .venv
source .venv/bin/activate # Linux/macOS
pip install -e ".[all,dev]"
# Start infrastructure
docker-compose up -d
# Run tests
pytestProject Structure
remina/
├── remina/
│ ├── __init__.py
│ ├── cache.py
│ ├── exceptions.py
│ ├── models.py
│ ├── configs/
│ ├── embeddings/
│ ├── llms/
│ ├── memory/
│ ├── storage/
│ ├── vector_stores/
│ └── utils/
├── examples/
├── tests/
├── docs/
├── pyproject.toml
└── docker-compose.ymlAdding a New Provider
1. Create Provider Class
# remina/storage/dynamodb.py
from remina.storage.base import StorageBase
from remina.models import Memory
from typing import List, Dict, Any, Optional
class DynamoDBStorage(StorageBase):
def __init__(self, config: Optional[Dict[str, Any]] = None):
super().__init__(config)
# Initialize client
async def save(self, memories: List[Memory]) -> None:
pass
async def get(self, ids: List[str]) -> List[Memory]:
return []
# Implement remaining methods2. Register in Factory
# remina/utils/factory.py
class StorageFactory:
provider_map = {
"dynamodb": "remina.storage.dynamodb.DynamoDBStorage",
}3. Add Configuration
# remina/configs/storage.py
class DynamoDBConfig(BaseModel):
table_name: str = Field("remina_memories")
region: str = Field("us-east-1")4. Add Tests
# tests/test_storage_dynamodb.py
import pytest
from remina.storage.dynamodb import DynamoDBStorage
@pytest.mark.asyncio
async def test_dynamodb_save():
storage = DynamoDBStorage({"table_name": "test"})
# Test implementation5. Update Documentation
Add documentation in docs/pages/providers/storage.mdx.
Code Style
# Format
black remina/
# Lint
ruff check remina/Type Hints
Required for all public APIs:
def search(
self,
query: str,
user_id: str,
limit: int = 10,
filters: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
...Docstrings
Use Google-style:
def add(
self,
messages: Union[str, List[Dict[str, str]]],
user_id: str,
metadata: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
"""
Extract and store memories from messages.
Args:
messages: Text string or list of message dicts
user_id: User identifier
metadata: Optional metadata to attach
Returns:
Dict with 'results' containing added memories
Raises:
LLMError: If fact extraction fails
StorageError: If saving fails
"""Testing
# All tests
pytest
# With coverage
pytest --cov=remina
# Specific file
pytest tests/test_memory.py
# Unit tests only
pytest -m "not integration"Pull Request Process
- Fork the repository
- Create feature branch:
git checkout -b feature/my-feature - Make changes
- Run tests:
pytest - Format code:
black remina/ - Commit with clear messages
- Push and open PR
PR Checklist
- Tests pass
- Code formatted
- Documentation updated
- No breaking changes (or documented)
Reporting Issues
Bug reports: Include Python version, Remina version, reproduction code, error messages.
Feature requests: Include use case description and proposed API.
License
Contributions are licensed under Apache 2.0.