Metadata-Version: 2.4
Name: basegrid-io
Version: 0.1.4
Summary: The official Python client for BaseGrid, the memory infrastructure for AI agents.
Project-URL: Homepage, https://basegrid.io
Project-URL: Documentation, https://basegrid.io/docs
Project-URL: Repository, https://github.com/basegridio/sdk
Project-URL: Bug Tracker, https://github.com/basegridio/sdk/issues
Author-email: BaseGrid <hello@basegrid.io>
License: Apache-2.0
Keywords: agents,ai,embeddings,langchain,llamaindex,llm,memory,rag,vector-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.25.0
Provides-Extra: all
Requires-Dist: langchain>=0.1.0; extra == 'all'
Requires-Dist: llama-index>=0.10.0; extra == 'all'
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == 'langchain'
Provides-Extra: llamaindex
Requires-Dist: llama-index>=0.10.0; extra == 'llamaindex'
Description-Content-Type: text/markdown

# BaseGrid Python SDK

The official Python client for [BaseGrid](https://basegrid.io), the memory infrastructure for AI agents.

## Installation

```bash
pip install basegrid-io
```

## Usage

```python
from basegrid import BaseGrid

# Initialize client
client = BaseGrid(api_key="bg_...")

# Add a memory
client.memories.add(
    agent_id="agent-123",
    content="User prefers dark mode and heavily indented code.",
    metadata={"category": "preference"}
)

# Search memories
results = client.memories.search(
    agent_id="agent-123",
    query="What are the user's coding preferences?"
)

for memory in results:
    print(memory.content)
```

## Integrations

### LangChain
```bash
pip install "basegrid-io[langchain]"
```

### LlamaIndex
```bash
pip install "basegrid-io[llamaindex]"
```

## Configuration

```python
client = BaseGrid(
    api_key="bg_...",                                      # Required
    api_url="https://basegrid-production.up.railway.app"   # Optional (default)
)
```

## Troubleshooting

### Connection Refused Error
If you see `ConnectionError: Connection refused`, ensure you're using SDK version **0.1.3 or later**:
```bash
pip install --upgrade basegrid-io
```

Versions before 0.1.3 incorrectly defaulted to `localhost:3000` instead of the production API.
