Skip to main content

A Geographical Knowledge Informed Code Evolver

Project description

GeoEvolve

GeoEvolve aims to accelerate geospatial model discovery by the power of large language models.

CLI Usage

pip install geoevolve

export OPENAI_API_KEY='your-openai-api-key'

# Optional If you already have a GeoKnowRAG
# Build GeoKnowRAG
python ./build_geo_knowledge_db.py --geo_knowledge_dir ./geo_knowledge --working_dir ../geoevolve_storage --chunk_size 300 --chunk_overlap 50 --topic_file ./topics.json --add_knowledge True --collect_knowledge True --github_token your-github-token --embedding_model text-embedding-3-large --llm_model gpt-4.1

# Run GeoEvolve
python ./run_geoevolve.py --initial_program_path path-to-initial_program --evaluator_path path-to-evaluator --config_path path-to-config --total_rounds 10 --num_iterations_per_round 10 --output path-to-output --log_name your_program_name --embedding_model text-embedding-3-large --llm_model gpt-4.1;

Library Usage

import os
from geoevolve import save_wiki_pages, save_arxiv_papers, save_github_codes, make_geo_know_db, run_geo_evolution

# Collect GeoKnowledge
topics = {
    'giscience_theory': [
    'Absolute vs relative vs relational space',
    'Cognitive geography',
    'Representation of scale in GIS'
  ],
  'spatial_modeling': [
    'Agent-based models in geography',
    'Spatial interaction models',
    'Gravity model in geography',
    'Entropy maximization models',
    'Complexity theory in geography'
  ]
}

for category, queries in topics.items():
    if not os.path.exists(f'./geo_knowledge/{category}'):
        os.mkdir(f'./geo_knowledge/{category}')
    print(f'Category: {category}')
    for query in queries:
        save_wiki_pages(query, db_path='./geo_knowledge', category=category)
        save_arxiv_papers(query, max_results=3, db_path='./geo_knowledge', category=category)
        save_github_codes(query, max_repos=3, token='token', db_path='./geo_knowledge',
                                  category=category)
        
# Build GeoKnowRAG with Chroma
make_geo_know_db(geo_knowledge_dir='./geo_knowledge', 
                 persist_dir='./geoevolve_storage',
                 embedding_model_name='text-embedding-3-large',
                 llm_model_name='gpt-4.1',)


# Run GeoEvolve
run_geo_evolution(initial_program_file='your-initial-program-path',
                  evaluator_file='your-evaluator-file',
                  config_path='your-config-path',
                  rounds=15,
                  iterations_per_round=15,
                  output_path='your-output-path',
                  log_name='your-program-name',
                  embedding_model_name='text-embedding-3-large',
                  llm_model_name='gpt-4.1')

GeoEvolve: Automating Geospatial Model Discovery via Multi-Agent Large Language Models
Peng Luo, Xiayin Lou, Yu Zheng, Zhuo Zheng, Stefano Ermon

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

geoevolve-0.2.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

geoevolve-0.2.2-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file geoevolve-0.2.2.tar.gz.

File metadata

  • Download URL: geoevolve-0.2.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for geoevolve-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5e80b31da1198dcbb3098dd7a2c361d1104c570eaadb064e32723859eb4c410e
MD5 cff30f296c5d226baae16b66d60458c9
BLAKE2b-256 b4e13faa64d73c63d6d7e5cc0a26ca299b90722cbe0e636ccd4f795e27e3f2c8

See more details on using hashes here.

File details

Details for the file geoevolve-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: geoevolve-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for geoevolve-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18c903e1d3ffcd6d8d1fb77fa87b2ae2d0edee0832dfe1e4e669932a24a2bf43
MD5 0a81926bd2b72f54760965e3309a94e2
BLAKE2b-256 28e0cb681cd114014a13ff1f87b8a1b50387b60de1bb581eaf83cd3cdef0a8e2

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