Skip to main content

⚡ GraphSearch

Ask questions. Get grounded answers. One GraphQL endpoint.

Turn any pile of documents — PDFs, Markdown, plain text — into a typed,
introspectable Q&A API. Zero API keys, zero infrastructure to start.

CI PyPI Python Docker License: MIT

Quickstart · Playground · API · Architecture · Roadmap · Contributing

GraphSearch demo: asking a question in GraphiQL and getting a grounded answer with ranked sources

"How do I get my money back?" finds the returns policy — no shared keywords, no API keys.


✨ Why GraphSearch?

🔍 Semantic search, zero keys Ships with offline embeddings — pip install and ask questions. Add sentence-transformers for real semantic retrieval, still 100% local.
📎 Grounded, cited answers Answers cite their sources as [1], [2], … mapping 1:1 to returned chunks with relevance scores. No hallucination hand-waving.
📄 PDFs welcome Drop PDF / Markdown / text files into the Playground, the uploadFile mutation, or the CLI — text extraction is built in.
🧬 One typed endpoint GraphQL means clients fetch exactly the fields they need, with introspection, GraphiQL, and a generated TypeScript client that fails CI if it drifts from the schema.
🔌 Pluggable everything Embedder, vector store, and LLM are clean interfaces. Swap OpenAI ↔ Claude ↔ offline modes with one env var.
🪶 No infrastructure SQLite + numpy under the hood. No vector DB cluster, no queue, no Redis — until you decide you need one.

🚀 Quickstart

pip install graphsearch-rag        # imports as `graphsearch`
graphsearch-ingest data/example_docs   # or your own .pdf / .md / .txt
graphsearch                            # → http://localhost:8000

That's it — no API keys, no services, no config. Prefer containers?

docker run -p 8000:8000 ghcr.io/mohithgowdak/graphsearch:latest

graphsearch not recognized? With pip install --user (Windows default when site-packages isn't writable), pip's Scripts folder may not be on PATH. Skip PATH entirely:

python -m graphsearch                            # start the server
python -m graphsearch.ingest data/example_docs   # ingest documents

🎮 The Playground

Open http://localhost:8000/ and test RAG with your own documents before writing a line of client code — paste text or drop files, ask questions, inspect ranked sources. Every action has a "Show the GraphQL" toggle revealing the exact query it runs, ready to copy into your app.

The GraphSearch Playground: your documents on the left, grounded answers with ranked sources on the right

Prefer raw GraphQL? GraphiQL lives at http://localhost:8000/graphql.

🎚 Level up the pipeline

The default mode is fully offline (hashing-trick embeddings + extractive answers) so the whole pipeline runs anywhere, including CI. Upgrade each stage independently:

Real semantic search — still no API key (sentence-transformers, ~80 MB model, CPU):

pip install "graphsearch-rag[local]"
export GRAPHSEARCH_EMBEDDINGS=local    # $env:GRAPHSEARCH_EMBEDDINGS='local' on Windows
graphsearch-ingest data/example_docs   # re-ingest: embeddings are created at ingest time
graphsearch

LLM-generated answers with citations (OpenAI or Anthropic):

pip install "graphsearch-rag[anthropic]"   # or [openai]
export GRAPHSEARCH_LLM=anthropic           # or openai
export ANTHROPIC_API_KEY=sk-ant-...
graphsearch
Setting Options Default
GRAPHSEARCH_EMBEDDINGS hash (offline) · local (offline, semantic) · openai hash
GRAPHSEARCH_LLM extractive (offline) · openai · anthropic extractive

Documents are embedded at ingest time — re-ingest after switching embedding backends. Full configuration reference: .env.example

🧩 GraphQL API

# Queries
answer(question: String!, topK: Int): Answer!      # RAG: retrieve + generate, with cited sources
search(query: String!, topK: Int): [Chunk!]!       # raw semantic search
documents(limit: Int = 20, offset: Int = 0): [Document!]!
document(id: ID!): Document

# Mutations
uploadDocument(content: String!, title: String, source: String): Document!
uploadFile(file: Upload!, title: String, source: String): Document!    # PDF/Markdown/text
deleteDocument(id: ID!): Boolean!
Example: ingest and ask in one session
mutation {
  uploadDocument(
    content: "Support hours are 9am-5pm PST, Monday through Friday."
    title: "support-hours"
  ) { id chunkCount }
}

query {
  answer(question: "When is support available?") {
    text                                 # cites sources as [1], [2], ...
    sources { documentTitle text score }
  }
}
File uploads (multipart)

uploadFile follows the GraphQL multipart request spec. PDF text extraction happens server-side via pypdf — scanned/image-only PDFs are rejected with a hint to OCR them first, encrypted PDFs with a hint to decrypt.

TypeScript? clients/typescript ships a fully-typed SDK generated straight from this schema — client.Answer({ question }), client.Search(...), etc. CI regenerates it on every push and fails the build if it drifts from the server.

🏗 Architecture

flowchart LR
    C([Client]) -->|"GraphQL"| S["FastAPI + Strawberry"]
    S --> R["RagService"]
    R --> CH["Chunker<br/>paragraph-aware"]
    R --> E["Embedder<br/>hash · local · OpenAI"]
    R --> V["VectorStore<br/>in-memory cosine"]
    R --> L["LLM<br/>extractive · OpenAI · Claude"]
    V <--> DB[("SQLite<br/>docs · chunks · vectors")]
    style S fill:#e10098,color:#fff
    style R fill:#1c1c28,color:#fff

Every pipeline stage is an abstract interface (Embedder, VectorStore, LLM) — new backends are drop-in additions, and several are up for grabs as good first issues.

🛠 Development

git clone https://github.com/mohithgowdak/graphsearch && cd graphsearch
pip install -e ".[dev]"
ruff check .          # lint
pytest -v             # 33 tests, all fully offline

🗺 Roadmap / good first issues

  • Vector store backends: Qdrant, Weaviate, Redis/Valkey, pgvector, FAISS
  • Embedding backends: Cohere, Voyage
  • Streaming answers via GraphQL subscriptions
  • Metadata tags + filters; hybrid keyword+vector search (SQLite FTS5)
  • Auth (API keys / JWT) and rate limiting
  • Query/embedding caching
  • Auto-generated TypeScript client — see clients/typescript
  • Evaluation harness + Prometheus metrics
  • Advanced RAG: query rewriting, multi-hop retrieval, citation spans

Most of these are filed with implementation notes — grab one 👋

🤝 Contributing

Contributions are very welcome! CONTRIBUTING.md covers setup, the backend-authoring guide, and PR guidelines. Look for the good first issue label to get started.

📄 License

MIT — do whatever you want, just keep the notice.


If GraphSearch saved you from wiring up a RAG pipeline by hand, consider giving it a ⭐ — it helps others find it.

Metadata

Release files for graphsearch-rag 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphsearch-rag 0.4.2
File Size Uploaded Provenance Actions
graphsearch_rag-0.4.2.tar.gz 28.9 kB With provenance Details for graphsearch_rag-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for graphsearch-rag 0.4.2
File Interpreter ABI Platform Actions
graphsearch_rag-0.4.2-py3-none-any.whl Python 3 none any Details for graphsearch_rag-0.4.2-py3-none-any.whl

Total release size: 54.6 kB

Release files / graphsearch_rag-0.4.2.tar.gz

Download URL graphsearch_rag-0.4.2.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f41afb4a1917f5963d16fbb36ea881c3b2cc515d421ea0713f7a200a97fc69ab
BLAKE2b-256 checksum
How to use checksums
f62ce542115442c145c760b43aa7ce22e283af3d3bba6971db0b5a20556c0d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / graphsearch_rag-0.4.2-py3-none-any.whl

Download URL graphsearch_rag-0.4.2-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb32be1adc13c12be0cace4f39ce1e5c01fed44cab92f3db0cec6608ef3c85e1
BLAKE2b-256 checksum
How to use checksums
bc93c0746fa89f9bb5c5969e9854645197452093b12174a66b66fef707460504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Security for graphsearch-rag 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for graphsearch_rag-0.4.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page