Skip to main content

Semantic File Index for AI Agents

Project description

Meaning

Semantic File Index for AI Agents

A lean, text-based semantic layer that lives alongside your files, readable by any AI agent, requiring no external services or embeddings.

The Problem

AI agents operating on codebases lack semantic context. They see files as paths and text, not as purposeful artifacts with relationships. This causes inefficient navigation, missed dependencies, and lost context between sessions.

The Solution

Meaning adds a .meaning/ directory to your project containing:

  • index.yaml โ€” Semantic records for all files (intent, tags, relationships)
  • schema.yaml โ€” Project-specific vocabulary and relationship types
  • config.yaml โ€” Exclusion patterns and settings

When you say "update how API responses are parsed," your AI agent can read the index and know exactly which files to touch.


๐Ÿ‘‰ Get Started in 5 Minutes ๐Ÿ‘ˆ


Status

v0.2 โ€” Modular Architecture โœ…

  • โœ… Modular codebase - 8 specialized modules (constants, models, index_io, validation, project, index_ops, query, cli)
  • โœ… Inference engine (meaning_inference.py) - 1,222 lines with 80+ built-in rules
  • โœ… Rule-based inference - Automatic metadata for common files (.gitignore, CLAUDE.md, *.slurm)
  • โœ… Enhanced tag vocabulary - 7 categories (HPC, AI agents, scientific computing, data ops)
  • โœ… Status command - Instant project overview with concepts, health metrics, and recent activity
  • โœ… Query engine - Natural language semantic search (6 query types, <50ms response)
  • โœ… Five Claude Code skills (/meaning-init, /meaning-update, /meaning-validate, /meaning-review, /meaning-query)
  • โœ… Hook scripts for automatic tracking
  • โœ… Dog-fooded on itself (75 files indexed, 190 tests passing)

Next: PyPI release, real-world validation testing

Quick Start

Installation

# Install from source (PyPI coming soon)
pip install git+https://github.com/bozaah/meaning-fs.git

# Or for development
git clone https://github.com/bozaah/meaning-fs.git
cd meaning-fs
uv venv && uv pip install -e ".[dev]"

Initialize a Project

# Basic initialization (auto-detects project type)
meaning init

# With Claude Code integration
meaning init --install-hooks --with-skills

# Skip file scanning (just setup the structure)
meaning init --skip-crawl

With Claude Code Skills

# In your project directory with Claude Code
/meaning-init              # Bootstrap .meaning/ with intelligent inference
/meaning-review            # Review and approve suggested metadata
/meaning-validate          # Check index health

# During development
/meaning-update            # Sync with filesystem changes
/meaning-query             # Semantic search

Discovering Your Project

Once initialized, instantly understand your codebase with zero latency:

# Get instant overview (concepts, health, recent activity)
python -m meaning status

# Natural language semantic search
python -m meaning query "what tests the core?"
python -m meaning query "show me all config files"
python -m meaning query "files that do parsing"
python -m meaning query "what needs review?"
python -m meaning query "what changed recently?"

Example output:

๐Ÿ” Query Results: Files that tests src/meaning/meaning_core.py
   Type: relationship

  Found 1 file (showing 1):

  1.   tests/test_core.py
      "Comprehensive test suite for core data structures..."
      Tags: test, module
      Relationships: tests(1), imports(1)

Or use the skill in Claude Code:

/meaning-query what tests the inference engine?

6 Query Types Supported:

  • Status: "what needs review?", "what is stale?"
  • Tag: "show me all test files", "find config files"
  • Relationship: "what tests X?", "what documents Y?"
  • Intent: "files that do parsing", "files about auth"
  • Temporal: "what changed recently?"
  • Concept: "show me the core library"

Features

  • Instant Discovery - status command shows project overview in <50ms
  • Semantic Query - Natural language search across 6 query types (status, tag, relationship, intent, temporal, concept)
  • Rule-Based Inference - 80+ built-in rules for automatic metadata on common files
    • Filename rules: .gitignore, requirements.txt, CLAUDE.md, Dockerfile, etc.
    • Path patterns: **/test_*.py, .github/workflows/*.yml, **/prompts/**/*.md
    • Extension rules: .slurm, .pbs, .env for domain-specific files
  • Intent Extraction - Docstrings, markdown summaries, and leading comment blocks for scripts
  • AI Agent Context Recognition - Automatic detection of CLAUDE.md, GEMINI.md, WARP.md, .cursorrules
  • Enhanced Tag Vocabulary - 7 domain-specific categories:
    • vcs (git, ignore, hooks)
    • ai_context (agent-context, llm-prompt)
    • scientific_domain (data-processing, ml, climate, bioinformatics)
    • infrastructure (hpc, cloud, container, ci-cd)
    • data_ops (etl, batch, sync, upload)
    • compute (slurm, pbs, spark, dask)
    • packaging (dependencies, dev)
  • 60%+ Auto-Accept Rate - Most common files get high-confidence metadata automatically
  • Git-Friendly - Human-readable YAML files that diff and merge cleanly
  • Zero Dependencies - Works offline, no external services or embeddings
  • Batch Review - Efficient workflows for reviewing many files at once
  • Claude Code Integration - Automatic tracking via hooks on file changes
  • Transparent - All suggestions show confidence levels and reasoning
  • Non-Destructive - Human reviews and approves all changes
  • Exclusion-Aware Updates - meaning update drops index entries matching exclude patterns

How It Works

File Entries

Each file gets a semantic record:

- path: src/api/parser.py
  intent: "Transforms raw API JSON responses into domain models"
  tags: [api, parsing, transforms]
  status: active
  relationships:
    - type: transforms
      source: src/api/client.py
      target: src/models/api_models.py

Rule-Based Inference

Common files are automatically recognized with high confidence:

# .gitignore โ†’ confidence: 1.0
- path: .gitignore
  intent: "Git version control ignore patterns"
  tags: [config, vcs, ignore]

# CLAUDE.md โ†’ confidence: 1.0  
- path: CLAUDE.md
  intent: "Claude AI agent project context and directives"
  tags: [doc, ai, agent-context]

# jobs/run.slurm โ†’ confidence: 0.95
- path: jobs/run.slurm
  intent: "SLURM batch job submission script"
  tags: [script, hpc, slurm, batch]

Concepts

Related files are grouped into concepts:

concepts:
  - name: api-parsing
    description: "External API response handling"
    files:
      - src/api/client.py
      - src/api/parser.py
      - src/models/api_models.py
    entry_point: src/api/parser.py

Claude Code Integration

Meaning includes hooks for Claude Code that automatically track file changes:

{
  "hooks": [
    {
      "matcher": { "type": "PostToolUse", "tool_name": ["write_file"] },
      "script": ".meaning/scripts/meaning-post-write.sh"
    }
  ]
}

Install hooks with:

python -m meaning init --install-hooks

Philosophy

Do not write code before stating assumptions.
Do not claim correctness you haven't verified.
Do not handle only the happy path.
Under what conditions does this work?

Project Structure

meaning/
โ”œโ”€โ”€ .agent-sessions/            # AI agent session notes
โ”œโ”€โ”€ .claude/                    # Claude Code configuration
โ”‚   โ”œโ”€โ”€ settings.json           # Project hooks and permissions
โ”‚   โ””โ”€โ”€ skills/                 # Skill definitions
โ”‚       โ”œโ”€โ”€ meaning-init/
โ”‚       โ”œโ”€โ”€ meaning-query/
โ”‚       โ”œโ”€โ”€ meaning-review/
โ”‚       โ”œโ”€โ”€ meaning-update/
โ”‚       โ””โ”€โ”€ meaning-validate/
โ”œโ”€โ”€ .meaning/                   # Dog-fooding: our own semantic index
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ meaning/
โ”‚       โ”œโ”€โ”€ __init__.py         # Public API exports
โ”‚       โ”œโ”€โ”€ __main__.py         # CLI entry point
โ”‚       โ”œโ”€โ”€ meaning_core.py     # Core library
โ”‚       โ”œโ”€โ”€ meaning_inference.py # Inference engine
โ”‚       โ”œโ”€โ”€ installer.py        # Installation logic
โ”‚       โ””โ”€โ”€ templates/          # Project templates
โ”‚           โ”œโ”€โ”€ schema/         # Project-type schemas (python, node, rust, docs, mixed)
โ”‚           โ”œโ”€โ”€ skills/         # Claude Code skill templates
โ”‚           โ”œโ”€โ”€ config.yaml     # Default config
โ”‚           โ”œโ”€โ”€ hooks.json      # Claude hooks template
โ”‚           โ””โ”€โ”€ scripts/        # Hook scripts for target projects
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ meaning-post-write.sh   # Post-mutation hook
โ”‚   โ”œโ”€โ”€ meaning-validate.sh     # Session-end hook
โ”‚   โ”œโ”€โ”€ run-inference.py        # Inference runner script
โ”‚   โ””โ”€โ”€ validate-meaning.sh     # Validate this project's index
โ””โ”€โ”€ tests/
    โ”œโ”€โ”€ fixtures/               # Test fixtures
    โ”œโ”€โ”€ test_core.py            # Core library tests
    โ”œโ”€โ”€ test_inference.py       # Inference engine tests
    โ””โ”€โ”€ test_installer.py       # Installer tests

Documentation

Supported File Types

Meaning includes built-in recognition for:

Category Files
Git/VCS .gitignore, .gitattributes, .gitmodules
Python requirements.txt, pyproject.toml, setup.py, conftest.py
Node.js package.json, yarn.lock, tsconfig.json
Rust Cargo.toml, Cargo.lock
Documentation README.md, CHANGELOG.md, LICENSE, CONTRIBUTING.md
AI Agents CLAUDE.md, GEMINI.md, WARP.md, AGENTS.md, .cursorrules
CI/CD Dockerfile, docker-compose.yml, GitHub workflows
HPC/Scientific .slurm, .pbs, .sge batch scripts
Data Ops upload_*.sh, download_*.sh, sync_*.sh patterns

License

MIT

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

meaning_fs-0.2.0.tar.gz (74.6 kB view details)

Uploaded Source

Built Distribution

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

meaning_fs-0.2.0-py3-none-any.whl (70.4 kB view details)

Uploaded Python 3

File details

Details for the file meaning_fs-0.2.0.tar.gz.

File metadata

  • Download URL: meaning_fs-0.2.0.tar.gz
  • Upload date:
  • Size: 74.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meaning_fs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f5f183276c025aa75701275fe792f226934ec5670e515ea65a4396d78cd004ad
MD5 6b1b2b5a0160feb3af0212848c7dd045
BLAKE2b-256 fbec857da5e649c421de48152c02ef9d6113b475287de6604ee5071d931079a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for meaning_fs-0.2.0.tar.gz:

Publisher: publish.yml on bozaah/meaning-fs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meaning_fs-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: meaning_fs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 70.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meaning_fs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cef93ab7ab728f26b74432432c32993d606493f840c57fc864a9e14a67541f6e
MD5 7d88bb2c18372ee40d03420d17e82003
BLAKE2b-256 f00c134879ccb102c413b5e90b7f23ce9a19f29485bc40969e201355890e23a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for meaning_fs-0.2.0-py3-none-any.whl:

Publisher: publish.yml on bozaah/meaning-fs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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