Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
536ea57
feat: add CASTS for LLM-Graph based reasoning
Appointat Dec 29, 2025
40cc3ba
feat: enhance simulation evaluation with metadata and improve configu…
Appointat Dec 29, 2025
9d4ef40
feat: enhance LLM Oracle and Simulation Engine with Debug Logging and…
Appointat Dec 30, 2025
2a685f0
feat(reasoning): implement canonical storage with abstract matching f…
Appointat Jan 4, 2026
ac6b49e
chore: update type hints to use List and improve code formatting acro…
Appointat Jan 4, 2026
b62e524
feat: enhance LLM Oracle with starting node type recommendations
Appointat Jan 7, 2026
9b2f976
feat: implement simplePath() cycle prevention with LLM-driven path qu…
Appointat Jan 9, 2026
a48cd40
feat(metrics): add rollback_steps method to MetricsCollector
Appointat Jan 19, 2026
e1aaf2f
Merge branch 'apache:master' into master
Appointat Feb 2, 2026
ef4510d
refactor: refactor metrics handling and evaluation logic in CASTS sim…
Appointat Feb 2, 2026
2472786
refactor: refactor code structure for improved readability and mainta…
Appointat Feb 3, 2026
e534be4
refactor: move CASTS into geaflow-ai operator
Appointat Feb 4, 2026
569f319
reafactor: refactor type hints across multiple modules to use built-i…
Appointat Feb 4, 2026
53d4457
refactor: update type hints for GremlinState and PathEvaluator for im…
Appointat Feb 4, 2026
f800300
refactor: update imports to use StrategyCache from strategy_cache module
Appointat Feb 4, 2026
e9c94d1
refactor: update module documentation to improve clarity and consistency
Appointat Feb 4, 2026
ac210cc
Merge branch 'apache:master' into master
Appointat Feb 9, 2026
aa6ceb5
fix the comments
Appointat Feb 12, 2026
3677bba
refactor: remove unnecessary blank lines in embedding.py and add a bl…
Appointat Feb 12, 2026
c0e0c84
fix: remove --frozen flag from uv sync commands in README and CI work…
Appointat Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci-py311.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CASTS Python Tests

on:
pull_request:
paths:
- "geaflow-ai/plugins/casts/**"
push:
branches: ["master"]
paths:
- "geaflow-ai/plugins/casts/**"
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: geaflow-ai/plugins/casts
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: pip install uv
- name: Sync deps
run: uv sync
- name: Run tests
run: uv run pytest
22 changes: 22 additions & 0 deletions geaflow-ai/plugins/casts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Byte-compiled / optimized files
__pycache__/
*.py[cod]
CASTS.egg-info/*

# Environment variables
.env

# Virtual environment
.venv/
uv.lock

# Logs
/logs/

# IDE / OS specific
.vscode/
.DS_Store

# Data files
data/real_graph_data/
casts_traversal_path_req_*.png
100 changes: 100 additions & 0 deletions geaflow-ai/plugins/casts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# CASTS (Context-Aware Strategy Cache System)

CASTS is a strategy cache for graph traversal systems. It learns, stores, and
retrieves traversal decisions (strategies) based on structural signatures,
node properties, and goals, with optional LLM-driven guidance.

## Name Origin

CASTS stands for **Context-Aware Strategy Cache System**.

## Design Goals

- Cache traversal strategies (SKUs) to reduce repeated LLM calls.
- Separate schema metadata from execution logic.
- Support both synthetic and real-world graph data.
- Keep the core cache logic deterministic and testable.

## Module Layout

- `core`: cache, schema, configuration, and core models
- `data`: data sources and graph generation (synthetic + real)
- `services`: embedding + LLM services
- `simulation`: simulation engine and evaluation
- `tests`: unit and integration tests

## Repository Placement

This module is intended to live under `geaflow-ai/plugins/casts` as a standalone
plugin, with the Python package located at the module root.

## Configuration (Required)

The following environment variables are required. Missing values raise a
`ValueError` at startup:

- `EMBEDDING_ENDPOINT`
- `EMBEDDING_APIKEY`
- `EMBEDDING_MODEL`
- `LLM_ENDPOINT`
- `LLM_APIKEY`
- `LLM_MODEL`

You can use a local `.env` file for development. The code does not provide
automatic fallbacks for missing credentials.

## Real Data Loading

The default loader reads CSV files from `data/real_graph_data` (or
`real_graph_data`) and builds a directed graph. You can override this behavior
by providing a custom loader:

```python
from data.graph_generator import GraphGeneratorConfig, GraphGenerator

def my_loader(config: GraphGeneratorConfig):
# return nodes, edges
return {}, {}

config = GraphGeneratorConfig(use_real_data=True, real_data_loader=my_loader)
graph = GraphGenerator(config=config)
```

## Schema Updates

`InMemoryGraphSchema` caches type-level labels. If you mutate nodes or edges
after creation, call `mark_dirty()` or `rebuild()` before querying schema data.

## Running a Simulation

From the plugins directory (parent of this module):

```bash
cd /Users/kuda/code/geaflow/geaflow-ai/plugins
uv sync
python -m simulation.runner
```

## Tests

Run tests locally:

```bash
uv sync
pytest
```

There is no GitHub Actions workflow for this module by default.

## Documentation

- `docs/dependency_licenses.md`: Direct-dependency license summary and verification notes.

## Dependency Mirrors

This project does not hardcode PyPI mirrors. Configure mirrors in your
environment or tooling if needed.

## Third-Party Licenses

See `docs/dependency_licenses.md` for a direct-dependency license summary.
17 changes: 17 additions & 0 deletions geaflow-ai/plugins/casts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

17 changes: 17 additions & 0 deletions geaflow-ai/plugins/casts/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

Loading
Loading