Metadata-Version: 2.4
Name: astra-runtime
Version: 0.1.0
Summary: Astra Runtime - Build AI agents, teams, and RAG pipelines in Python with embedded runtime and FastAPI server
Project-URL: Homepage, https://github.com/HeeManSu/astra-agi
Project-URL: Documentation, https://github.com/HeeManSu/astra-agi#readme
Project-URL: Repository, https://github.com/HeeManSu/astra-agi
Project-URL: Issues, https://github.com/HeeManSu/astra-agi/issues
Project-URL: Changelog, https://github.com/HeeManSu/astra-agi/releases
Author-email: Himanshu Sharma <himanshu.kumarr07@gmail.com>
License: MIT
License-File: LICENSE
Keywords: agents,ai,ai-agents,fastapi,framework,langchain-alternative,llm,rag,retrieval-augmented-generation
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Requires-Dist: accelerate>=0.26.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: email-validator>=2.0.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: google-genai>=1.0.0
Requires-Dist: greenlet>=3.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: lancedb>=0.4.0
Requires-Dist: openai>=1.0.0
Requires-Dist: pyarrow>=14.0.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyjwt>=2.8.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: sse-starlette>=2.0.0
Requires-Dist: tiktoken>=0.5.0
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.37.0
Requires-Dist: uvicorn[standard]>=0.27.0
Provides-Extra: all
Requires-Dist: aioboto3>=12.0.0; extra == 'all'
Requires-Dist: beanie>=1.24.0; extra == 'all'
Requires-Dist: boto3>=1.35.0; extra == 'all'
Requires-Dist: motor>=3.3.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: aioboto3>=12.0.0; extra == 'aws'
Requires-Dist: boto3>=1.35.0; extra == 'aws'
Provides-Extra: mongodb
Requires-Dist: beanie>=1.24.0; extra == 'mongodb'
Requires-Dist: motor>=3.3.0; extra == 'mongodb'
Provides-Extra: test
Requires-Dist: httpx>=0.26.0; extra == 'test'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
Requires-Dist: pytest-xdist>=3.5.0; extra == 'test'
Requires-Dist: pytest>=8.0.0; extra == 'test'
Description-Content-Type: text/markdown

# Astra Runtime

🚀 **Build AI agents, teams, and RAG pipelines in pure Python.**

Astra Runtime provides everything you need to build intelligent AI applications:

- **Embedded Mode**: Use agents directly in your Python code
- **Server Mode**: Deploy as REST APIs with FastAPI

[![PyPI version](https://badge.fury.io/py/astra-runtime.svg)](https://badge.fury.io/py/astra-runtime)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install astra-runtime
```

### Optional Dependencies

```bash
# With MongoDB support
pip install astra-runtime[mongodb]

# With AWS Bedrock support
pip install astra-runtime[aws]

# Everything
pip install astra-runtime[all]
```

## Quick Start

### Embedded Mode

```python
import asyncio
from astra import Agent, Gemini

agent = Agent(
    model=Gemini(model="gemini-2.0-flash"),
    instructions="You are a helpful assistant"
)

async def main():
    response = await agent.invoke("Hello!")
    print(response.content)

asyncio.run(main())
```

### Server Mode

```python
from astra import Agent, Gemini
from astra.server import create_app

agent = Agent(
    name="assistant",
    model=Gemini(model="gemini-2.0-flash"),
    instructions="You are a helpful assistant"
)

app = create_app(agents={"assistant": agent})

# Run with: uvicorn main:app --reload
```

### With Tools

```python
from astra import Agent, Tool, tool, Gemini

@tool
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"The weather in {city} is sunny, 72°F"

agent = Agent(
    model=Gemini(model="gemini-2.0-flash"),
    instructions="You are a weather assistant",
    tools=[get_weather]
)
```

### RAG (Retrieval-Augmented Generation)

```python
from astra import Agent, Rag, LanceDB, HuggingFaceEmbedder, Gemini

# Create RAG pipeline
rag = Rag(
    vector_db=LanceDB(path="./my_db"),
    embedder=HuggingFaceEmbedder()
)

# Ingest documents
await rag.ingest("path/to/documents/")

# Create agent with RAG
agent = Agent(
    model=Gemini(model="gemini-2.0-flash"),
    instructions="Answer questions using the provided context",
    rag=rag
)
```

## Features

| Feature           | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| 🤖 **Agents**     | Build intelligent agents with tools, memory, and context      |
| 📚 **RAG**        | Retrieval-Augmented Generation with custom pipelines          |
| 🗄️ **Storage**    | LibSQL, MongoDB, and LanceDB backends                         |
| 🛡️ **Guardrails** | PII filtering, content moderation, prompt injection detection |
| 🔧 **Tools**      | Easy function calling with `@tool` decorator                  |
| 👥 **Teams**      | Multi-agent collaboration and delegation                      |
| 🌐 **Server**     | FastAPI-based REST API with streaming support                 |
| 💾 **Memory**     | Short-term and long-term agent memory                         |
| 🔌 **Middleware** | Input/output processing pipelines                             |

## Model Support

- **Google Gemini**: `Gemini(model="gemini-2.0-flash")`
- **OpenAI**: `OpenAI(model="gpt-4")`
- **AWS Bedrock**: `Bedrock(model="anthropic.claude-3")`
- **HuggingFace Local**: `HuggingFaceLocal("Qwen/Qwen2.5-0.5B-Instruct")`

## Documentation

- 📖 [Examples](https://github.com/HeeManSu/astra-agi/tree/main/packages/runtime/examples)
- 🐛 [Issues](https://github.com/HeeManSu/astra-agi/issues)
- 💬 [Discussions](https://github.com/HeeManSu/astra-agi/discussions)

## License

MIT License - see [LICENSE](LICENSE) for details.
