API Overview
Reeflect provides multiple APIs to accommodate different programming environments and use cases. This overview will help you choose the right API for your needs.
Available APIs
Python API
Native Python library for deep integration in Python applications.
- Full feature set
- Direct integration
- High performance
- Extensive customization
JavaScript API
Native JavaScript/TypeScript library for web applications.
- React components
- Browser compatibility
- TypeScript definitions
- Visualization tools
REST API
HTTP-based API for language-agnostic integration.
- Cross-platform
- Stateless operations
- Cloud-based
- SDK-free integration
API Selection Guide
Use Case | Recommended API | Rationale |
---|---|---|
Backend Python service | Python API | Direct integration with full performance and feature set |
Web application | JavaScript API | Built-in React components and browser compatibility |
Mobile application | REST API | Language-agnostic, works with any mobile framework |
Multi-language stack | REST API | Consistent interface across different services |
Data pipeline integration | Python API | Advanced features for batch processing and analytics |
Common API Patterns
Regardless of which API you choose, these common patterns apply across all interfaces:
Memory CRUD Operations
All APIs provide basic Create, Read, Update, Delete operations for memories, with consistent parameter naming and behavior.
Semantic Search
All APIs support semantic search functionality, allowing you to find memories by meaning rather than exact match.
Prompt Enhancement
All APIs provide utilities to enhance prompts with relevant memories, improving context for AI responses.
Memory Extraction
All APIs support extracting important information from conversations and storing it as memories.
Authentication Methods
APIs support multiple authentication methods:
# Python API - API Key Authentication
from reeflect import Reeflect, ApiKeyAuth
memory = Reeflect(
auth=ApiKeyAuth(api_key="your_api_key"),
host="https://api.reeflect.ai"
)
# Python API - OAuth Authentication
from reeflect import Reeflect, OAuthAuth
memory = Reeflect(
auth=OAuthAuth(
client_id="your_client_id",
client_secret="your_client_secret",
auth_url="https://auth.example.com/oauth2/authorize",
token_url="https://auth.example.com/oauth2/token"
),
host="https://api.reeflect.ai"
)
// JavaScript API - API Key Authentication
import { Reeflect } from 'reeflect';
const memory = new Reeflect({
auth: {
type: 'apiKey',
apiKey: 'your_api_key'
},
host: 'https://api.reeflect.ai'
});
// JavaScript API - OAuth Authentication
import { Reeflect, OAuthManager } from 'reeflect';
const oauthManager = new OAuthManager({
clientId: 'your_client_id',
authUrl: 'https://auth.example.com/oauth2/authorize',
redirectUri: 'https://your-app.com/oauth-callback'
});
const memory = new Reeflect({
auth: {
type: 'oauth',
manager: oauthManager
},
host: 'https://api.reeflect.ai'
});
Never hardcode API keys or secrets in client-side code. For browser applications, use environment variables or a secure backend proxy to handle authentication.
Next Steps
Now that you understand the available APIs, you can explore in-depth documentation for your preferred interface: