Skip to content

Latest commit

 

History

History
166 lines (116 loc) · 2.9 KB

QUICKSTART.md

File metadata and controls

166 lines (116 loc) · 2.9 KB

SynthoraAI Agentic Pipeline - Quick Start Guide

Get up and running with the SynthoraAI Agentic AI Pipeline in 5 minutes!

Prerequisites

  • Python 3.11 or later
  • Google AI API key (Get one here)
  • MongoDB (optional for local testing)

Installation

1. Navigate to the agentic_ai directory

cd agentic_ai

2. Install dependencies

pip install -r requirements.txt

3. Set up environment variables

cp .env.example .env

Edit .env and add your Google AI API key:

GOOGLE_AI_API_KEY=your_google_ai_api_key_here
MONGODB_URI=mongodb://localhost:27017/synthoraai

Quick Test

Option 1: Run the basic example

python examples/basic_usage.py

This will process a sample article and display all the results.

Option 2: Use in your code

Create a file test.py:

import asyncio
from agentic_ai import AgenticPipeline

async def main():
    pipeline = AgenticPipeline()

    result = await pipeline.process_article({
        "id": "test-1",
        "content": "Your article content here...",
        "url": "https://example.com/article",
        "source": "test"
    })

    print(f"Summary: {result['summary']}")
    print(f"Topics: {result['topics']}")
    print(f"Sentiment: {result['sentiment_label']}")

asyncio.run(main())

Run it:

python test.py

Using the MCP Server

Start the server:

python -m agentic_ai.mcp_server.server

Or with uvicorn:

uvicorn agentic_ai.mcp_server.server:app --reload

Test with curl:

curl -X POST http://localhost:8000/process \
  -H "Content-Type: application/json" \
  -d '{
    "id": "test-1",
    "url": "https://example.com",
    "content": "Article content...",
    "source": "test"
  }'

Docker Setup

Quick start with Docker Compose

docker-compose up -d

This starts:

  • Pipeline server on port 8000
  • MongoDB on port 27017
  • Redis on port 6379
  • Prometheus on port 9090

Test the API:

curl http://localhost:8000/health

Next Steps

Troubleshooting

Issue: ImportError for langchain or langgraph

Solution: Make sure you installed all dependencies:

pip install -r requirements.txt

Issue: Google AI API errors

Solution: Verify your API key is correct and has quota:

echo $GOOGLE_AI_API_KEY

Issue: MongoDB connection errors

Solution: Make sure MongoDB is running:

# Start MongoDB locally
mongod --dbpath /path/to/db

Or use MongoDB Atlas (cloud):

MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/synthoraai

Support