Skip to content

SpandanM110/Local-First-AI-Astrologer

Repository files navigation

Personal Astrologer — Agent RAG with Local AI Astrology

A conversational AI astrologer that combines local RAG with voice and vision. It delivers Vedic astrology and palmistry guidance grounded in authoritative books. Built on Vision Agents.


At a Glance

What How
Birth charts Local calculation (ephem) + RAG from Vedic astrology textbook
Palm reading Show your palm on camera → Gemini sees it + RAG from Palmistry for All
Voice Gemini Realtime (or Deepgram + ElevenLabs in RAG mode)
Knowledge Local FAISS + sentence-transformers — no cloud indexing
Keys needed GOOGLE_API_KEY + Stream keys. No NVIDIA key for palm reading.

Concept: Agent RAG + Local AI Astrology

Agent RAG — The AI uses a local knowledge base to ground answers in real astrology and palmistry content. Indexing and search run on your machine.

Local AI Astrology — Birth chart calculations use ephem (local). RAG uses FAISS + sentence-transformers (local). Knowledge comes from PDF books you add to knowledge/ (see below).

Voice + Vision — Real-time speech and video. When you show your palm on camera, the agent can analyze it using palmistry knowledge from the RAG.


Architecture

Agent RAG (local)     →  astro_calc, rag_faiss, buffered_analysis
Voice agent           →  agent.py (Gemini Realtime) or agent_rag.py (Deepgram + ElevenLabs)
Vision agent          →  agent.py sees video — palm reading when you show your palm

Main agent (agent.py): Gemini Realtime handles both voice and vision. Palm reading works with GOOGLE_API_KEY only — no NVIDIA key needed.


Features

  • Birth chart analysis — Nakshatra, moon/sun rashi, Vimshottari dasha
  • Compatibility — Kundli matching for two people
  • Palm reading — Show your palm on camera; agent analyzes lines, mounts, shapes
  • Remedies, dashas, transits — RAG-grounded answers
  • Buffered speech — Full analysis prepared before speaking (reduces stuttering)
  • Plain language — Sanskrit terms explained (Tula → Libra, etc.)

Knowledge Base

The agent uses two reference books. These are not in the repo and must never be committed.

Book Purpose
Vedic Astrology: An Integrated Approach Birth charts, nakshatras, dashas, remedies, transits
Palmistry for All Palm lines, mounts, hand shapes

Setup:

  1. Obtain the books (PDFs).
  2. Place them in the knowledge/ folder.
  3. Run python setup_rag.py to build the index.

The knowledge/ folder and all PDFs in it are in .gitignore — they will never be committed.


Setup

1. Install

cd "Personal Astrologer"
python -m venv .venv
.venv\Scripts\activate   # Windows
pip install -r requirements.txt

2. Environment

cp .env.example .env

Edit .env with your keys. Never commit .env — it is gitignored.

Variable For Required
STREAM_API_KEY Video/voice transport Yes
STREAM_API_SECRET Stream Yes
GOOGLE_API_KEY agent.py, agent_rag.py Yes
DEEPGRAM_API_KEY agent_rag.py only Optional
ELEVENLABS_API_KEY agent_rag.py only Optional

3. Build RAG

# After placing PDFs in knowledge/
python setup_rag.py

Running

Main agent (recommended)

python agent.py run

Uses Gemini Realtime for voice and video. Palm reading works when you show your palm on camera. Needs GOOGLE_API_KEY only.

RAG mode (Deepgram + ElevenLabs)

python agent_rag.py run

Requires DEEPGRAM_API_KEY and ELEVENLABS_API_KEY.

Test without Stream

python test_astrology.py

Verifies calculations and RAG. No video/voice.


Palm Reading

  1. Join a call with video on.
  2. Show your palm to the camera.
  3. The agent sees it via Gemini Realtime and uses palmistry knowledge from the RAG.

Keys: GOOGLE_API_KEY (Gemini). No NVIDIA key needed for the main agent.


Project Structure

Personal Astrologer/
├── agent.py              # Main: Gemini Realtime + RAG (voice + vision)
├── agent_rag.py          # Deepgram + Gemini + ElevenLabs + RAG
├── astro_calc.py         # Birth chart calculations
├── rag_faiss.py          # Local FAISS RAG
├── buffered_analysis.py  # Buffered birth chart flow
├── setup_rag.py          # Build RAG from PDFs in knowledge/
├── test_astrology.py     # Tests without Stream
├── requirements.txt
├── .env.example          # Template (no real keys)
└── knowledge/            # Add PDFs here — gitignored, never committed

Security — What Is Never Committed

Item Status
.env Gitignored — API keys stay local
knowledge/ Gitignored — PDF books and extracted text never committed
*.pdf in knowledge Gitignored — explicit backup
faiss_index.bin, faiss_docstore.pkl Gitignored — regenerate with setup_rag.py

License

Proprietary — All Rights Reserved

This software is the exclusive property of the copyright holder. Unauthorized copying, modification, distribution, or use is strictly prohibited. See LICENSE for full terms.

About

A voice and vision AI astrologer with local RAG that gives Vedic astrology and palm-reading guidance from your birth chart and palm on camera.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages