Function Catalogο
Welcome to the Function Catalog section of the memories-dev documentation. This comprehensive catalog provides a detailed index of all functions available in the framework, organized by module and purpose.
Note
The Function Catalog is an essential reference for developers working with the memories-dev API. It provides detailed information about each function, including parameters, return values, and usage examples.
How to Use This Catalogο
Functions in this catalog are organized by module and purpose. You can:
Navigate through the module structure to find functions by location
Use the search functionality to find specific functions by name
Browse the categorized function listings to discover capabilities
Each function entry includes:
Full function signature with type annotations
Detailed description of the functionβs purpose
Parameter descriptions with types and default values
Return value description with type information
Usage examples
Links to related functions and classes
Core Functionsο
Memory Managementο
- memories.MemoryStore.store(key, data, metadata=None, tier=None)
Store data in the memory system with associated metadata.
- Parameters:
- Returns:
Boolean indicating success
- Return type:
Example:
from memories import MemoryStore, Config memory_store = MemoryStore(Config()) memory_store.store( key="location_123", data={"satellite_image": image_data}, metadata={"location": {"lat": 37.7749, "lon": -122.4194}} )
- memories.MemoryStore.retrieve(key, include_metadata=False)
Retrieve data from the memory system.
- Parameters:
- Returns:
The retrieved data or (data, metadata) if include_metadata is True
- Return type:
Example:
from memories import MemoryStore, Config memory_store = MemoryStore(Config()) data, metadata = memory_store.retrieve( key="location_123", include_metadata=True )
- memories.MemoryStore.query(query, limit=10, include_metadata=False)
Query the memory system for data matching the query.
- Parameters:
- Returns:
List of matching data items or (data, metadata) pairs
- Return type:
Example:
from memories import MemoryStore, Config memory_store = MemoryStore(Config()) results = memory_store.query( query={ "location": { "lat": {"$gte": 37.7, "$lte": 37.8}, "lon": {"$gte": - 122.5, "$lte": -122.4} } }, limit=5, include_metadata=True )
Earth Analyzersο
- memories.core.analyzers.TerrainAnalyzer.analyze(location, resolution='medium')
Analyze the terrain features of a location.
- Parameters:
- Returns:
Terrain analysis results
- Return type:
Example:
from memories.core.analyzers import TerrainAnalyzer analyzer = TerrainAnalyzer() results = await analyzer.analyze( location={"lat": 37.7749, "lon": -122.4194}, resolution="high" )
- memories.core.analyzers.ClimateAnalyzer.analyze(location, time_range=None)
Analyze climate data for a location over a time range.
- Parameters:
- Returns:
Climate analysis results
- Return type:
Example:
from memories.core.analyzers import ClimateAnalyzer analyzer = ClimateAnalyzer() results = await analyzer.analyze( location={"lat": 37.7749, "lon": -122.4194}, time_range={ "start": "2020-01-01", "end": "2023-01-01" } )
Model Integrationο
- memories.models.load_model.LoadModel.__init__(model_provider, model_name, **kwargs)
Initialize a model with the specified provider and name.
- Parameters:
- Returns:
Model instance
- Return type:
Example:
from memories.models.load_model import LoadModel model = LoadModel( model_provider="openai", model_name="gpt-4", api_key=os.environ.get("OPENAI_API_KEY") )
- memories.models.load_model.LoadModel.generate(prompt, **kwargs)
Generate a response using the model.
- Parameters:
prompt (str) β The prompt to send to the model
kwargs β Additional generation parameters
- Returns:
Generated response
- Return type:
Example:
from memories.models.load_model import LoadModel model = LoadModel( model_provider="anthropic", model_name="claude-3-opus" ) response = await model.generate( prompt="Analyze the climate risks for San Francisco", max_tokens=1000, temperature=0.7 )
Data Acquisitionο
- memories.data_acquisition.SatelliteClient.get_imagery(location, date, resolution='medium')
Retrieve satellite imagery for a location and date.
- Parameters:
- Returns:
Satellite imagery data
- Return type:
Example:
from memories.data_acquisition import SatelliteClient client = SatelliteClient() imagery = await client.get_imagery( location={"lat": 37.7749, "lon": -122.4194}, date="2023-06-15", resolution="high" )
Utility Functionsο
- memories.utils.geo_utils.calculate_distance(point1, point2)
Calculate the distance between two geographic points.
- Parameters:
- Returns:
Distance in meters
- Return type:
Example:
from memories.utils.geo_utils import calculate_distance distance = calculate_distance( point1={"lat": 37.7749, "lon": -122.4194}, point2={"lat": 37.3382, "lon": -121.8863} ) print(f"Distance: {distance} meters")
- memories.utils.geo_utils.is_point_in_polygon(point, polygon)
Check if a point is within a polygon.
- Parameters:
- Returns:
True if point is in polygon, False otherwise
- Return type:
Example:
from memories.utils.geo_utils import is_point_in_polygon is_inside = is_point_in_polygon( point={"lat": 37.7749, "lon": -122.4194}, polygon=[ {"lat": 37.7, "lon": -122.5}, {"lat": 37.8, "lon": -122.5}, {"lat": 37.8, "lon": -122.4}, {"lat": 37.7, "lon": -122.4} ] ) print(f"Point is inside polygon: {is_inside}")
Function Categoriesο
Alphabetical Indexο
This section provides an alphabetical listing of all functions in the framework:
Function Name |
Module |
|---|---|
calculate_distance |
memories.utils.geo_utils |
ClimateAnalyzer.analyze |
memories.core.analyzers |
generate |
memories.models.load_model |
get_imagery |
memories.data_acquisition |
is_point_in_polygon |
memories.utils.geo_utils |
LoadModel.__init__ |
memories.models.load_model |
MemoryStore.query |
memories |
MemoryStore.retrieve |
memories |
MemoryStore.store |
memories |
TerrainAnalyzer.analyze |
memories.core.analyzers |
Function Searchο
Use the search box at the top of this page to find specific functions. You can search by function name, module name, or functionality.
For a comprehensive API reference, see the βindex>β section.