← All Posts

Getting Started with the Aegis Research Python SDK

2026-01-07 4 min read

Getting Started with the Aegis Research Python SDK

January 7, 2026

We've released the official Python SDK for the Aegis Research API. Whether you're building AI assistants, content pipelines, or research tools, the SDK makes it easy to add AI-powered research to your Python applications.

Installation

pip install aegis-research

The SDK requires Python 3.9+ and has minimal dependencies (just httpx).

Quick Start

from aegis_research import AegisResearch

client = AegisResearch(api_key="your_api_key")

# Run a research query
result = client.research("What are the key differences between REST and GraphQL APIs?")

print(result.summary)
print(f"Sources: {len(result.sources)}")

That's it. One API call, comprehensive research with citations.

Research Depth Levels

The SDK supports three research depths, each balancing speed against comprehensiveness:

Depth Sources Response Time Credits Use Case
shallow 3-5 ~5s 1 Quick facts, definitions
medium 5-8 ~15s 3 Standard research (default)
deep 8-12 ~30s 5 Comprehensive analysis
from aegis_research import ResearchDepth

# Quick lookup
quick = client.research("What is rate limiting?", depth=ResearchDepth.SHALLOW)

# In-depth analysis
detailed = client.research(
    "Compare authentication strategies for microservices",
    depth=ResearchDepth.DEEP
)

Working with Results

Research results include structured data designed for programmatic use:

result = client.research("Best practices for Python logging")

# Summary paragraph
print(result.summary)

# Key findings as bullet points
for finding in result.key_findings:
    print(f"- {finding}")

# Detailed analysis
print(result.detailed_analysis)

# Source citations
for source in result.sources:
    print(f"[{source.title}]({source.url}) - relevance: {source.relevance_score}")

The ResearchResult object provides: - summary: Concise overview paragraph - key_findings: List of main takeaways - detailed_analysis: Extended analysis text - sources: List of Source objects with URL, title, and relevance score - research_id: Unique identifier for referencing later - depth: The depth level used - credits_used: Credits consumed

Credit Management

Monitor your usage with built-in credit tracking:

# Check your balance
credits = client.credits()
print(f"Available: {credits.available}")
print(f"Used this month: {credits.used}")
print(f"Plan: {credits.plan}")

# View pricing tiers
pricing = client.pricing()
for tier in pricing:
    print(f"{tier['name']}: {tier['credits_per_month']} credits - ${tier['price']}/mo")

Async Support

For high-throughput applications, use the async client:

import asyncio
from aegis_research import AegisResearch

async def batch_research():
    client = AegisResearch(api_key="your_api_key")

    topics = [
        "Python async best practices",
        "FastAPI vs Flask comparison",
        "SQLAlchemy 2.0 migration guide"
    ]

    # Run research in parallel
    tasks = [client.research_async(topic) for topic in topics]
    results = await asyncio.gather(*tasks)

    for topic, result in zip(topics, results):
        print(f"\n{topic}:")
        print(result.summary[:200] + "...")

asyncio.run(batch_research())

Error Handling

The SDK provides specific exceptions for different error conditions:

from aegis_research import (
    AegisResearch,
    AuthenticationError,
    RateLimitError,
    InsufficientCreditsError,
    ResearchError
)

client = AegisResearch(api_key="your_api_key")

try:
    result = client.research("My research topic")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after: {e.retry_after}s")
except InsufficientCreditsError:
    print("Out of credits. Upgrade your plan.")
except ResearchError as e:
    print(f"Research failed: {e}")

Real-World Examples

Content Research Brief

def create_content_brief(topic: str) -> dict:
    """Generate a content research brief for writers."""
    client = AegisResearch(api_key="your_api_key")

    result = client.research(
        f"Comprehensive guide to {topic}: key concepts, best practices, common mistakes",
        depth=ResearchDepth.DEEP
    )

    return {
        "topic": topic,
        "overview": result.summary,
        "key_points": result.key_findings,
        "detailed_research": result.detailed_analysis,
        "reference_sources": [
            {"title": s.title, "url": s.url}
            for s in result.sources
        ]
    }

Competitor Analysis

async def analyze_competitors(company: str, competitors: list[str]) -> dict:
    """Research a company and its competitors."""
    client = AegisResearch(api_key="your_api_key")

    # Research all in parallel
    queries = [
        f"{company} products features pricing market position",
        *[f"{c} products features pricing comparison to {company}" for c in competitors]
    ]

    tasks = [client.research_async(q, depth=ResearchDepth.MEDIUM) for q in queries]
    results = await asyncio.gather(*tasks)

    return {
        "company": {
            "name": company,
            "research": results[0].summary,
            "key_findings": results[0].key_findings
        },
        "competitors": [
            {
                "name": c,
                "research": r.summary,
                "differentiators": r.key_findings
            }
            for c, r in zip(competitors, results[1:])
        ]
    }

Tech Decision Support

def compare_technologies(options: list[str], criteria: str) -> dict:
    """Compare technology options for a decision."""
    client = AegisResearch(api_key="your_api_key")

    query = f"Compare {', '.join(options)} for {criteria}. Include pros, cons, and recommendations."
    result = client.research(query, depth=ResearchDepth.DEEP)

    return {
        "comparison": result.summary,
        "key_factors": result.key_findings,
        "detailed_analysis": result.detailed_analysis,
        "sources": len(result.sources),
        "credits_used": result.credits_used
    }

# Usage
decision = compare_technologies(
    options=["PostgreSQL", "MongoDB", "DynamoDB"],
    criteria="high-traffic e-commerce application with complex queries"
)

Configuration Options

client = AegisResearch(
    api_key="your_api_key",
    base_url="https://aegisagent.ai/api/v1/research",  # Default
    timeout=60.0  # Request timeout in seconds
)

Getting an API Key

  1. Visit aegisagent.ai/research
  2. Sign up for a free account (500 credits/month)
  3. Generate an API key from your dashboard

Pricing

Plan Credits/Month Rate Limit Price
Free 500 10/min $0
Starter 2,000 30/min $9/mo
Pro 10,000 60/min $29/mo
Enterprise Unlimited Custom Contact

Resources


Questions? Open an issue on GitHub or reach out at aegis@aegisagent.ai.