Skip to main content

The G-Brain Company Brain Primitive: continuously compiles Slack, Jira, and Gmail into an executable, conflict-resolved operational state for AI agents.

Project description

ain-state-compiler

The G-Brain Company Brain Primitive: continuously compiles Slack, Jira, and Gmail into an executable, conflict-resolved operational state for AI agents.

Overview

The ain-state-compiler operates 100% offline at the source level, parsing and aggregating enterprise communication and issue-tracking streams to produce internally consistent state representations. It prevents AI agents from executing against stale, fragmented, or conflicting corporate knowledge.

Key Outputs

  • Institutional Memory Modules (IMMs): Markdown-based, human- and machine-readable state snapshots.
  • Operational Execution Graphs (OEGs): Optimized YAML topologies representing resolution paths.
  • Active Conflict Reports: Discrepancy matrices identifying contradictions between engineering, marketing, and support data.

Installation

pip install ain-state-compiler

Usage

from ain_state_compiler.compiler import StateCompiler

# The project directory should contain a 'mock_data' folder with slack_history.json, jira_issues.json, and emails.json
compiler = StateCompiler(project_dir="/path/to/project")
summary = compiler.compile()

print(f"Processed {summary['processed_slack_events']} Slack events.")
print(f"Detected {summary['detected_conflicts']} active state conflicts.")

Core Architecture

"Ponytail" Lazy Gatekeepers

Internalizes the spirit of the "lazy senior dev" reductionist mindset directly into the core architecture:

  • LazyStateFilter: A strict deterministic "No-Op" filter that drops incoming data if it does not meaningfully mutate the operational state.
  • StateReuseEngine: Scans a historical cache of previously resolved conflicts. If a highly similar transformation exists, the compiler clones and adapts rather than generating from scratch.
  • StateCompilerEngine: Enforces rigid bounds (max_tokens, length limits) on LLM compilation passes, aborting cleanly to naive primitives if structural code bloat occurs.

Conflict Detection & Optimization

  • ConflictDetector: Runs rule-based, deterministic logic to spot discrepancies before invoking generation.
  • TokenOptimizer: Compresses verbose JSON state outputs into highly dense YAML representations, minimizing token footprint for downstream agent ingestion.

Changelog

v0.9.0 (Current)

  • LLM-Native Retrieval Revamp: Shifted away from raw Markdown context dumps to token-efficient Retrieval-Augmented Generation (RAG).
  • FTS5 Fast Search: Extracted tight, context-rich snippets (truncated to scale) instead of unbounded document loads.
  • MCP Server: Added mcp_server.py using FastMCP exposing search_ain_context and search_ain_by_tag to tools like Claude Desktop and Codex.
  • Native Ollama Tools: Added ollama_plugin.py to route local queries securely through tool-calling pipelines.

v0.8.3

  • Rebranding: Updated GitHub URLs and package author metadata to That-Tech-Geek.

v0.8.1

  • Ponytail Architecture: Introduced LazyStateFilter, StateReuseEngine, and StateCompilerEngine programmatic gatekeepers.
  • State Minimization: Implemented deterministic noise filtering and semantic hash comparisons to prevent unnecessary compilation.
  • Token/Complexity Penalties: Set rigid metric constraints for generative compilation steps to minimize complexity.

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

ain_state_compiler-0.9.0.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

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

ain_state_compiler-0.9.0-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

Details for the file ain_state_compiler-0.9.0.tar.gz.

File metadata

  • Download URL: ain_state_compiler-0.9.0.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for ain_state_compiler-0.9.0.tar.gz
Algorithm Hash digest
SHA256 fa43d098c0190f2017334d69959f68260b1a30bd3604edcbfc98e823463cf67c
MD5 729530af7d587d8f649f5ba68a8d14b1
BLAKE2b-256 3ea09db729a1cf2205d3d76f457048c957795dcbec4342d3eafd07250505d4e4

See more details on using hashes here.

File details

Details for the file ain_state_compiler-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ain_state_compiler-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d66f2507bc190c3eae950ad4b207aec05edb5831b69e3526d2db08c78bfbb8e
MD5 38cbb65879aa889f49ed1f3ef6ebe7ec
BLAKE2b-256 d2e8f3ec1215ff799a5672a465de9f0d8e82d21c5a29b2acf86e3d36c1502817

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