Metadata-Version: 2.4
Name: agentfoundry
Version: 1.3.11
Summary: AgentFoundry: A modular autonomous AI agent framework
Author-email: Chris Steel <csteel@syntheticore.com>
License: SYNTHETICORE, INC. PROPRIETARY LICENSE AGREEMENT
        
        Copyright (c) 2025 Syntheticore, Inc. All Rights Reserved.
        
        This software and any accompanying documentation (the “Software”) is the proprietary property of Syntheticore, Inc. and is licensed, not sold. Use, reproduction, modification, or distribution of the Software is strictly limited to those individuals or entities that have received a valid, written license from Syntheticore, Inc.
        
        1. **License Grant**
           Syntheticore, Inc. (“Licensor”) hereby grants the licensee (“Licensee”) a non-exclusive, non-transferable, revocable license to use the Software solely for Licensee’s internal business purposes, under the terms and conditions set forth herein and in the separate license agreement executed by Licensee.
        
        2. **Restrictions**
           Licensee shall not, and shall not permit any third party to:
           a. Sell, lease, sublicense, distribute, or otherwise transfer the Software or any copies thereof;
           b. Reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code of the Software;
           c. Modify, adapt, translate, or create derivative works based on the Software;
           d. Remove, alter, or obscure any proprietary notices or labels on the Software;
           e. Use the Software for any purpose not expressly authorized by this Agreement or the accompanying license document.
        
        3. **Ownership**
           All title, ownership rights, and intellectual property rights in and to the Software remain with Syntheticore, Inc. Neither this Agreement nor any use of the Software transfers to Licensee any rights, title, or interest in or to the Software, except the limited license rights expressly granted herein.
        
        4. **Termination**
           This license will terminate automatically without notice if Licensee fails to comply with any provision of this Agreement. Upon termination, Licensee must cease all use of the Software and destroy all copies in its possession or control.
        
        5. **Disclaimer of Warranty**
           The Software is provided “AS IS” without warranty of any kind. To the fullest extent permitted by applicable law, Syntheticore, Inc. expressly disclaims all warranties, whether express, implied, statutory, or otherwise, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and non-infringement.
        
        6. **Limitation of Liability**
           In no event shall Syntheticore, Inc. be liable for any indirect, incidental, special, consequential, or punitive damages, or any loss of profits or revenues, arising from or related to use of or inability to use the Software, even if advised of the possibility of such damages.
        
        7. **Governing Law**
           This Agreement shall be governed by and construed in accordance with the laws of the State of [State], without regard to its conflict of laws principles.
        
        8. **Entire Agreement**
           This Agreement, together with any separate written license agreement executed by Licensee, constitutes the entire agreement between the parties with respect to the Software and supersedes all prior or contemporaneous understandings and agreements, whether written or oral.
        
        **SYNTHETICORE, INC.**
        
        By: ________________________________________________________________
        Name: _______________________________________________________________
        Title: _______________________________________________________________
        Date: _______________________________________________________________
        
        **LICENSEE**
        
        By: ________________________________________________________________
        Name: _______________________________________________________________
        Title: _______________________________________________________________
        Date: _______________________________________________________________
        
        
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4~=4.13.4
Requires-Dist: chromadb~=1.0.15
Requires-Dist: cryptography~=45.0.5
Requires-Dist: cython~=3.1.2
Requires-Dist: duckdb~=1.3.2
Requires-Dist: google_search_results~=2.4.2
Requires-Dist: gradio~=5.38.2
Requires-Dist: importlib_metadata~=8.7.0
Requires-Dist: Jinja2~=3.1.6
Requires-Dist: joblib>=1.2.0
Requires-Dist: jupyter-core>=4.12
Requires-Dist: langchain~=0.3.27
Requires-Dist: langchain_chroma~=0.2.5
Requires-Dist: langchain_community~=0.3.27
Requires-Dist: langchain_core~=0.3.72
Requires-Dist: langchain_ollama~=0.3.6
Requires-Dist: langchain_openai~=0.3.28
Requires-Dist: langgraph~=0.6.1
Requires-Dist: langgraph_supervisor~=0.0.29
Requires-Dist: Markdown~=3.8.2
Requires-Dist: markdown-it-py<4.0.0,>=1.0.0
Requires-Dist: msal~=1.31.1
Requires-Dist: numpy<2.1,>=1.22
Requires-Dist: openai~=1.98.0
Requires-Dist: pandas<2.2.4,>=2.0
Requires-Dist: pdfkit~=1.0.0
Requires-Dist: pexpect>4.3; sys_platform != "win32" and sys_platform != "emscripten"
Requires-Dist: pg8000~=1.31.4
Requires-Dist: pydantic~=2.11.7
Requires-Dist: pyodbc~=5.2.0
Requires-Dist: PyPDF2~=3.0.1
Requires-Dist: pytest~=7.0.0
Requires-Dist: pytz~=2025.2
Requires-Dist: Requests~=2.32.4
Requires-Dist: requests_html~=0.10.0
Requires-Dist: scipy>=1.6.0
Requires-Dist: setuptools~=80.9.0
Requires-Dist: threadpoolctl>=2.0.0
Requires-Dist: tiktoken~=0.9.0
Requires-Dist: typing_extensions~=4.14.1
Dynamic: license-file
Dynamic: requires-dist

# AIgent

**AIgent** is a modular, extensible AI framework designed to support the construction and orchestration of autonomous agents across a variety of complex tasks. The system is built in Python and leverages modern AI tooling to integrate large language models (LLMs), vector stores, rule-based decision logic, and dynamic tool discovery in secure and performance-conscious environments.

## Features

- Modular agent architecture with support for specialization (e.g., memory agents, reactive agents, compliance agents)
- Cython-compiled backend for performance and IP protection
- Integration with popular frameworks such as LangChain, ChromaDB, and OpenAI
- Support for licensed or embedded deployments via license file verification or compiled-only distribution
- Configurable with runtime enforcement of execution licenses (RSA-signed, machine-bound)

## Use Cases

AIgent is designed to serve as a core intelligence engine for:

- Secure enterprise AI platforms (e.g., QuantumDrive)
- Compliance monitoring and rule-based alerting systems
- Conversational interfaces with dynamic tool execution
- Embedded agents in SaaS and on-premise environments

## Requirements

- Python 3.11+
- Cython
- Compatible dependencies (see `requirements.txt`)

## Required Configuration (Fail‑Fast)

This project does not use dummy/stub fallbacks. Missing config or dependencies cause explicit errors. Configure these before running:

- `VECTORSTORE.PROVIDER`: Set to `faiss` or `chroma`.
- `OPENAI_API_KEY`: Required for components that use OpenAI embeddings (e.g., ThreadMemory; FAISS provider uses OpenAI embeddings).
- `FAISS.INDEX_PATH`: When `VECTORSTORE.PROVIDER=faiss`, must point to an existing FAISS index created by your ingestion pipeline.
- `CHROMA.URL` or `CHROMA.HOST`/`CHROMA.PORT`, else local `CHROMA.PERSIST_DIR` is used for embedded Chroma.
- KGraph (`duckdb_sqlite`) requires `duckdb`, `adbc-driver-duckdb`, and `adbc-driver-manager` Python packages.
- Optional: `SERPAPI_API_KEY` for Discovery; `OLLAMA.HOST`/`OLLAMA.MODEL` for Ollama LLM.

You can set these via environment variables (e.g., `VECTORSTORE_PROVIDER`, `OPENAI_API_KEY`, `CHROMA_URL`) or in the TOML at `~/.config/agentfoundry/agentfoundry.toml` (copied from `agentfoundry/resources/default_agentfoundry.toml`).

Example TOML entries:

```
VECTORSTORE.PROVIDER = "chroma"  # or "faiss"

[CHROMA]
# URL = "https://your-chroma.example.com"  # optional
PERSIST_DIR = "~/.config/agentfoundry/chromadb"

[FAISS]
INDEX_PATH = "~/.config/agentfoundry/faiss_index"
```

## Author

**Christopher Steel**  
AI Practice Lead, AlphaSix Corporation  
Founder, Syntheticore, Inc.  
Email: `csteel@syntheticore.com`

## Licensing and Legal Notice

© Syntheticore, Inc. All rights reserved.

> **This software is proprietary and confidential.**  
> Any use, reproduction, modification, distribution, or commercial deployment of AIgent or any part thereof requires **explicit written authorization** from Syntheticore, Inc.

Unauthorized use is strictly prohibited and may result in legal action.

---

For licensing inquiries or permission to use this software, please contact:  
📧 **csteel@syntheticore.com**

## Gradio Chat Interface

A simple Gradio-based chat interface for interacting with the HybridOrchestrator agent.

### Prerequisites

- Ensure you have set your OpenAI API key:

```bash
export OPENAI_API_KEY=<your_api_key>
```

### Running the App

```bash
python gradio_app.py
```

The interface will be available at http://localhost:7860 by default.

## API Server

Genie can be accessed programmatically via a FastAPI‑based HTTP API. Two main endpoints are provided:

- **POST /v1/chat**: Send or continue a multi‑turn conversation with Genie. Accepts JSON payload with conversation history and returns the assistant reply and updated history.
- **POST /v1/orchestrate**: Discover APIs and execute a main task across all agents. Returns aggregated results.
- **GET /health**: Health check endpoint.

### Prerequisites

- Ensure you have set your OpenAI API key:

```bash
export OPENAI_API_KEY=<your_api_key>
```
- Install FastAPI and Uvicorn (if not already):

```bash
pip install fastapi uvicorn[standard]
```

### Running the API

```bash
python api_server.py
# Or with auto‑reload during development:
uvicorn api_server:app --reload --host 0.0.0.0 --port 8000
```

Interactive API docs will be available at http://localhost:8000/docs

## Logging & Debugging

AgentFoundry automatically logs events to a file and rotates it on each startup.

By default, logs are written to `agentfoundry.log` at INFO level. You can customize
logging behavior via environment variables:

```bash
export AGENTFOUNDRY_LOG_FILE=agentfoundry.log
export AGENTFOUNDRY_LOG_LEVEL=DEBUG  # or INFO, WARNING, ERROR
```

Upon each restart of the application or API server, if `agentfoundry.log` already exists,
it is renamed to `agentfoundry.log.YYYYMMDDHHMMSS` for archival, and a fresh log file
is started. View live logs in `agentfoundry.log` and inspect past runs in the timestamped
backup files.

## Quick Smoke Test (Chroma, local persistence)

This verifies vector search without external APIs:

```
export VECTORSTORE_PROVIDER=chroma
export CHROMA_PERSIST_DIR="$(mktemp -d)"
python - <<'PY'
from agentfoundry.vectorstores.factory import VectorStoreFactory
vs = VectorStoreFactory.get_store(org_id='smoke')
vs.add_texts(["hello world"], metadatas=[{"org_id":"smoke"}], ids=["1"])
hits = vs.similarity_search("hello", k=1, filter={"org_id":"smoke"})
print("Hits:", [h.page_content for h in hits])
PY
```

Expected: `Hits: ['hello world']`.

Notes:
- ThreadMemory requires `OPENAI_API_KEY` and will fail fast if not set.
- FAISS provider raises if `FAISS.INDEX_PATH` does not exist; initialize with your ingestion tooling.

