Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ashu/fix readme #16

Merged
merged 7 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 133 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,69 @@
# Spielberg

Spielberg is an open source platform for creating agents which interact with your media.

## Features

- Multiple language model integrations for natural language interface
- Specialized agents for distinct media processing tasks
- Custom built UI to support different media interactions
- Flexible database interface for data storage and retrieval

## Getting Started
<!-- PROJECT SHIELDS -->
<!--
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->

[![NPM version][npm-shield]][npm-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![Website][website-shield]][website-url]
[![Discord][discord-shield]][discord-url]

<!-- PROJECT LOGO -->


<h1 align="center">
Spielberg
<br/>
<br />
<a href="https://videodb.io/">
<img src="https://codaio.imgix.net/docs/_s5lUnUCIU/blobs/bl-RgjcFrrJjj/d3cbc44f8584ecd42f2a97d981a144dce6a66d83ddd5864f723b7808c7d1dfbc25034f2f25e1b2188e78f78f37bcb79d3c34ca937cbb08ca8b3da1526c29da9a897ab38eb39d084fd715028b7cc60eb595c68ecfa6fa0bb125ec2b09da65664a4f172c2f" alt="Logo" width="100" height="">
</a>
</h1>


<br />
<p align="center">
<p align="center">
<a href="https://render.com/deploy?repo=https://github.com/video-db/Spielberg" target="_blank" rel="nofollow"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render"></a>
<a href="https://railway.app/template/">
<img src="https://railway.app/button.svg" alt="Deploy on Railway">
</a>
</p>



<p align="center">
Framework for creating AI agents to manage and interact with your media library.
<br />
<a href="https://stackblitz.com/edit/videodb-player-demo-pxy8k7?file=src%2FApp.vue"><strong>View Demo »</strong></a>
<br />
<br />
<a href="https://github.com/video-db/Spielberg/issues">Report Bug</a>
·
<a href="https://github.com/video-db/Spielberg/issues">Request Feature</a>
</p>
</p>

<!-- ABOUT THE PROJECT -->

## 🧐 What is it?
Spielberg provides a flexible framework for developing intelligent media agents that can interact with your audio/video collection in natural language. Whether you're dealing with lectures, movies, social content, youtube videos, TV shows, talks, music, or other digital content, Spielberg offers tools to build powerful AI-powered assistants.

It uses the VideoDB’s powerful infrastructure to create agentic workflows. For example in natural language you can give commands like `“upload this video and send the bullet point summary on my slack”` and the agent will handle the rest.

TODO: Intro video here

## ⭐️ Key Features
- **🤖 AI Agent Framework:** Build custom agents to perform tasks like summarization, search, indexing, clipping and library organization.
- **🎨 Innovative User Experience:** Complete framework with open source chat based UI, Video player and interactions that can help you create the experience you need.
- **🔍 Media Analysis:** Your video infra is taken care by [VideoDB](https://videodb.io). Connect with popular LLMs, Databases, and GenAI APIs seamlessly.
- **🧩 Extensible Architecture:** Easily add new capabilities through tools and modules. Run locally or deploy on your own cloud.


## 🏃 Getting Started
📺 [Watch: Setup video](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

### Prerequisites

Expand All @@ -19,121 +73,123 @@ Spielberg is an open source platform for creating agents which interact with you

### Installation

1. Clone the repository:
**1. Clone the repository:**

``` bash
git clone https://github.com/video-db/Spielberg.git
cd Spielberg
```

2. Set up the environment:
**2. Run the setup script:**

```bash
./setup.sh
```

This script will:
- Install nvm (Node Version Manager) if not already installed
- Install Node.js 22.8.0 using nvm
- Install Python and pip
- Set up virtual environments for both frontend and backend
- Install dependencies for both frontend and backend
> This script will:
> - Install nvm (Node Version Manager) if not already installed
> - Install Node.js 22.8.0 using nvm
> - Install Python and pip
> - Set up virtual environments and install dependencies for frontend and backend

Supported platforms:
- Mac
- Linux
Supported platforms: Mac ✔ Linux ✔

3. Configure the environment variables:
**3. Configure the environment variables:**
Edit the `.env` files to add your API keys and other configuration options.

```bash
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
```

Edit the `.env` files to add your API keys and other configuration options.

[TODO]: Add all supported variables or point to documentation where we have given the list.
## 💬 Running the Application

4. Initialize and configuring the Database
To start both the backend and frontend servers:

For SQLite (default):
```bash
make init-sqlite-db
make run
```

This command will initialize the SQLite DB file in the `backend` directory. No additional configuration is required for SQLite.

For other databases, follow the documentation [here](TODO: Add link to database configuration docs).


## Project Structure
This will start the backend server on `http://127.0.0.1:8000` and the frontend server on `http://127.0.0.1:8080`.

- `backend/`: Contains the Flask backend application
- `frontend/`: Contains the Vue 3 frontend application
- `docs/`: Project documentation
- `infra/`: Infrastructure-related files
To run only the backend server: `make run-be`
To just run the frontend development server: `make run-fe`

## 📖 Documentation

## Running the Application
The project documentation is built using MkDocs. To serve the documentation locally on port 9000:

To start both the backend and frontend servers:
Install dependencies for development:

```bash
make run
make install-be
```

This will start the backend server on `http://127.0.0.1:8000` and the frontend server on `http://127.0.0.1:8080`.

To run only the backend server:

```bash
make run-be
mkdocs serve -a localhost:9000
```

To just run the frontend development server:
To build the documentation:

```bash
make run-fe
mkdocs build
```

## Testing
<!-- CONTRIBUTING -->

To run backend tests:
## 📘 Creating a New Agent
📺 Watch: Code walkthrough

```bash
make test
```
To create a new agent in Spielberg, follow these steps:

## Documentation
1. **Copy the template**: Duplicate `sample_agent.py` in `Spielberg/backend/spielberg/agents/` and rename it to your agent's name.

The project documentation is built using MkDocs. To serve the documentation locally:
2. **Update class details**:
- Rename the class (e.g., from `SampleAgent` to `YourAgentName`)
- Update `agent_name` and `description`

```bash
mkdocs serve
```
3. **Modify the `__call__` method**:
- Update parameters and docstring
- Implement your agent's logic

To build the documentation:
4. **Handle output and status updates**:
- Use appropriate content types (TextContent, VideoContent, ImageContent, SearchResultContent)
- Update `self.output_message.actions` for progress indicators
- Use `push_update()` to emit progress events
- Set content status (progress, success, error) and messages

```bash
mkdocs build
```
5. **Implement error handling**:
- Set error status and messages if issues occur

## Creating Agents
[TODO: Add add agent creation steps]
6. **Finalize the response**:
- Call `self.output_message.publish()` to emit final state and persist session
- Return an `AgentResponse` with result, message, and data

## Deployment
7. **Register the agent**:
- Import your new agent class in `Spielberg/backend/spielberg/handler.py`
- Add it to the `self.agents` list in `ChatHandler`

The project includes configurations for deploying to Railway and Render. Refer to the `docs/get_started/railway.md` and `docs/get_started/render.md` files for deployment instructions.
Remember to consider creating reusable tools if your agent's functionality could be shared across multiple agents.

## Contributing
## 🤝 Contributing

We welcome contributions to the Video Agents project. Please read our [contributing guidelines](docs/get_started/contributing.md) before submitting pull requests.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

## License
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

[TODO: Add license information]
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

## Contact
[npm-shield]: https://img.shields.io/npm/v/@videodb/player-vue?style=for-the-badge
[npm-url]: https://www.npmjs.com/package/@videodb/player-vue
[discord-shield]: https://img.shields.io/badge/dynamic/json?style=for-the-badge&url=https://discord.com/api/invites/py9P639jGz?with_counts=true&query=$.approximate_member_count&logo=discord&logoColor=blue&color=green&label=discord
[discord-url]: https://discord.com/invite/py9P639jGz
[stars-shield]: https://img.shields.io/github/stars/video-db/Spielberg.svg?style=for-the-badge
[stars-url]: https://github.com/video-db/Spielberg/stargazers
[issues-shield]: https://img.shields.io/github/issues/video-db/Spielberg.svg?style=for-the-badge
[issues-url]: https://github.com/video-db/Spielberg/issues
[website-shield]: https://img.shields.io/website?url=https%3A%2F%2Fvideodb.io%2F&style=for-the-badge&label=videodb.io
[website-url]: https://videodb.io/

For questions and support, join our [Discord community](https://discord.com/invite/py9P639jGz).

Loading